Function lrs::fs::mount

Mounts a filesystem.

Syntax

fn mount<P, Q, R, S>(src: P, dst: Q, ty: R, flags: MountFlags, data: S) -> Result<(), Errno>
    where R: ToCString,
          Q: ToCString,
          S: ToCString,
          P: ToCString,

Arguments

NameDescription
src

The file that will be mounted.

dst

The point at which it will be mounted.

ty

The type of the filesystem.

flags

The flags to be used to mount the filesystem.

data

Filesystem dependent data.

Remarks

See lrs::fs::flags for pre-defined mount flags.

Examples

The following example bind-mounts a directory a read-only at the path b. Both paths must exist in the current working directory and the example must be executed as root.

mount("a", "b", "", MOUNT_READ_ONLY | MOUNT_BIND, "").unwrap();

The example in unmount shows how to perform the unmount operation.

See also