ksud: fix incorrect umask

This commit is contained in:
tiann
2023-02-21 13:06:37 +08:00
parent 37d2914611
commit 4837f2101c
2 changed files with 17 additions and 1 deletions

View File

@@ -115,3 +115,13 @@ pub fn unshare_mnt_ns() -> Result<()> {
ensure!(ret == 0, "unshare mnt ns failed");
Ok(())
}
#[cfg(any(target_os = "linux", target_os = "android"))]
pub fn umask(mask: u32) {
unsafe { libc::umask(mask) };
}
#[cfg(not(any(target_os = "linux", target_os = "android")))]
pub fn umask(_mask: u32) {
unimplemented!("umask is not supported on this platform")
}