From a52a431b112fd00d6f9dd711f7ffb4cf6e10a3aa Mon Sep 17 00:00:00 2001 From: Michal 'vorner' Vaner Date: Wed, 5 Apr 2017 16:54:33 +0200 Subject: [PATCH] Add support for powerpc Define the architecture-dependent syscall numbers (taken from the corresponding powerpc's header file). This allows compiling and using the crate for powerpc targets (like the builtin powerpc-unknown-linux-gnu). --- CHANGELOG.md | 6 ++++-- src/sys/syscall.rs | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 045756ddb3..e7be2de4c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Marked `sys::mman::{ mmap, munmap, madvise, munlock, msync }` as unsafe. ([#559](https://github.com/nix-rust/nix/pull/559)) - - + +### Fixed +- Fixed compilation on powerpc + ([#569](https://github.com/nix-rust/nix/pull/569)) ## [0.8.0] 2017-03-02 diff --git a/src/sys/syscall.rs b/src/sys/syscall.rs index c2d9e51c12..692b4cef95 100644 --- a/src/sys/syscall.rs +++ b/src/sys/syscall.rs @@ -54,6 +54,16 @@ mod arch { pub static MEMFD_CREATE: Syscall = 354; } +#[cfg(target_arch = "powerpc")] +mod arch { + use libc::c_long; + + pub type Syscall = c_long; + + pub static SYSPIVOTROOT: Syscall = 203; + pub static MEMFD_CREATE: Syscall = 360; +} + extern { pub fn syscall(num: Syscall, ...) -> c_int; }