chiark / gitweb /
libudev: prefix log macros with 'udev_'
[elogind.git] / src / shared / util.h
index efb2c7d324afa0858212c6922ad09c52e401cd9a..17ffd19f55415cfc0c4759021df1d442c14f3fe2 100644 (file)
@@ -100,6 +100,8 @@ bool streq_ptr(const char *a, const char *b);
 
 #define new0(t, n) ((t*) calloc((n), sizeof(t)))
 
+#define newa(t, n) ((t*) alloca(sizeof(t)*(n)))
+
 #define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n))
 
 #define malloc0(n) (calloc((n), 1))
@@ -350,6 +352,7 @@ 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, bool allow_symlink);
+int path_is_read_only_fs(const char *path);
 
 bool is_device_path(const char *path);
 
@@ -414,6 +417,7 @@ char *fstab_node_to_udev_node(const char *p);
 
 bool tty_is_vc(const char *tty);
 bool tty_is_vc_resolve(const char *tty);
+bool tty_is_console(const char *tty);
 int vtnr_from_tty(const char *tty);
 const char *default_term_for_tty(const char *tty);
 
@@ -536,4 +540,6 @@ int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *pa
 
 int setrlimit_closest(int resource, const struct rlimit *rlim);
 
+int getenv_for_pid(pid_t pid, const char *field, char **_value);
+
 #endif