X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=e58a17a825b4db2a93b9e1f4d1711ad8dcb0e192;hp=4b7e12e62838164c93897eb8c28d6842c0b490a1;hb=45030287af1e8e76b0feb1cfc3011a0ef2b37d0d;hpb=a354329f724d6ce913d2ccffb2be8f3327a67faa diff --git a/src/shared/util.h b/src/shared/util.h index 4b7e12e62..e58a17a82 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -143,6 +143,10 @@ static inline const char* true_false(bool b) { return b ? "true" : "false"; } +static inline const char* one_zero(bool b) { + return b ? "1" : "0"; +} + static inline const char* strempty(const char *s) { return s ? s : ""; } @@ -534,7 +538,7 @@ bool tty_is_console(const char *tty) _pure_; int vtnr_from_tty(const char *tty); const char *default_term_for_tty(const char *tty); -void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[]); +void execute_directories(const char* const* directories, usec_t timeout, char *argv[]); int kill_and_sigcont(pid_t pid, int sig); @@ -1010,8 +1014,6 @@ const char *personality_to_string(unsigned long); uint64_t physical_memory(void); -char* mount_test_option(const char *haystack, const char *needle); - void hexdump(FILE *f, const void *p, size_t s); union file_handle_union { @@ -1071,3 +1073,8 @@ int path_getcrtime(const char *p, usec_t *usec); int fd_getcrtime_at(int dirfd, const char *name, usec_t *usec, int flags); int same_fd(int a, int b); + +int chattr_fd(int fd, bool b, unsigned mask); +int chattr_path(const char *p, bool b, unsigned mask); + +#define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })