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

Function mount

src/backend/libc/mount/syscalls.rs:9–25  ·  view source on GitHub ↗
(
    source: Option<&CStr>,
    target: &CStr,
    file_system_type: Option<&CStr>,
    flags: super::types::MountFlagsArg,
    data: Option<&CStr>,
)

Source from the content-addressed store, hash-verified

7
8#[cfg(linux_kernel)]
9pub(crate) fn mount(
10 source: Option<&CStr>,
11 target: &CStr,
12 file_system_type: Option<&CStr>,
13 flags: super::types::MountFlagsArg,
14 data: Option<&CStr>,
15) -> io::Result<()> {
16 unsafe {
17 ret(c::mount(
18 source.map_or_else(null, CStr::as_ptr),
19 target.as_ptr(),
20 file_system_type.map_or_else(null, CStr::as_ptr),
21 flags.0,
22 data.map_or_else(null, CStr::as_ptr).cast(),
23 ))
24 }
25}
26
27#[cfg(linux_kernel)]
28pub(crate) fn unmount(target: &CStr, flags: super::types::UnmountFlags) -> io::Result<()> {

Callers

nothing calls this directly

Calls 2

retFunction · 0.50
as_ptrMethod · 0.45

Tested by

no test coverage detected