X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Futil.h;h=65a5e66ad1a1967cfd5ff22aaf6251d79f6fcb0f;hb=f4579ce704b9db0358b90c282da9536410a4df5a;hp=eda8e5c406e4cb711f7dd95ba426f383e71ba57a;hpb=4fd5948e74b776b6d68ba55f558da5f354179e52;p=elogind.git diff --git a/src/util.h b/src/util.h index eda8e5c40..65a5e66ad 100644 --- a/src/util.h +++ b/src/util.h @@ -29,6 +29,7 @@ #include #include #include +#include #include "macro.h" @@ -58,6 +59,9 @@ typedef struct dual_timestamp { #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); dual_timestamp* dual_timestamp_get(dual_timestamp *ts); @@ -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 get_process_cmdline(pid_t pid, size_t max_length, char **line); char hexchar(int x); int unhexchar(char c); @@ -284,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); +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);