chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: fix corrupted output of units
[elogind.git]
/
src
/
util.h
diff --git
a/src/util.h
b/src/util.h
index 54873e648e1006949abbba3a9c27af300198c630..ccbe8a3efa4ab0bc9d2f77b9eac43f88feb05e8a 100644
(file)
--- a/
src/util.h
+++ b/
src/util.h
@@
-288,13
+288,13
@@
int make_null_stdio(void);
unsigned long long random_ull(void);
unsigned long long random_ull(void);
-#define
DEFINE_STRING_TABLE_LOOKUP(name,type)
\
-
const char *name##_to_string(type i) {
\
+#define
__DEFINE_STRING_TABLE_LOOKUP(name,type,scope)
\
+
scope const char *name##_to_string(type i) {
\
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
return NULL; \
return name##_table[i]; \
} \
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
return NULL; \
return name##_table[i]; \
} \
-
type name##_from_string(const char *s) {
\
+
scope type name##_from_string(const char *s) {
\
type i; \
unsigned u = 0; \
assert(s); \
type i; \
unsigned u = 0; \
assert(s); \
@@
-309,6
+309,8
@@
unsigned long long random_ull(void);
} \
struct __useless_struct_to_allow_trailing_semicolon__
} \
struct __useless_struct_to_allow_trailing_semicolon__
+#define DEFINE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,)
+#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,static)
int fd_nonblock(int fd, bool nonblock);
int fd_cloexec(int fd, bool cloexec);
int fd_nonblock(int fd, bool nonblock);
int fd_cloexec(int fd, bool cloexec);
@@
-341,7
+343,7
@@
int fopen_temporary(const char *path, FILE **_f, char **_temp_path);
ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll);
ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll);
ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll);
ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll);
-int path_is_mount_point(const char *path);
+int path_is_mount_point(const char *path
, bool allow_symlink
);
bool is_device_path(const char *path);
bool is_device_path(const char *path);
@@
-362,7
+364,7
@@
int get_ctty(pid_t, dev_t *_devnr, char **r);
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
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
, bool honour_sticky
);
int pipe_eof(int fd);
int pipe_eof(int fd);
@@
-404,10
+406,6
@@
bool tty_is_vc(const char *tty);
int vtnr_from_tty(const char *tty);
const char *default_term_for_tty(const char *tty);
int vtnr_from_tty(const char *tty);
const char *default_term_for_tty(const char *tty);
-int detect_vm(const char **id);
-int detect_container(const char **id);
-int detect_virtualization(const char **id);
-
void execute_directory(const char *directory, DIR *_d, char *argv[]);
int kill_and_sigcont(pid_t pid, int sig);
void execute_directory(const char *directory, DIR *_d, char *argv[]);
int kill_and_sigcont(pid_t pid, int sig);
@@
-465,6
+463,12
@@
bool is_main_thread(void);
bool in_charset(const char *s, const char* charset);
bool in_charset(const char *s, const char* charset);
+int block_get_whole_disk(dev_t d, dev_t *ret);
+
+int file_is_sticky(const char *p);
+
+int strdup_or_null(const char *a, char **b);
+
#define NULSTR_FOREACH(i, l) \
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
#define NULSTR_FOREACH(i, l) \
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
@@
-500,4
+504,6
@@
int signal_from_string_try_harder(const char *s);
extern int saved_argc;
extern char **saved_argv;
extern int saved_argc;
extern char **saved_argv;
+bool kexec_loaded(void);
+
#endif
#endif