diff --git a/Cargo.toml b/Cargo.toml index 2118dc8..642a384 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redox_syscall" -version = "0.1.10" +version = "0.1.11" 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 2689155..939ebf5 100644 --- a/src/call.rs +++ b/src/call.rs @@ -181,11 +181,6 @@ pub fn lseek(fd: usize, offset: isize, whence: usize) -> Result { unsafe { syscall3(SYS_LSEEK, fd, offset as usize, whence) } } -/// Make a directory, with permissions `mode` -pub fn mkdir(path: &str, mode: u16) -> Result { - unsafe { syscall3(SYS_MKDIR, path.as_ptr() as usize, path.len(), mode as usize) } -} - /// Make a new scheme namespace pub fn mkns(schemes: &[[usize; 2]]) -> Result { unsafe { syscall2(SYS_MKNS, schemes.as_ptr() as usize, schemes.len()) } diff --git a/src/flag.rs b/src/flag.rs index 8565c8f..b031ba6 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -41,6 +41,7 @@ pub const O_CLOEXEC: usize = 0x0100_0000; pub const O_CREAT: usize = 0x0200_0000; pub const O_TRUNC: usize = 0x0400_0000; pub const O_EXCL: usize = 0x0800_0000; +pub const O_DIRECTORY: usize = 0x1000_0000; pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; pub const SEEK_SET: usize = 0; diff --git a/src/number.rs b/src/number.rs index 5dacea5..719c8af 100644 --- a/src/number.rs +++ b/src/number.rs @@ -12,7 +12,6 @@ pub const SYS_RET_FILE: usize = 0x0010_0000; pub const SYS_LINK: usize = SYS_CLASS_PATH | SYS_ARG_PATH | 9; pub const SYS_OPEN: usize = SYS_CLASS_PATH | SYS_RET_FILE | 5; -pub const SYS_MKDIR: usize = SYS_CLASS_PATH | 39; pub const SYS_CHMOD: usize = SYS_CLASS_PATH | 15; pub const SYS_RMDIR: usize = SYS_CLASS_PATH | 84; pub const SYS_UNLINK: usize = SYS_CLASS_PATH | 10; diff --git a/src/scheme.rs b/src/scheme.rs index d0cb8fe..d322f0b 100644 --- a/src/scheme.rs +++ b/src/scheme.rs @@ -6,7 +6,6 @@ pub trait Scheme { fn handle(&self, packet: &mut Packet) { packet.a = Error::mux(match packet.a { SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), - SYS_MKDIR => self.mkdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), @@ -36,11 +35,6 @@ pub trait Scheme { Err(Error::new(ENOENT)) } - #[allow(unused_variables)] - fn mkdir(&self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - #[allow(unused_variables)] fn chmod(&self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT)) @@ -127,7 +121,6 @@ pub trait SchemeMut { fn handle(&mut self, packet: &mut Packet) { packet.a = Error::mux(match packet.a { SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), - SYS_MKDIR => self.mkdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), @@ -156,11 +149,6 @@ pub trait SchemeMut { Err(Error::new(ENOENT)) } - #[allow(unused_variables)] - fn mkdir(&mut self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { - Err(Error::new(ENOENT)) - } - #[allow(unused_variables)] fn chmod(&self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { Err(Error::new(ENOENT))