fix test and example
This commit is contained in:
parent
490dbc9a3b
commit
0950e37073
|
@ -8,7 +8,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[macro_use]
|
||||
extern crate syscall;
|
||||
extern crate sc;
|
||||
|
||||
fn write(fd: usize, buf: &[u8]) {
|
||||
unsafe {
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[macro_use]
|
||||
extern crate syscall;
|
||||
extern crate sc;
|
||||
|
||||
// getpid() is POSIX but that doesn't guarantee it's a system call.
|
||||
#[cfg(any(target_os="linux", target_os="freebsd"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
#[test]
|
||||
fn getpid() {
|
||||
unsafe {
|
||||
assert!(0 < syscall::syscall0(syscall::nr::GETPID));
|
||||
assert!(0 < sc::syscall0(sc::nr::GETPID));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os="linux", target_os="freebsd"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
#[test]
|
||||
fn getpid_macro() {
|
||||
unsafe {
|
||||
|
|
Loading…
Reference in a new issue