diff --git a/Cargo.toml b/Cargo.toml index 52750561d4..0825d75a61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redox_syscall" -version = "0.1.5" +version = "0.1.6" description = "A Rust library to access raw Redox system calls" license = "MIT" authors = ["Jeremy Soller "] diff --git a/src/call.rs b/src/call.rs index 6ea8b2f02d..a2a00a86a5 100644 --- a/src/call.rs +++ b/src/call.rs @@ -226,6 +226,11 @@ pub fn setuid(uid: usize) -> Result { unsafe { syscall1(SYS_SETUID, uid) } } +/// Create and set a new scheme namespace +pub fn setns(schemes: &[[usize; 2]]) -> Result { + unsafe { syscall2(SYS_SETNS, schemes.as_ptr() as usize, schemes.len()) } +} + /// Remove a file pub fn unlink(path: &str) -> Result { unsafe { syscall2(SYS_UNLINK, path.as_ptr() as usize, path.len()) } diff --git a/src/flag.rs b/src/flag.rs index 61da1fd9c8..8565c8f2b4 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -2,7 +2,6 @@ pub const CLONE_VM: usize = 0x100; pub const CLONE_FS: usize = 0x200; pub const CLONE_FILES: usize = 0x400; pub const CLONE_VFORK: usize = 0x4000; -pub const CLONE_NEWNS: usize = 0x8000; pub const CLOCK_REALTIME: usize = 1; pub const CLOCK_MONOTONIC: usize = 4; diff --git a/src/number.rs b/src/number.rs index db90dcde7c..cab0cf4d95 100644 --- a/src/number.rs +++ b/src/number.rs @@ -55,5 +55,6 @@ pub const SYS_VIRTTOPHYS: usize=949; pub const SYS_PIPE2: usize = 331; pub const SYS_SETGID: usize = 214; pub const SYS_SETUID: usize = 213; +pub const SYS_SETNS: usize = 310; pub const SYS_WAITPID: usize = 7; pub const SYS_YIELD: usize = 158;