diff options
author | bors <bors@rust-lang.org> | 2017-06-08 15:56:42 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2017-06-08 15:56:42 +0000 |
commit | 439a4d7d4bc86526e3765d75438edb54ae247246 (patch) | |
tree | 397077128cfcf90faf3d71d67a8907984fc8a681 | |
parent | 5e208ed9b2576269da71b6ebbd0eab8e4085b20a (diff) | |
parent | 4e0e06e3700c64d146eacfc1215a07c5f1657d2b (diff) | |
download | rust-libc-439a4d7d4bc86526e3765d75438edb54ae247246.tar.gz |
Auto merge of #608 - Uplifting:unix, r=alexcrichton
add a number of linux syscalls
vfork, wait4, getresuid, getresgid, personality, vhangup,
swapon, swapoff, getdomainname, setdomainname, iopl, ioperm
-rw-r--r-- | libc-test/build.rs | 5 | ||||
-rw-r--r-- | src/unix/notbsd/linux/mod.rs | 7 | ||||
-rw-r--r-- | src/unix/notbsd/linux/other/b64/x86_64.rs | 3 | ||||
-rw-r--r-- | src/unix/notbsd/mod.rs | 10 |
4 files changed, 25 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index 619b8d3446..d573baaf90 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -181,6 +181,9 @@ fn main() { cfg.header("sys/fsuid.h"); cfg.header("pty.h"); cfg.header("shadow.h"); + if x86_64 { + cfg.header("sys/io.h"); + } } if linux || android { @@ -194,6 +197,8 @@ fn main() { cfg.header("sys/sendfile.h"); cfg.header("sys/vfs.h"); cfg.header("sys/syscall.h"); + cfg.header("sys/personality.h"); + cfg.header("sys/swap.h"); if !uclibc { cfg.header("sys/sysinfo.h"); } diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index a0718452a8..942f51b3a8 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -704,6 +704,10 @@ pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2; pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3; pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4; +pub const ITIMER_REAL: ::c_int = 0; +pub const ITIMER_VIRTUAL: ::c_int = 1; +pub const ITIMER_PROF: ::c_int = 2; + pub const XATTR_CREATE: ::c_int = 0x1; pub const XATTR_REPLACE: ::c_int = 0x2; @@ -1006,6 +1010,9 @@ extern { flags: ::c_int) -> ::ssize_t; pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn vhangup() -> ::c_int; } extern { diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs index ac72359980..e1b65e8e71 100644 --- a/src/unix/notbsd/linux/other/b64/x86_64.rs +++ b/src/unix/notbsd/linux/other/b64/x86_64.rs @@ -574,4 +574,7 @@ extern { argc: ::c_int, ...); pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int; + pub fn iopl(level: ::c_int) -> ::c_int; + pub fn ioperm(from: ::c_ulong, num: ::c_ulong, + turn_on: ::c_int) -> ::c_int; } diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs index 6debd82960..0d31bd16da 100644 --- a/src/unix/notbsd/mod.rs +++ b/src/unix/notbsd/mod.rs @@ -989,9 +989,19 @@ extern { pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int; pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int; + pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, + suid: *mut ::uid_t) -> ::c_int; + pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, + sgid: *mut ::gid_t) -> ::c_int; + pub fn personality(persona: ::c_ulong) -> ::c_int; + pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int; + pub fn swapoff(puath: *const ::c_char) -> ::c_int; pub fn acct(filename: *const ::c_char) -> ::c_int; pub fn brk(addr: *mut ::c_void) -> ::c_int; pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; + pub fn vfork() -> ::pid_t; + pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int, + rusage: *mut ::rusage) -> ::pid_t; } cfg_if! { |