9.35 mount/umount

#define MNT_FAT   1
#define MNT_EXT   2
#define MNT_DEV   3

#define MS_RDONLY   0b0001
#define MS_REMOUNT  0b0010
#define MS_RELATIME 0b0100
#define MS_NOATIME  0b1000

#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.

For mount, flags allows:

For umount, flags allows the following options:

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