Top |
int | mnt_fstype_is_netfs () |
int | mnt_fstype_is_pseudofs () |
const char * | mnt_get_fstab_path () |
char * | mnt_get_mountpoint () |
const char * | mnt_get_mtab_path () |
const char * | mnt_get_swaps_path () |
int | mnt_has_regular_mtab () |
char * | mnt_mangle () |
int | mnt_match_fstype () |
int | mnt_match_options () |
int | mnt_tag_is_valid () |
char * | mnt_unmangle () |
char *
mnt_get_mountpoint (const char *path
);
This function finds the mountpoint that a given path resides in. path
should be canonicalized. The returned pointer should be freed by the caller.
WARNING: the function compares st_dev of the path
elements. This traditional
way maybe be insufficient on filesystems like Linux "overlay". See also
mnt_table_find_target()
.
const char *
mnt_get_mtab_path (void
);
This function returns the *default* location of the mtab file. The result does
not have to be writable. See also mnt_has_regular_mtab()
.
int mnt_has_regular_mtab (const char **mtab
,int *writable
);
If the file does not exist and writable
argument is not NULL, then it will
try to create the file.
int mnt_match_fstype (const char *type
,const char *pattern
);
The pattern
list of filesystems can be prefixed with a global
"no" prefix to invert matching of the whole list. The "no" could
also be used for individual items in the pattern
list. So,
"nofoo,bar" has the same meaning as "nofoo,nobar".
"bar" : "nofoo,bar" -> False (global "no" prefix)
"bar" : "foo,bar" -> True
"bar" : "foo,nobar" -> False
int mnt_match_options (const char *optstr
,const char *pattern
);
The "no" could be used for individual items in the options
list. The "no"
prefix does not have a global meaning.
Unlike fs type matching, nonetdev,user and nonetdev,nouser have DIFFERENT meanings; each option is matched explicitly as specified.
The "no" prefix interpretation could be disabled by the "+" prefix, for example
"+noauto" matches if optstr
literally contains the "noauto" string.
"xxx,yyy,zzz" : "nozzz" -> False
"xxx,yyy,zzz" : "xxx,noeee" -> True
"bar,zzz" : "nofoo" -> True
"nofoo,bar" : "+nofoo" -> True
"bar,zzz" : "+nofoo" -> False