0.1.53 - add funmap to Scheme traits

parent 11fb32af
[package]
name = "redox_syscall"
version = "0.1.52"
version = "0.1.53"
description = "A Rust library to access raw Redox system calls"
license = "MIT"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
......
......@@ -25,6 +25,7 @@ pub trait Scheme {
} else {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -119,6 +120,11 @@ pub trait Scheme {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn funmap(&self, address: usize) -> Result<usize> {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn fpath(&self, id: usize, buf: &mut [u8]) -> Result<usize> {
Err(Error::new(EBADF))
......
......@@ -25,6 +25,7 @@ pub trait SchemeBlock {
} else {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -119,6 +120,11 @@ pub trait SchemeBlock {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn funmap(&self, address: usize) -> Result<Option<usize>> {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn fpath(&self, id: usize, buf: &mut [u8]) -> Result<Option<usize>> {
Err(Error::new(EBADF))
......
......@@ -25,6 +25,7 @@ pub trait SchemeBlockMut {
} else {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -119,6 +120,11 @@ pub trait SchemeBlockMut {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn funmap(&mut self, address: usize) -> Result<Option<usize>> {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result<Option<usize>> {
Err(Error::new(EBADF))
......
......@@ -25,6 +25,7 @@ pub trait SchemeMut {
} else {
Err(Error::new(EFAULT))
},
SYS_FUNMAP => self.funmap(packet.b),
SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }),
SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid),
SYS_FSTAT => if packet.d >= mem::size_of::<Stat>() {
......@@ -119,6 +120,11 @@ pub trait SchemeMut {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn funmap(&mut self, address: usize) -> Result<usize> {
Err(Error::new(EBADF))
}
#[allow(unused_variables)]
fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result<usize> {
Err(Error::new(EBADF))
......
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