summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-06-15 15:35:23 +0200
committerLennart Poettering <lennart@poettering.net>2011-06-21 19:29:45 +0200
commit34ca941cec76bbfdfd02c705b76bc1b53ea2bcd1 (patch)
treeb81128a17066a21c8da2bd767c581e9fea5cf1f1 /src/util.h
parent5f4b19f4bc4b6e747ca19f53ef33a167ecf9ac0b (diff)
util: make a couple of files we write atomic
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/util.h b/src/util.h
index 15dfe17d3b..bd98b654fd 100644
--- a/src/util.h
+++ b/src/util.h
@@ -200,8 +200,9 @@ pid_t get_parent_of_pid(pid_t pid, pid_t *ppid);
int get_starttime_of_pid(pid_t pid, unsigned long long *st);
int write_one_line_file(const char *fn, const char *line);
+int write_one_line_file_atomic(const char *fn, const char *line);
int read_one_line_file(const char *fn, char **line);
-int read_full_file(const char *fn, char **contents);
+int read_full_file(const char *fn, char **contents, size_t *size);
int parse_env_file(const char *fname, const char *separator, ...) _sentinel_;
int load_env_file(const char *fname, char ***l);
@@ -422,6 +423,22 @@ int terminal_vhangup(const char *name);
int vt_disallocate(const char *name);
+int copy_file(const char *from, const char *to);
+int symlink_or_copy(const char *from, const char *to);
+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, ...);
+
+bool hwclock_is_localtime(void);
+
+int hwclock_apply_localtime_delta(void);
+
+int hwclock_get_time(struct tm *tm);
+
+int hwclock_set_time(const struct tm *tm);
+
#define NULSTR_FOREACH(i, l) \
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
@@ -454,14 +471,4 @@ int signal_from_string(const char *s);
int signal_from_string_try_harder(const char *s);
-int conf_files_list(char ***strv, const char *suffix, const char *dir, ...);
-
-bool hwclock_is_localtime(void);
-
-int hwclock_apply_localtime_delta(void);
-
-int hwclock_get_time(struct tm *tm);
-
-int hwclock_set_time(const struct tm *tm);
-
#endif