9.34 mount/umount

#define MNT_FAT   1
#define MNT_EXT   2
#define MS_RDONLY 1

#define MNT_FORCE 1

int mount(const char *source, int source_len, const char *target,
          int target_len, int fs_type, unsigned long flags);
int umount(const char *target, int target_len, int flags);

These syscalls mount and unmount filesystems. For mount, source is the source device while target is where to mount in the global virtual filesystem. For umount, target is the path to unmount.

For mount, fs_type can be one of the following values to choose the filesystem type to mount, it must be specified, detection is not done.

flags may contain MS_RDONLY to force mounting read-only mounting.

For umount, flags allows the following options:

These syscalls returns 0 on success or -1 on failure, with the following errno: