Documentation
1
2
3
4
5
6
7
8
9
10
use crate::{AsCStr, Mode, Result, Syscall, stdio::cwd, syscall_result_unit, syscall3_readonly};

#[inline]
pub fn mkdir<P: AsCStr>(path: P, mode: Mode) -> Result<()> {
    path.try_as_c_str(|path| {
        syscall_result_unit(unsafe {
            syscall3_readonly(Syscall::MKDIRAT, cwd(), path, mode.bits())
        })
    })
}