util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]
This commit is contained in:
@@ -141,39 +141,14 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
|
||||
|
||||
bool fstype_is_network(const char *fstype);
|
||||
|
||||
int dir_is_empty(const char *path);
|
||||
|
||||
static inline int dir_is_populated(const char *path) {
|
||||
int r;
|
||||
r = dir_is_empty(path);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return !r;
|
||||
}
|
||||
|
||||
typedef long statfs_f_type_t;
|
||||
|
||||
bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) _pure_;
|
||||
int fd_check_fstype(int fd, statfs_f_type_t magic_value);
|
||||
int path_check_fstype(const char *path, statfs_f_type_t magic_value);
|
||||
|
||||
bool is_temporary_fs(const struct statfs *s) _pure_;
|
||||
int fd_is_temporary_fs(int fd);
|
||||
|
||||
#define xsprintf(buf, fmt, ...) \
|
||||
assert_message_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf), \
|
||||
"xsprintf: " #buf "[] must be big enough")
|
||||
|
||||
int files_same(const char *filea, const char *fileb);
|
||||
|
||||
int running_in_chroot(void);
|
||||
|
||||
noreturn void freeze(void);
|
||||
|
||||
bool null_or_empty(struct stat *st) _pure_;
|
||||
int null_or_empty_path(const char *fn);
|
||||
int null_or_empty_fd(int fd);
|
||||
|
||||
void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
|
||||
|
||||
bool plymouth_running(void);
|
||||
@@ -452,10 +427,6 @@ union file_handle_union {
|
||||
|
||||
int update_reboot_param_file(const char *param);
|
||||
|
||||
int is_symlink(const char *path);
|
||||
int is_dir(const char *path, bool follow);
|
||||
int is_device_node(const char *path);
|
||||
|
||||
#define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
|
||||
|
||||
#define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
|
||||
|
||||
Reference in New Issue
Block a user