Top |
void | mnt_free_update () |
struct libmnt_update * | mnt_new_update () |
int | mnt_table_replace_file () |
int | mnt_table_write_file () |
int | mnt_update_force_rdonly () |
const char * | mnt_update_get_filename () |
struct libmnt_fs * | mnt_update_get_fs () |
unsigned long | mnt_update_get_mflags () |
int | mnt_update_is_ready () |
int | mnt_update_set_fs () |
int | mnt_update_table () |
The struct libmnt_update provides an abstraction to manage mount options in userspace independently of system configuration. This low-level API works on systems both with and without /etc/mtab. On systems without the regular /etc/mtab file, the userspace mount options (e.g. user=) are stored in the /run/mount/utab file.
It's recommended to use high-level struct libmnt_context API.
void
mnt_free_update (struct libmnt_update *upd
);
Deallocates struct libmnt_update handler.
int mnt_table_replace_file (struct libmnt_table *tb
,const char *filename
);
This function replaces file
by the new content from tb
.
int mnt_table_write_file (struct libmnt_table *tb
,FILE *file
);
This function writes tb
to file
.
const char *
mnt_update_get_filename (struct libmnt_update *upd
);
This function returns the file name (e.g. /etc/mtab) of the up-dated file.
int mnt_update_set_fs (struct libmnt_update *upd
,unsigned long mountflags
,const char *target
,struct libmnt_fs *fs
);
int mnt_update_table (struct libmnt_update *upd
,struct libmnt_lock *lc
);
High-level API to update /etc/mtab (or private /run/mount/utab file).
The lc
lock is optional and will be created if necessary. Note that
an automatically created lock blocks all signals.
See also mnt_lock_block_signals()
and mnt_context_get_lock()
.