Skip to content

Commit c98b9f7

Browse files
author
Andrew Salmon
committed
add a number of syscalls
vfork, wait4, getresuid, getresgid, personality, vhangup, swapon, swapoff, getdomainname, setdomainname, iopl, ioperm
1 parent f1b62c3 commit c98b9f7

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

libc-test/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ fn main() {
193193
cfg.header("sys/sendfile.h");
194194
cfg.header("sys/vfs.h");
195195
cfg.header("sys/syscall.h");
196+
cfg.header("sys/personality.h");
197+
cfg.header("sys/swap.h");
198+
cfg.header("sys/io.h");
196199
if !uclibc {
197200
cfg.header("sys/sysinfo.h");
198201
}

src/unix/notbsd/linux/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,10 @@ pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
703703
pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
704704
pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
705705

706+
pub const ITIMER_REAL: ::c_int = 0;
707+
pub const ITIMER_VIRTUAL: ::c_int = 1;
708+
pub const ITIMER_PROF: ::c_int = 2;
709+
706710
pub const XATTR_CREATE: ::c_int = 0x1;
707711
pub const XATTR_REPLACE: ::c_int = 0x2;
708712

src/unix/notbsd/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,25 @@ extern {
989989
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
990990
pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
991991
pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
992+
pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t,
993+
suid: *mut ::uid_t) -> ::c_int;
994+
pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t,
995+
sgid: *mut ::gid_t) -> ::c_int;
996+
pub fn personality(persona: ::c_ulong) -> ::c_int;
997+
pub fn vhangup() -> ::c_int;
998+
pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
999+
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
1000+
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
1001+
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
1002+
pub fn iopl(level: ::c_int) -> ::c_int;
1003+
pub fn ioperm(from: ::c_ulong, num: ::c_ulong,
1004+
turn_on: ::c_int) -> ::c_int;
9921005
pub fn acct(filename: *const ::c_char) -> ::c_int;
9931006
pub fn brk(addr: *mut ::c_void) -> ::c_int;
9941007
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
1008+
pub fn vfork() -> ::pid_t;
1009+
pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int,
1010+
rusage: *mut ::rusage) -> ::pid_t;
9951011
}
9961012

9971013
cfg_if! {

0 commit comments

Comments
 (0)