chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: temporarily ignore SIGHUP while we are issuing TIOCSTTY
[elogind.git]
/
src
/
shared
/
util.h
diff --git
a/src/shared/util.h
b/src/shared/util.h
index 49756dc21ff7051b910c7897e91fb703e68cf13d..d9b656d2ca081e96ddf76fab60b4e03d35998824 100644
(file)
--- a/
src/shared/util.h
+++ b/
src/shared/util.h
@@
-39,6
+39,7
@@
#include "macro.h"
typedef uint64_t usec_t;
#include "macro.h"
typedef uint64_t usec_t;
+typedef uint64_t nsec_t;
typedef struct dual_timestamp {
usec_t realtime;
typedef struct dual_timestamp {
usec_t realtime;
@@
-53,11
+54,17
@@
typedef struct dual_timestamp {
#define NSEC_PER_USEC 1000ULL
#define USEC_PER_MINUTE (60ULL*USEC_PER_SEC)
#define NSEC_PER_USEC 1000ULL
#define USEC_PER_MINUTE (60ULL*USEC_PER_SEC)
+#define NSEC_PER_MINUTE (60ULL*NSEC_PER_SEC)
#define USEC_PER_HOUR (60ULL*USEC_PER_MINUTE)
#define USEC_PER_HOUR (60ULL*USEC_PER_MINUTE)
+#define NSEC_PER_HOUR (60ULL*NSEC_PER_MINUTE)
#define USEC_PER_DAY (24ULL*USEC_PER_HOUR)
#define USEC_PER_DAY (24ULL*USEC_PER_HOUR)
+#define NSEC_PER_DAY (24ULL*NSEC_PER_HOUR)
#define USEC_PER_WEEK (7ULL*USEC_PER_DAY)
#define USEC_PER_WEEK (7ULL*USEC_PER_DAY)
+#define NSEC_PER_WEEK (7ULL*NSEC_PER_DAY)
#define USEC_PER_MONTH (2629800ULL*USEC_PER_SEC)
#define USEC_PER_MONTH (2629800ULL*USEC_PER_SEC)
+#define NSEC_PER_MONTH (2629800ULL*NSEC_PER_SEC)
#define USEC_PER_YEAR (31557600ULL*USEC_PER_SEC)
#define USEC_PER_YEAR (31557600ULL*USEC_PER_SEC)
+#define NSEC_PER_YEAR (31557600ULL*NSEC_PER_SEC)
/* What is interpreted as whitespace? */
#define WHITESPACE " \t\n\r"
/* What is interpreted as whitespace? */
#define WHITESPACE " \t\n\r"
@@
-139,6
+146,7
@@
void close_many(const int fds[], unsigned n_fd);
int parse_boolean(const char *v);
int parse_usec(const char *t, usec_t *usec);
int parse_boolean(const char *v);
int parse_usec(const char *t, usec_t *usec);
+int parse_nsec(const char *t, nsec_t *nsec);
int parse_bytes(const char *t, off_t *bytes);
int parse_pid(const char *s, pid_t* ret_pid);
int parse_uid(const char *s, uid_t* ret_uid);
int parse_bytes(const char *t, off_t *bytes);
int parse_pid(const char *s, pid_t* ret_pid);
int parse_uid(const char *s, uid_t* ret_uid);
@@
-270,6
+278,7
@@
char *format_timespan(char *buf, size_t l, usec_t t);
int make_stdio(int fd);
int make_null_stdio(void);
int make_stdio(int fd);
int make_null_stdio(void);
+int make_console_stdio(void);
unsigned long long random_ull(void);
unsigned long long random_ull(void);
@@
-313,7
+322,7
@@
int reset_terminal_fd(int fd, bool switch_to_text);
int reset_terminal(const char *name);
int open_terminal(const char *name, int mode);
int reset_terminal(const char *name);
int open_terminal(const char *name, int mode);
-int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm);
+int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm
, usec_t timeout
);
int release_terminal(void);
int flush_fd(int fd);
int release_terminal(void);
int flush_fd(int fd);
@@
-349,7
+358,10
@@
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 fchmod_and_fchown(int fd, 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 fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
+int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev);
+int rm_rf_children_dangerous(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev);
int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky);
int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky);
+int rm_rf_dangerous(const char *path, bool only_dirs, bool delete_root, bool honour_sticky);
int pipe_eof(int fd);
int pipe_eof(int fd);
@@
-439,7
+451,7
@@
int dirent_ensure_type(DIR *d, struct dirent *de);
int in_search_path(const char *path, char **search);
int get_files_in_directory(const char *path, char ***list);
int in_search_path(const char *path, char **search);
int get_files_in_directory(const char *path, char ***list);
-char *join(const char *x, ...) _sentinel_;
+char *
str
join(const char *x, ...) _sentinel_;
bool is_main_thread(void);
bool is_main_thread(void);
@@
-511,4
+523,8
@@
int can_sleep(const char *type);
bool is_valid_documentation_url(const char *url);
bool is_valid_documentation_url(const char *url);
+bool in_initrd(void);
+
+void warn_melody(void);
+
#endif
#endif