diff --git a/Cargo.toml b/Cargo.toml index be32126..530252a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redox_syscall" -version = "0.1.55" +version = "0.1.56" description = "A Rust library to access raw Redox system calls" license = "MIT" authors = ["Jeremy Soller "] diff --git a/src/arch/nonredox.rs b/src/arch/nonredox.rs new file mode 100644 index 0000000..c99d41a --- /dev/null +++ b/src/arch/nonredox.rs @@ -0,0 +1,31 @@ +use super::error::{Error, Result, ENOSYS}; + +pub unsafe fn syscall0(_a: usize) -> Result { + Err(Error::new(ENOSYS)) +} + +pub unsafe fn syscall1(_a: usize, _b: usize) -> Result { + Err(Error::new(ENOSYS)) +} + +// Clobbers all registers - special for clone +pub unsafe fn syscall1_clobber(_a: usize, _b: usize) -> Result { + Err(Error::new(ENOSYS)) +} + +pub unsafe fn syscall2(_a: usize, _b: usize, _c: usize) -> Result { + Err(Error::new(ENOSYS)) +} + +pub unsafe fn syscall3(_a: usize, _b: usize, _c: usize, _d: usize) -> Result { + Err(Error::new(ENOSYS)) +} + +pub unsafe fn syscall4(_a: usize, _b: usize, _c: usize, _d: usize, _e: usize) -> Result { + Err(Error::new(ENOSYS)) +} + +pub unsafe fn syscall5(_a: usize, _b: usize, _c: usize, _d: usize, _e: usize, _f: usize) + -> Result { + Err(Error::new(ENOSYS)) +} diff --git a/src/lib.rs b/src/lib.rs index 018b4d9..6b8d130 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,3 @@ -#![cfg(target_os = "redox")] #![feature(asm)] #![feature(const_fn)] #![cfg_attr(not(test), no_std)] @@ -15,22 +14,26 @@ pub use self::io::*; pub use self::number::*; pub use self::scheme::*; -#[cfg(target_arch = "arm")] +#[cfg(all(target_os = "redox", target_arch = "arm"))] #[path="arch/arm.rs"] mod arch; -#[cfg(target_arch = "aarch64")] +#[cfg(all(target_os = "redox", target_arch = "aarch64"))] #[path="arch/aarch64.rs"] mod arch; -#[cfg(target_arch = "x86")] +#[cfg(all(target_os = "redox", target_arch = "x86"))] #[path="arch/x86.rs"] mod arch; -#[cfg(target_arch = "x86_64")] +#[cfg(all(target_os = "redox", target_arch = "x86_64"))] #[path="arch/x86_64.rs"] mod arch; +#[cfg(not(target_os = "redox"))] +#[path="arch/nonredox.rs"] +mod arch; + /// Function definitions pub mod call;