summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2017-07-09 15:43:39 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2017-07-09 15:43:39 +0000
commit930de3811f024d7e6e5fda3da527d122f9a24279 (patch)
treee6d280c2c59032b5751d2dff04e65bf95c213ee2 /src/sys
parent46e77b57d51118278b2f224b4dd3cde0ad38aa8d (diff)
parentc83b33a2e527336aaadb90e636369ce2d64da942 (diff)
downloadnix-930de3811f024d7e6e5fda3da527d122f9a24279.zip
Merge #662
662: WIP: Fix tier3s r=Susurrus This handles the low-hanging fruit. rust-lang/libc#654 needs to land and there's a bit of work necessary for the syscall and ioctl errors.
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/ioctl/platform/linux.rs5
-rw-r--r--src/sys/signal.rs6
-rw-r--r--src/sys/syscall.rs22
3 files changed, 29 insertions, 4 deletions
diff --git a/src/sys/ioctl/platform/linux.rs b/src/sys/ioctl/platform/linux.rs
index efdd17bb..cdf5b20a 100644
--- a/src/sys/ioctl/platform/linux.rs
+++ b/src/sys/ioctl/platform/linux.rs
@@ -1,7 +1,7 @@
pub const NRBITS: u32 = 8;
pub const TYPEBITS: u32 = 8;
-#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "powerpc64"))]
+#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "powerpc", target_arch = "powerpc64"))]
mod consts {
pub const NONE: u8 = 1;
pub const READ: u8 = 2;
@@ -12,16 +12,19 @@ mod consts {
#[cfg(not(any(target_arch = "powerpc",
target_arch = "mips",
+ target_arch = "mips64",
target_arch = "x86",
target_arch = "arm",
target_arch = "x86_64",
target_arch = "powerpc64",
+ target_arch = "s390x",
target_arch = "aarch64")))]
use this_arch_not_supported;
// "Generic" ioctl protocol
#[cfg(any(target_arch = "x86",
target_arch = "arm",
+ target_arch = "s390x",
target_arch = "x86_64",
target_arch = "aarch64"))]
mod consts {
diff --git a/src/sys/signal.rs b/src/sys/signal.rs
index ee952369..309919b7 100644
--- a/src/sys/signal.rs
+++ b/src/sys/signal.rs
@@ -32,7 +32,7 @@ pub enum Signal {
SIGPIPE = libc::SIGPIPE,
SIGALRM = libc::SIGALRM,
SIGTERM = libc::SIGTERM,
- #[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))]
+ #[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(any(target_arch = "mips", target_arch = "mips64"))))]
SIGSTKFLT = libc::SIGSTKFLT,
SIGCHLD = libc::SIGCHLD,
SIGCONT = libc::SIGCONT,
@@ -58,7 +58,7 @@ pub enum Signal {
pub use self::Signal::*;
-#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))]
+#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(any(target_arch = "mips", target_arch = "mips64"))))]
const SIGNALS: [Signal; 31] = [
SIGHUP,
SIGINT,
@@ -91,7 +91,7 @@ const SIGNALS: [Signal; 31] = [
SIGIO,
SIGPWR,
SIGSYS];
-#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), target_arch = "mips"))]
+#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), any(target_arch = "mips", target_arch = "mips64")))]
const SIGNALS: [Signal; 30] = [
SIGHUP,
SIGINT,
diff --git a/src/sys/syscall.rs b/src/sys/syscall.rs
index cff2cc99..50866ca7 100644
--- a/src/sys/syscall.rs
+++ b/src/sys/syscall.rs
@@ -44,6 +44,7 @@ mod arch {
pub static MEMFD_CREATE: Syscall = 385;
}
+// Rust on mips uses the N32 ABI
#[cfg(target_arch = "mips")]
mod arch {
use libc::c_long;
@@ -54,6 +55,17 @@ mod arch {
pub static MEMFD_CREATE: Syscall = 354;
}
+// Rust on mips64 uses the N64 ABI
+#[cfg(target_arch = "mips64")]
+mod arch {
+ use libc::c_long;
+
+ pub type Syscall = c_long;
+
+ pub static SYSPIVOTROOT: Syscall = 151;
+ pub static MEMFD_CREATE: Syscall = 314;
+}
+
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
mod arch {
use libc::c_long;
@@ -64,6 +76,16 @@ mod arch {
pub static MEMFD_CREATE: Syscall = 360;
}
+#[cfg(target_arch = "s390x")]
+mod arch {
+ use libc::c_long;
+
+ pub type Syscall = c_long;
+
+ pub static SYSPIVOTROOT: Syscall = 217;
+ pub static MEMFD_CREATE: Syscall = 350;
+}
+
extern {
pub fn syscall(num: Syscall, ...) -> c_int;
}