chiark / gitweb /
tree-wide: remove Lennart's copyright lines
[elogind.git] / src / basic / mount-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <fcntl.h>
5 #include <mntent.h>
6 #include <stdbool.h>
7 #include <stdio.h>
8 #include <sys/stat.h>
9 #include <sys/types.h>
10
11 #include "macro.h"
12 #include "missing.h"
13
14 int name_to_handle_at_loop(int fd, const char *path, struct file_handle **ret_handle, int *ret_mnt_id, int flags);
15
16 int path_get_mnt_id(const char *path, int *ret);
17
18 int fd_is_mount_point(int fd, const char *filename, int flags);
19 int path_is_mount_point(const char *path, const char *root, int flags);
20
21 #if 0 /// UNNEEDED by elogind
22 int repeat_unmount(const char *path, int flags);
23
24 int umount_recursive(const char *target, int flags);
25 int bind_remount_recursive(const char *prefix, bool ro, char **blacklist);
26 int bind_remount_recursive_with_mountinfo(const char *prefix, bool ro, char **blacklist, FILE *proc_self_mountinfo);
27
28 int mount_move_root(const char *path);
29 #endif // 0
30
31 DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent);
32 #define _cleanup_endmntent_ _cleanup_(endmntentp)
33
34 #if 0 /// UNNEEDED by elogind
35 bool fstype_is_network(const char *fstype);
36 #endif // 0
37 bool fstype_is_api_vfs(const char *fstype);
38 bool fstype_is_ro(const char *fsype);
39 bool fstype_can_discard(const char *fstype);
40 bool fstype_can_uid_gid(const char *fstype);
41
42 const char* mode_to_inaccessible_node(mode_t mode);
43
44 #if 0 /// UNNEEDED by elogind
45 int mount_verbose(
46                 int error_log_level,
47                 const char *what,
48                 const char *where,
49                 const char *type,
50                 unsigned long flags,
51                 const char *options);
52 int umount_verbose(const char *where);
53 #endif // 0
54
55 const char *mount_propagation_flags_to_string(unsigned long flags);
56 int mount_propagation_flags_from_string(const char *name, unsigned long *ret);
57
58 #if 0 /// UNNEEDED by elogind
59 int mount_option_mangle(
60                 const char *options,
61                 unsigned long mount_flags,
62                 unsigned long *ret_mount_flags,
63                 char **ret_remaining_options);
64 #endif // 0