chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build-sys: prepare release 1
[elogind.git]
/
src
/
util.h
diff --git
a/src/util.h
b/src/util.h
index 241031242121c21f46232c375269c248dd431e78..65a5e66ad1a1967cfd5ff22aaf6251d79f6fcb0f 100644
(file)
--- a/
src/util.h
+++ b/
src/util.h
@@
-29,15
+29,16
@@
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
+#include <sched.h>
#include "macro.h"
typedef uint64_t usec_t;
#include "macro.h"
typedef uint64_t usec_t;
-typedef struct timestamp {
+typedef struct
dual_
timestamp {
usec_t realtime;
usec_t monotonic;
usec_t realtime;
usec_t monotonic;
-} timestamp;
+}
dual_
timestamp;
#define MSEC_PER_SEC 1000ULL
#define USEC_PER_SEC 1000000ULL
#define MSEC_PER_SEC 1000ULL
#define USEC_PER_SEC 1000000ULL
@@
-58,9
+59,12
@@
typedef struct timestamp {
#define FORMAT_TIMESTAMP_MAX 64
#define FORMAT_TIMESPAN_MAX 64
#define FORMAT_TIMESTAMP_MAX 64
#define FORMAT_TIMESPAN_MAX 64
+#define ANSI_HIGHLIGHT_ON "\x1B[1;31m"
+#define ANSI_HIGHLIGHT_OFF "\x1B[0m"
+
usec_t now(clockid_t clock);
usec_t now(clockid_t clock);
-
timestamp* timestamp_get(
timestamp *ts);
+
dual_timestamp* dual_timestamp_get(dual_
timestamp *ts);
usec_t timespec_load(const struct timespec *ts);
struct timespec *timespec_store(struct timespec *ts, usec_t u);
usec_t timespec_load(const struct timespec *ts);
struct timespec *timespec_store(struct timespec *ts, usec_t u);
@@
-179,6
+183,7
@@
int mkdir_p(const char *path, mode_t mode);
int rmdir_parents(const char *path, const char *stop);
int get_process_name(pid_t pid, char **name);
int rmdir_parents(const char *path, const char *stop);
int get_process_name(pid_t pid, char **name);
+int get_process_cmdline(pid_t pid, size_t max_length, char **line);
char hexchar(int x);
int unhexchar(char c);
char hexchar(int x);
int unhexchar(char c);
@@
-226,7
+231,8
@@
unsigned long long random_ull(void);
unsigned u = 0; \
assert(s); \
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \
unsigned u = 0; \
assert(s); \
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \
- if (streq(name##_table[i], s)) \
+ if (name##_table[i] && \
+ streq(name##_table[i], s)) \
return i; \
if (safe_atou(s, &u) >= 0 && \
u < ELEMENTSOF(name##_table)) \
return i; \
if (safe_atou(s, &u) >= 0 && \
u < ELEMENTSOF(name##_table)) \
@@
-283,6
+289,12
@@
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
int rm_rf(const char *path, bool only_dirs, bool delete_root);
int rm_rf(const char *path, bool only_dirs, bool delete_root);
+cpu_set_t* cpu_set_malloc(unsigned *ncpus);
+
+void status_vprintf(const char *format, va_list ap);
+void status_printf(const char *format, ...);
+void status_welcome(void);
+
const char *ioprio_class_to_string(int i);
int ioprio_class_from_string(const char *s);
const char *ioprio_class_to_string(int i);
int ioprio_class_from_string(const char *s);
@@
-301,4
+313,7
@@
int sched_policy_from_string(const char *s);
const char *rlimit_to_string(int i);
int rlimit_from_string(const char *s);
const char *rlimit_to_string(int i);
int rlimit_from_string(const char *s);
+const char *ip_tos_to_string(int i);
+int ip_tos_from_string(const char *s);
+
#endif
#endif