Add umask

parent de0f0624
......@@ -327,6 +327,11 @@ pub fn sigreturn() -> Result<usize> {
unsafe { syscall0(SYS_SIGRETURN) }
}
/// Set the file mode creation mask
pub unsafe fn umask(mask: usize) -> Result<usize> {
syscall1(SYS_UMASK, mask)
}
/// Remove a file
pub fn unlink<T: AsRef<[u8]>>(path: T) -> Result<usize> {
unsafe { syscall2(SYS_UNLINK, path.as_ref().as_ptr() as usize, path.as_ref().len()) }
......
......@@ -69,5 +69,6 @@ pub const SYS_SETRENS: usize = 952;
pub const SYS_SETREUID: usize = 203;
pub const SYS_SIGACTION: usize =67;
pub const SYS_SIGRETURN: usize =119;
pub const SYS_UMASK: usize = 60;
pub const SYS_WAITPID: usize = 7;
pub const SYS_YIELD: usize = 158;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment