MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / mount

Function mount

src/mount/mount_unmount.rs:17–45  ·  view source on GitHub ↗
(
    source: Source,
    target: Target,
    file_system_type: Fs,
    flags: MountFlags,
    data: Data,
)

Source from the content-addressed store, hash-verified

15/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
16#[inline]
17pub fn mount<
18 'a,
19 Source: path::Arg,
20 Target: path::Arg,
21 Fs: path::Arg,
22 Data: Into<Option<&'a CStr>>,
23>(
24 source: Source,
25 target: Target,
26 file_system_type: Fs,
27 flags: MountFlags,
28 data: Data,
29) -> io::Result<()> {
30 source.into_with_c_str(|source| {
31 target.into_with_c_str(|target| {
32 file_system_type.into_with_c_str(|file_system_type| {
33 option_into_with_c_str(data.into(), |data| {
34 backend::mount::syscalls::mount(
35 Some(source),
36 target,
37 Some(file_system_type),
38 MountFlagsArg(flags.bits()),
39 data,
40 )
41 })
42 })
43 })
44 })
45}
46
47/// `mount(NULL, target, NULL, MS_REMOUNT | mountflags, data)`
48///

Callers 5

mount_remountFunction · 0.70
mount_bindFunction · 0.70
mount_bind_recursiveFunction · 0.70
mount_changeFunction · 0.70
mount_moveFunction · 0.70

Calls 3

option_into_with_c_strFunction · 0.85
into_with_c_strMethod · 0.80
MountFlagsArgClass · 0.50

Tested by

no test coverage detected