X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=cca611836370778bc751e081be94540a96a6a983;hb=bbc98d32560cc456531bf254f7b69054921082bd;hp=76bc7b3572ee94d2f1a3356d1beacd10ab577a9c;hpb=3d9a412243035beeaaf3465a62065444a5adf21c;p=elogind.git diff --git a/src/shared/util.h b/src/shared/util.h index 76bc7b357..cca611836 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -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)) @@ -415,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); @@ -446,14 +449,6 @@ int symlink_or_copy_atomic(const char *from, const char *to); int fchmod_umask(int fd, mode_t mode); -int conf_files_list(char ***strv, const char *suffix, const char *dir, ...); - -int hwclock_is_localtime(void); -int hwclock_apply_localtime_delta(int *min); -int hwclock_reset_localtime_delta(void); -int hwclock_get_time(struct tm *tm); -int hwclock_set_time(const struct tm *tm); - bool display_is_local(const char *display); int socket_from_display(const char *display, char **path); @@ -526,8 +521,6 @@ int fd_wait_for_event(int fd, int event, usec_t timeout); void* memdup(const void *p, size_t l); -int rtc_open(int flags); - int is_kernel_thread(pid_t pid); int fd_inc_sndbuf(int fd, size_t n); @@ -537,4 +530,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