diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sys/stat.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sys/stat.rs b/src/sys/stat.rs index 1e0936ed..66c8c9dd 100644 --- a/src/sys/stat.rs +++ b/src/sys/stat.rs @@ -284,3 +284,11 @@ pub fn utimensat<P: ?Sized + NixPath>( Errno::result(res).map(drop) } + +pub fn mkdirat<P: ?Sized + NixPath>(fd: RawFd, path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkdirat(fd, cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} |