More full featured syscall to set namespace

This commit is contained in:
Jeremy Soller
2016-11-16 21:52:24 -07:00
parent f87cbb5313
commit 7b8cc59890
4 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -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 <jackpot51@gmail.com>"]
+5
View File
@@ -226,6 +226,11 @@ pub fn setuid(uid: usize) -> Result<usize> {
unsafe { syscall1(SYS_SETUID, uid) }
}
/// Create and set a new scheme namespace
pub fn setns(schemes: &[[usize; 2]]) -> Result<usize> {
unsafe { syscall2(SYS_SETNS, schemes.as_ptr() as usize, schemes.len()) }
}
/// Remove a file
pub fn unlink(path: &str) -> Result<usize> {
unsafe { syscall2(SYS_UNLINK, path.as_ptr() as usize, path.len()) }
-1
View File
@@ -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;
+1
View File
@@ -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;