]> git.ipfire.org Git - thirdparty/systemd.git/blame_incremental - src/shared/fstab-util.h
ci: enable arm64 runner for build/unit jobs
[thirdparty/systemd.git] / src / shared / fstab-util.h
... / ...
CommitLineData
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2#pragma once
3
4#include "forward.h"
5
6bool fstab_enabled_full(int enabled);
7static inline bool fstab_enabled(void) {
8 return fstab_enabled_full(-1);
9}
10static inline bool fstab_set_enabled(bool enabled) {
11 return fstab_enabled_full(enabled);
12}
13
14bool fstab_is_extrinsic(const char *mount, const char *opts);
15int fstab_has_fstype(const char *fstype);
16
17int fstab_is_mount_point_full(const char *where, const char *path);
18static inline int fstab_is_mount_point(const char *where) {
19 return fstab_is_mount_point_full(where, NULL);
20}
21static inline int fstab_has_node(const char *path) {
22 return fstab_is_mount_point_full(NULL, path);
23}
24
25int fstab_has_mount_point_prefix_strv(char * const *prefixes);
26
27int fstab_filter_options(
28 const char *opts,
29 const char *names,
30 const char **ret_namefound,
31 char **ret_value,
32 char ***ret_values,
33 char **ret_filtered);
34static inline bool fstab_test_option(const char *opts, const char *names) {
35 return fstab_filter_options(opts, names, NULL, NULL, NULL, NULL);
36}
37static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no) {
38 const char *opt_found;
39
40 /* If first name given is last, return 1.
41 * If second name given is last or neither is found, return 0. */
42
43 assert_se(fstab_filter_options(opts, yes_no, &opt_found, NULL, NULL, NULL) >= 0);
44
45 return opt_found == yes_no;
46}
47int fstab_find_pri(const char *opts, int *ret);
48
49char* fstab_node_to_udev_node(const char *p);
50
51const char* fstab_path(void);
52
53bool fstab_is_bind(const char *options, const char *fstype);