From d322aa9a3f8e685eb6f48843f22ec12127f6251d Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sat, 26 Aug 2017 21:03:52 -0700 Subject: Remove syscall module. This module merely contained FFI declarations, and only enough to implement memfd_create() and pivot_root() wrapper functions in nix. Since these declarations are redundant with equivalent FFI declarations in libc, we'll remove them here. In the future, any syscall-related wrapper function will be implemented directly and utilize libc for FFI declarations as we cannot generically expose a type-safe `syscall()` because of its variadic argument list. --- src/unistd.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/unistd.rs') diff --git a/src/unistd.rs b/src/unistd.rs index af38cf2d..fad51272 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -16,7 +16,7 @@ use sys::stat::Mode; use std::fmt; #[cfg(any(target_os = "android", target_os = "linux"))] -pub use self::linux::*; +pub use self::pivot_root::*; #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux", target_os = "openbsd"))] @@ -1647,8 +1647,8 @@ pub fn sysconf(var: SysconfVar) -> Result> { } #[cfg(any(target_os = "android", target_os = "linux"))] -mod linux { - use sys::syscall::{syscall, SYSPIVOTROOT}; +mod pivot_root { + use libc; use {Errno, Result, NixPath}; pub fn pivot_root( @@ -1656,7 +1656,7 @@ mod linux { let res = try!(try!(new_root.with_nix_path(|new_root| { put_old.with_nix_path(|put_old| { unsafe { - syscall(SYSPIVOTROOT, new_root.as_ptr(), put_old.as_ptr()) + libc::syscall(libc::SYS_pivot_root, new_root.as_ptr(), put_old.as_ptr()) } }) }))); -- cgit v1.2.3