summaryrefslogtreecommitdiffstats
path: root/vendor/redox_syscall/src
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/redox_syscall/src')
-rw-r--r--vendor/redox_syscall/src/arch/aarch64.rs32
-rw-r--r--vendor/redox_syscall/src/arch/nonredox.rs3
-rw-r--r--vendor/redox_syscall/src/arch/x86.rs79
-rw-r--r--vendor/redox_syscall/src/arch/x86_64.rs2
-rw-r--r--vendor/redox_syscall/src/call.rs41
-rw-r--r--vendor/redox_syscall/src/daemon.rs62
-rw-r--r--vendor/redox_syscall/src/flag.rs28
-rw-r--r--vendor/redox_syscall/src/io/dma.rs61
-rw-r--r--vendor/redox_syscall/src/lib.rs4
-rw-r--r--vendor/redox_syscall/src/number.rs5
-rw-r--r--vendor/redox_syscall/src/scheme/scheme.rs5
-rw-r--r--vendor/redox_syscall/src/scheme/scheme_block.rs5
-rw-r--r--vendor/redox_syscall/src/scheme/scheme_block_mut.rs5
-rw-r--r--vendor/redox_syscall/src/scheme/scheme_mut.rs5
-rw-r--r--vendor/redox_syscall/src/tests.rs28
15 files changed, 157 insertions, 208 deletions
diff --git a/vendor/redox_syscall/src/arch/aarch64.rs b/vendor/redox_syscall/src/arch/aarch64.rs
index e771396e3..e792427cf 100644
--- a/vendor/redox_syscall/src/arch/aarch64.rs
+++ b/vendor/redox_syscall/src/arch/aarch64.rs
@@ -3,6 +3,8 @@ use core::ops::{Deref, DerefMut};
use super::error::{Error, Result};
+pub const PAGE_SIZE: usize = 4096;
+
macro_rules! syscall {
($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => {
$(
@@ -49,13 +51,6 @@ syscall! {
#[derive(Copy, Clone, Debug, Default)]
#[repr(C)]
pub struct IntRegisters {
- pub elr_el1: usize,
- pub tpidr_el0: usize,
- pub tpidrro_el0: usize,
- pub spsr_el1: usize,
- pub esr_el1: usize,
- pub sp_el0: usize, // Shouldn't be used if interrupt occurred at EL1
- pub padding: usize, // To keep the struct even number aligned
pub x30: usize,
pub x29: usize,
pub x28: usize,
@@ -130,3 +125,26 @@ impl DerefMut for FloatRegisters {
}
}
}
+
+#[derive(Clone, Copy, Debug, Default)]
+#[repr(packed)]
+pub struct EnvRegisters {
+ pub tpidr_el0: usize,
+ pub tpidrro_el0: usize,
+}
+impl Deref for EnvRegisters {
+ type Target = [u8];
+ fn deref(&self) -> &[u8] {
+ unsafe {
+ slice::from_raw_parts(self as *const EnvRegisters as *const u8, mem::size_of::<EnvRegisters>())
+ }
+ }
+}
+
+impl DerefMut for EnvRegisters {
+ fn deref_mut(&mut self) -> &mut [u8] {
+ unsafe {
+ slice::from_raw_parts_mut(self as *mut EnvRegisters as *mut u8, mem::size_of::<EnvRegisters>())
+ }
+ }
+}
diff --git a/vendor/redox_syscall/src/arch/nonredox.rs b/vendor/redox_syscall/src/arch/nonredox.rs
index f99a7148c..65c44fcd8 100644
--- a/vendor/redox_syscall/src/arch/nonredox.rs
+++ b/vendor/redox_syscall/src/arch/nonredox.rs
@@ -1,5 +1,8 @@
use super::error::{Error, Result, ENOSYS};
+// Doesn't really matter, but since we will most likely run on an x86_64 host, why not 4096?
+pub const PAGE_SIZE: usize = 4096;
+
pub unsafe fn syscall0(_a: usize) -> Result<usize> {
Err(Error::new(ENOSYS))
}
diff --git a/vendor/redox_syscall/src/arch/x86.rs b/vendor/redox_syscall/src/arch/x86.rs
index 2f9301e0e..54d8c0a93 100644
--- a/vendor/redox_syscall/src/arch/x86.rs
+++ b/vendor/redox_syscall/src/arch/x86.rs
@@ -4,6 +4,8 @@ use core::ops::{Deref, DerefMut};
use super::error::{Error, Result};
+pub const PAGE_SIZE: usize = 4096;
+
macro_rules! syscall {
($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => {
$(
@@ -80,6 +82,83 @@ pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f:
Error::demux(a)
}
+#[derive(Copy, Clone, Debug, Default)]
+#[repr(C)]
+pub struct IntRegisters {
+ // TODO: Some of these don't get set by Redox yet. Should they?
+
+ pub ebp: usize,
+ pub esi: usize,
+ pub edi: usize,
+ pub ebx: usize,
+ pub eax: usize,
+ pub ecx: usize,
+ pub edx: usize,
+ // pub orig_rax: usize,
+ pub eip: usize,
+ pub cs: usize,
+ pub eflags: usize,
+ pub esp: usize,
+ pub ss: usize,
+ // pub fs_base: usize,
+ // pub gs_base: usize,
+ // pub ds: usize,
+ // pub es: usize,
+ pub fs: usize,
+ // pub gs: usize
+}
+
+impl Deref for IntRegisters {
+ type Target = [u8];
+ fn deref(&self) -> &[u8] {
+ unsafe {
+ slice::from_raw_parts(self as *const IntRegisters as *const u8, mem::size_of::<IntRegisters>())
+ }
+ }
+}
+
+impl DerefMut for IntRegisters {
+ fn deref_mut(&mut self) -> &mut [u8] {
+ unsafe {
+ slice::from_raw_parts_mut(self as *mut IntRegisters as *mut u8, mem::size_of::<IntRegisters>())
+ }
+ }
+}
+
+#[derive(Clone, Copy, Debug, Default)]
+#[repr(packed)]
+pub struct FloatRegisters {
+ pub fcw: u16,
+ pub fsw: u16,
+ pub ftw: u8,
+ pub _reserved: u8,
+ pub fop: u16,
+ pub fip: u64,
+ pub fdp: u64,
+ pub mxcsr: u32,
+ pub mxcsr_mask: u32,
+ pub st_space: [u128; 8],
+ pub xmm_space: [u128; 16],
+ // TODO: YMM/ZMM
+}
+
+impl Deref for FloatRegisters {
+ type Target = [u8];
+ fn deref(&self) -> &[u8] {
+ unsafe {
+ slice::from_raw_parts(self as *const FloatRegisters as *const u8, mem::size_of::<FloatRegisters>())
+ }
+ }
+}
+
+impl DerefMut for FloatRegisters {
+ fn deref_mut(&mut self) -> &mut [u8] {
+ unsafe {
+ slice::from_raw_parts_mut(self as *mut FloatRegisters as *mut u8, mem::size_of::<FloatRegisters>())
+ }
+ }
+}
+
#[derive(Clone, Copy, Debug, Default)]
#[repr(packed)]
pub struct EnvRegisters {
diff --git a/vendor/redox_syscall/src/arch/x86_64.rs b/vendor/redox_syscall/src/arch/x86_64.rs
index f71898e90..2ff57bb2d 100644
--- a/vendor/redox_syscall/src/arch/x86_64.rs
+++ b/vendor/redox_syscall/src/arch/x86_64.rs
@@ -4,6 +4,8 @@ use core::ops::{Deref, DerefMut};
use super::error::{Error, Result};
+pub const PAGE_SIZE: usize = 4096;
+
macro_rules! syscall {
($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => {
$(
diff --git a/vendor/redox_syscall/src/call.rs b/vendor/redox_syscall/src/call.rs
index f6eb89c8c..bc1af0dc2 100644
--- a/vendor/redox_syscall/src/call.rs
+++ b/vendor/redox_syscall/src/call.rs
@@ -12,37 +12,6 @@ extern "C" fn restorer() -> ! {
unreachable!();
}
-/// Change the process's working directory
-///
-/// This function will attempt to set the process's working directory to `path`, which can be
-/// either a relative, scheme relative, or absolute path.
-///
-/// On success, `Ok(0)` will be returned. On error, one of the following errors will be returned.
-///
-/// # Errors
-///
-/// * `EACCES` - permission is denied for one of the components of `path`, or `path`
-/// * `EFAULT` - `path` does not point to the process's addressible memory
-/// * `EIO` - an I/O error occurred
-/// * `ENOENT` - `path` does not exit
-/// * `ENOTDIR` - `path` is not a directory
-pub fn chdir<T: AsRef<str>>(path: T) -> Result<usize> {
- unsafe { syscall2(SYS_CHDIR, path.as_ref().as_ptr() as usize, path.as_ref().len()) }
-}
-
-#[deprecated(
- since = "0.1.55",
- note = "use fchmod instead"
-)]
-pub fn chmod<T: AsRef<str>>(path: T, mode: usize) -> Result<usize> {
- unsafe { syscall3(SYS_CHMOD, path.as_ref().as_ptr() as usize, path.as_ref().len(), mode) }
-}
-
-/// Produce a fork of the current process, or a new process thread
-pub unsafe fn clone(flags: CloneFlags) -> Result<usize> {
- syscall1(SYS_CLONE, flags.bits())
-}
-
/// Close a file
pub fn close(fd: usize) -> Result<usize> {
unsafe { syscall1(SYS_CLOSE, fd) }
@@ -85,11 +54,6 @@ pub fn fcntl(fd: usize, cmd: usize, arg: usize) -> Result<usize> {
unsafe { syscall3(SYS_FCNTL, fd, cmd, arg) }
}
-/// Replace the current process with a new executable
-pub fn fexec(fd: usize, args: &[[usize; 2]], vars: &[[usize; 2]]) -> Result<usize> {
- unsafe { syscall5(SYS_FEXEC, fd, args.as_ptr() as usize, args.len(), vars.as_ptr() as usize, vars.len()) }
-}
-
/// Map a file into memory, but with the ability to set the address to map into, either as a hint
/// or as a requirement of the map.
///
@@ -150,11 +114,6 @@ pub unsafe fn futex(addr: *mut i32, op: usize, val: i32, val2: usize, addr2: *mu
syscall5(SYS_FUTEX, addr as usize, op, (val as isize) as usize, val2, addr2 as usize)
}
-/// Get the current working directory
-pub fn getcwd(buf: &mut [u8]) -> Result<usize> {
- unsafe { syscall2(SYS_GETCWD, buf.as_mut_ptr() as usize, buf.len()) }
-}
-
/// Get the effective group ID
pub fn getegid() -> Result<usize> {
unsafe { syscall0(SYS_GETEGID) }
diff --git a/vendor/redox_syscall/src/daemon.rs b/vendor/redox_syscall/src/daemon.rs
deleted file mode 100644
index 6433bcd7d..000000000
--- a/vendor/redox_syscall/src/daemon.rs
+++ /dev/null
@@ -1,62 +0,0 @@
-use core::convert::Infallible;
-
-use super::{
- clone,
- CloneFlags,
- close,
- EIO,
- Error,
- exit,
- pipe2,
- read,
- Result,
- write,
-};
-
-#[must_use = "Daemon::ready must be called"]
-pub struct Daemon {
- write_pipe: usize,
-}
-
-impl Daemon {
- pub fn new<F: FnOnce(Daemon) -> Infallible>(f: F) -> Result<Infallible> {
- let mut pipes = [0; 2];
- pipe2(&mut pipes, 0)?;
-
- let [read_pipe, write_pipe] = pipes;
-
- if unsafe { clone(CloneFlags::empty())? } == 0 {
- let _ = close(read_pipe);
-
- f(Daemon {
- write_pipe,
- });
- // TODO: Replace Infallible with the never type once it is stabilized.
- unreachable!();
- } else {
- let _ = close(write_pipe);
-
- let mut data = [0];
- let res = read(read_pipe, &mut data);
- let _ = close(read_pipe);
-
- if res? == 1 {
- exit(data[0] as usize)?;
- unreachable!();
- } else {
- Err(Error::new(EIO))
- }
- }
- }
-
- pub fn ready(self) -> Result<()> {
- let res = write(self.write_pipe, &[0]);
- let _ = close(self.write_pipe);
-
- if res? == 1 {
- Ok(())
- } else {
- Err(Error::new(EIO))
- }
- }
-}
diff --git a/vendor/redox_syscall/src/flag.rs b/vendor/redox_syscall/src/flag.rs
index 9788884af..341104856 100644
--- a/vendor/redox_syscall/src/flag.rs
+++ b/vendor/redox_syscall/src/flag.rs
@@ -32,18 +32,6 @@ macro_rules! bitflags {
}
}
-bitflags! {
- pub struct CloneFlags: usize {
- const CLONE_VM = 0x100;
- const CLONE_FS = 0x200;
- const CLONE_FILES = 0x400;
- const CLONE_SIGHAND = 0x800;
- const CLONE_VFORK = 0x4000;
- const CLONE_THREAD = 0x10000;
- const CLONE_STACK = 0x1000_0000;
- }
-}
-
pub const CLOCK_REALTIME: usize = 1;
pub const CLOCK_MONOTONIC: usize = 4;
@@ -213,8 +201,10 @@ bitflags! {
/// If you don't catch this, the child is started as normal.
const PTRACE_EVENT_CLONE = 0x0000_0000_0000_0100;
- const PTRACE_EVENT_MASK = 0x0000_0000_0000_0F00;
+ /// Sent when current-addrspace is changed, allowing the tracer to reopen the memory file.
+ const PTRACE_EVENT_ADDRSPACE_SWITCH = 0x0000_0000_0000_0200;
+ const PTRACE_EVENT_MASK = 0x0000_0000_0000_0F00;
/// Special meaning, depending on the event. Usually, when fired before
/// an action, it will skip performing that action.
@@ -292,13 +282,6 @@ bitflags! {
}
}
-// Auxiliery vector types
-pub const AT_NULL: usize = 0;
-pub const AT_PHDR: usize = 3;
-pub const AT_PHENT: usize = 4;
-pub const AT_PHNUM: usize = 5;
-pub const AT_ENTRY: usize = 9;
-
bitflags! {
pub struct WaitFlags: usize {
const WNOHANG = 0x01;
@@ -307,6 +290,11 @@ bitflags! {
}
}
+pub const ADDRSPACE_OP_MMAP: usize = 0;
+pub const ADDRSPACE_OP_MUNMAP: usize = 1;
+pub const ADDRSPACE_OP_MPROTECT: usize = 2;
+pub const ADDRSPACE_OP_TRANSFER: usize = 3;
+
/// True if status indicates the child is stopped.
pub fn wifstopped(status: usize) -> bool {
(status & 0xff) == 0x7f
diff --git a/vendor/redox_syscall/src/io/dma.rs b/vendor/redox_syscall/src/io/dma.rs
index b356c8abe..0613fc9fc 100644
--- a/vendor/redox_syscall/src/io/dma.rs
+++ b/vendor/redox_syscall/src/io/dma.rs
@@ -3,7 +3,8 @@ use core::ops::{Deref, DerefMut};
use core::{ptr, slice};
use crate::Result;
-use crate::{PartialAllocStrategy, PhysallocFlags};
+use crate::{PartialAllocStrategy, PhysallocFlags, PhysmapFlags};
+use crate::arch::PAGE_SIZE;
/// An RAII guard of a physical memory allocation. Currently all physically allocated memory are
/// page-aligned and take up at least 4k of space (on x86_64).
@@ -13,12 +14,35 @@ pub struct PhysBox {
size: usize
}
+const fn round_up(x: usize) -> usize {
+ (x + PAGE_SIZE - 1) / PAGE_SIZE * PAGE_SIZE
+}
+fn assert_aligned(x: usize) {
+ assert_eq!(x % PAGE_SIZE, 0);
+}
+
+#[cfg(target_arch = "aarch64")]
+fn physmap_flags() -> PhysmapFlags {
+ // aarch64 currently must map DMA memory without caching to ensure coherence
+ crate::PHYSMAP_NO_CACHE | crate::PHYSMAP_WRITE
+}
+
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+fn physmap_flags() -> PhysmapFlags {
+ // x86 ensures cache coherence with DMA memory
+ crate::PHYSMAP_WRITE
+}
+
impl PhysBox {
- /// Construct a PhysBox from an address and a size.
+ /// Construct a PhysBox from an address and a size. The address must be page-aligned, and the
+ /// size must similarly be a multiple of the page size.
///
/// # Safety
/// This function is unsafe because when dropping, Self has to a valid allocation.
pub unsafe fn from_raw_parts(address: usize, size: usize) -> Self {
+ assert_aligned(address);
+ assert_aligned(size);
+
Self {
address,
size,
@@ -42,12 +66,10 @@ impl PhysBox {
pub fn new_with_flags(size: usize, flags: PhysallocFlags) -> Result<Self> {
assert!(!flags.contains(PhysallocFlags::PARTIAL_ALLOC));
+ assert_aligned(size);
let address = unsafe { crate::physalloc2(size, flags.bits())? };
- Ok(Self {
- address,
- size,
- })
+ Ok(unsafe { Self::from_raw_parts(address, size) })
}
/// "Partially" allocate physical memory, in the sense that the allocation may be smaller than
@@ -57,21 +79,18 @@ impl PhysBox {
/// that first allocation only returns half the size, the driver can do another allocation
/// and then let the device use both buffers.
pub fn new_partial_allocation(size: usize, flags: PhysallocFlags, strategy: Option<PartialAllocStrategy>, mut min: usize) -> Result<Self> {
+ assert_aligned(size);
debug_assert!(!(flags.contains(PhysallocFlags::PARTIAL_ALLOC) && strategy.is_none()));
- let address = unsafe { crate::physalloc3(size, flags.bits() | strategy.map(|s| s as usize).unwrap_or(0), &mut min)? };
- Ok(Self {
- address,
- size: min,
- })
+ let address = unsafe { crate::physalloc3(size, flags.bits() | strategy.map_or(0, |s| s as usize), &mut min)? };
+ Ok(unsafe { Self::from_raw_parts(address, size) })
}
pub fn new(size: usize) -> Result<Self> {
+ assert_aligned(size);
+
let address = unsafe { crate::physalloc(size)? };
- Ok(Self {
- address,
- size,
- })
+ Ok(unsafe { Self::from_raw_parts(address, size) })
}
}
@@ -88,7 +107,7 @@ pub struct Dma<T: ?Sized> {
impl<T> Dma<T> {
pub fn from_physbox_uninit(phys: PhysBox) -> Result<Dma<MaybeUninit<T>>> {
- let virt = unsafe { crate::physmap(phys.address, phys.size, crate::PHYSMAP_WRITE)? } as *mut MaybeUninit<T>;
+ let virt = unsafe { crate::physmap(phys.address, phys.size, physmap_flags())? } as *mut MaybeUninit<T>;
Ok(Dma {
phys,
@@ -111,11 +130,11 @@ impl<T> Dma<T> {
}
pub fn new(value: T) -> Result<Self> {
- let phys = PhysBox::new(mem::size_of::<T>())?;
+ let phys = PhysBox::new(round_up(mem::size_of::<T>()))?;
Self::from_physbox(phys, value)
}
pub fn zeroed() -> Result<Dma<MaybeUninit<T>>> {
- let phys = PhysBox::new(mem::size_of::<T>())?;
+ let phys = PhysBox::new(round_up(mem::size_of::<T>()))?;
Self::from_physbox_zeroed(phys)
}
}
@@ -149,7 +168,7 @@ impl<T> Dma<[T]> {
assert!(len <= max_len);
Ok(Dma {
- virt: unsafe { slice::from_raw_parts_mut(crate::physmap(phys.address, phys.size, crate::PHYSMAP_WRITE)? as *mut MaybeUninit<T>, len) } as *mut [MaybeUninit<T>],
+ virt: unsafe { slice::from_raw_parts_mut(crate::physmap(phys.address, phys.size, physmap_flags())? as *mut MaybeUninit<T>, len) } as *mut [MaybeUninit<T>],
phys,
})
}
@@ -163,7 +182,7 @@ impl<T> Dma<[T]> {
/// * `T` must be properly aligned.
/// * `T` must be valid as zeroed (i.e. no NonNull pointers).
pub unsafe fn zeroed_unsized(count: usize) -> Result<Self> {
- let phys = PhysBox::new(mem::size_of::<T>() * count)?;
+ let phys = PhysBox::new(round_up(mem::size_of::<T>() * count))?;
Ok(Self::from_physbox_zeroed_unsized(phys, count)?.assume_init())
}
}
@@ -195,6 +214,6 @@ impl<T: ?Sized> DerefMut for Dma<T> {
impl<T: ?Sized> Drop for Dma<T> {
fn drop(&mut self) {
unsafe { ptr::drop_in_place(self.virt) }
- let _ = unsafe { crate::physunmap(self.virt as *mut u8 as usize) };
+ let _ = unsafe { crate::funmap(self.virt as *mut u8 as usize, self.phys.size) };
}
}
diff --git a/vendor/redox_syscall/src/lib.rs b/vendor/redox_syscall/src/lib.rs
index 9c5939830..3f6d88479 100644
--- a/vendor/redox_syscall/src/lib.rs
+++ b/vendor/redox_syscall/src/lib.rs
@@ -5,7 +5,6 @@ extern crate core;
pub use self::arch::*;
pub use self::call::*;
-pub use self::daemon::*;
pub use self::data::*;
pub use self::error::*;
pub use self::flag::*;
@@ -43,9 +42,6 @@ pub mod call;
/// Complex structures that are used for some system calls
pub mod data;
-/// Wrapper to make daemons easier to write
-pub mod daemon;
-
/// All errors that can be generated by a system call
pub mod error;
diff --git a/vendor/redox_syscall/src/number.rs b/vendor/redox_syscall/src/number.rs
index 1f037eb19..2b9205a26 100644
--- a/vendor/redox_syscall/src/number.rs
+++ b/vendor/redox_syscall/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_CHMOD: usize = SYS_CLASS_PATH | 15;
pub const SYS_RMDIR: usize = SYS_CLASS_PATH | 84;
pub const SYS_UNLINK: usize = SYS_CLASS_PATH | 10;
@@ -26,7 +25,6 @@ pub const SYS_FCHMOD: usize = SYS_CLASS_FILE | 94;
pub const SYS_FCHOWN: usize = SYS_CLASS_FILE | 207;
pub const SYS_FCNTL: usize = SYS_CLASS_FILE | 55;
pub const SYS_FEVENT: usize = SYS_CLASS_FILE | 927;
-pub const SYS_FEXEC: usize = SYS_CLASS_FILE | 11;
pub const SYS_FMAP_OLD: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 90;
pub const SYS_FMAP: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 900;
pub const SYS_FUNMAP_OLD: usize = SYS_CLASS_FILE | 91;
@@ -39,12 +37,9 @@ pub const SYS_FSYNC: usize = SYS_CLASS_FILE | 118;
pub const SYS_FTRUNCATE: usize = SYS_CLASS_FILE | 93;
pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 320;
-pub const SYS_CHDIR: usize = 12;
pub const SYS_CLOCK_GETTIME: usize = 265;
-pub const SYS_CLONE: usize = 120;
pub const SYS_EXIT: usize = 1;
pub const SYS_FUTEX: usize = 240;
-pub const SYS_GETCWD: usize = 183;
pub const SYS_GETEGID: usize = 202;
pub const SYS_GETENS: usize = 951;
pub const SYS_GETEUID: usize = 201;
diff --git a/vendor/redox_syscall/src/scheme/scheme.rs b/vendor/redox_syscall/src/scheme/scheme.rs
index 249d28c6e..6bf36172c 100644
--- a/vendor/redox_syscall/src/scheme/scheme.rs
+++ b/vendor/redox_syscall/src/scheme/scheme.rs
@@ -14,11 +14,6 @@ pub trait Scheme {
} else {
Err(Error::new(EINVAL))
},
- SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
- self.chmod(path, packet.d as u16, packet.uid, packet.gid)
- } else {
- Err(Error::new(EINVAL))
- },
SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
self.rmdir(path, packet.uid, packet.gid)
} else {
diff --git a/vendor/redox_syscall/src/scheme/scheme_block.rs b/vendor/redox_syscall/src/scheme/scheme_block.rs
index e22535e0f..3b3de4bc9 100644
--- a/vendor/redox_syscall/src/scheme/scheme_block.rs
+++ b/vendor/redox_syscall/src/scheme/scheme_block.rs
@@ -14,11 +14,6 @@ pub trait SchemeBlock {
} else {
Err(Error::new(EINVAL))
},
- SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
- self.chmod(path, packet.d as u16, packet.uid, packet.gid)
- } else {
- Err(Error::new(EINVAL))
- },
SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
self.rmdir(path, packet.uid, packet.gid)
} else {
diff --git a/vendor/redox_syscall/src/scheme/scheme_block_mut.rs b/vendor/redox_syscall/src/scheme/scheme_block_mut.rs
index c1e54351a..1fae3a0e5 100644
--- a/vendor/redox_syscall/src/scheme/scheme_block_mut.rs
+++ b/vendor/redox_syscall/src/scheme/scheme_block_mut.rs
@@ -14,11 +14,6 @@ pub trait SchemeBlockMut {
} else {
Err(Error::new(EINVAL))
},
- SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
- self.chmod(path, packet.d as u16, packet.uid, packet.gid)
- } else {
- Err(Error::new(EINVAL))
- },
SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
self.rmdir(path, packet.uid, packet.gid)
} else {
diff --git a/vendor/redox_syscall/src/scheme/scheme_mut.rs b/vendor/redox_syscall/src/scheme/scheme_mut.rs
index deb148366..b364b62aa 100644
--- a/vendor/redox_syscall/src/scheme/scheme_mut.rs
+++ b/vendor/redox_syscall/src/scheme/scheme_mut.rs
@@ -14,11 +14,6 @@ pub trait SchemeMut {
} else {
Err(Error::new(EINVAL))
},
- SYS_CHMOD => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
- self.chmod(path, packet.d as u16, packet.uid, packet.gid)
- } else {
- Err(Error::new(EINVAL))
- },
SYS_RMDIR => if let Some(path) = unsafe { str_from_raw_parts(packet.b as *const u8, packet.c) } {
self.rmdir(path, packet.uid, packet.gid)
} else {
diff --git a/vendor/redox_syscall/src/tests.rs b/vendor/redox_syscall/src/tests.rs
index c5e1f8df0..fdff89b4b 100644
--- a/vendor/redox_syscall/src/tests.rs
+++ b/vendor/redox_syscall/src/tests.rs
@@ -1,30 +1,4 @@
#[test]
-fn chdir() {
- use std::str;
-
- let mut current_buf = [0; 4096];
- let current_count = dbg!(crate::getcwd(&mut current_buf)).unwrap();
- let current = dbg!(str::from_utf8(&current_buf[..current_count])).unwrap();
-
- let new = "file:";
- assert_eq!(dbg!(crate::chdir(dbg!(new))), Ok(0));
- {
- let mut buf = [0; 4096];
- let count = dbg!(crate::getcwd(&mut buf)).unwrap();
- assert_eq!(dbg!(str::from_utf8(&buf[..count])), Ok(new));
- }
-
- assert_eq!(dbg!(crate::chdir(current)), Ok(0));
- {
- let mut buf = [0; 4096];
- let count = dbg!(crate::getcwd(&mut buf)).unwrap();
- assert_eq!(dbg!(str::from_utf8(&buf[..count])), Ok(current));
- }
-}
-
-//TODO: chmod
-
-#[test]
fn clone() {
let expected_status = 42;
let pid_res = unsafe { crate::clone(crate::CloneFlags::empty()) };
@@ -207,8 +181,6 @@ fn fstatvfs() {
//TODO: futex
-// getcwd tested by chdir
-
#[test]
fn getegid() {
assert_eq!(crate::getegid(), Ok(0));