Skip to content

Commit a52a431

Browse files
committed
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).
1 parent 44c0ecb commit a52a431

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1212
### Changed
1313
- Marked `sys::mman::{ mmap, munmap, madvise, munlock, msync }` as unsafe.
1414
([#559](https://github.com/nix-rust/nix/pull/559))
15-
16-
<!--### Fixed-->
15+
16+
### Fixed
17+
- Fixed compilation on powerpc
18+
([#569](https://github.com/nix-rust/nix/pull/569))
1719

1820
## [0.8.0] 2017-03-02
1921

src/sys/syscall.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ mod arch {
5454
pub static MEMFD_CREATE: Syscall = 354;
5555
}
5656

57+
#[cfg(target_arch = "powerpc")]
58+
mod arch {
59+
use libc::c_long;
60+
61+
pub type Syscall = c_long;
62+
63+
pub static SYSPIVOTROOT: Syscall = 203;
64+
pub static MEMFD_CREATE: Syscall = 360;
65+
}
66+
5767
extern {
5868
pub fn syscall(num: Syscall, ...) -> c_int;
5969
}

0 commit comments

Comments
 (0)