Skip to content

Commit 27c693e

Browse files
author
Andrew Salmon
committed
add unix utilities assumed portable (expecting build failures)
1 parent 6fb7c90 commit 27c693e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/unix/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ extern {
518518
link_name = "kill$UNIX2003")]
519519
pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
520520

521+
pub fn brk(addr: *mut ::c_void) -> ::c_int;
522+
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
523+
521524
pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
522525
pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
523526
pub fn mlockall(flags: ::c_int) -> ::c_int;
@@ -584,6 +587,8 @@ extern {
584587
#[cfg_attr(target_os = "netbsd", link_name = "__gettimeofday50")]
585588
pub fn gettimeofday(tp: *mut ::timeval,
586589
tz: *mut ::c_void) -> ::c_int;
590+
#[cfg_attr(target_os = "netbsd", link_name = "__settimeofday50")]
591+
pub fn settimeofday(tv: *const timeval, tz: *const ::timezone) -> ::c_int;
587592
#[cfg_attr(target_os = "netbsd", link_name = "__times13")]
588593
pub fn times(buf: *mut ::tms) -> ::clock_t;
589594

@@ -745,6 +750,7 @@ extern {
745750
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
746751
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
747752
pub fn chroot(name: *const ::c_char) -> ::c_int;
753+
pub fn acct(filename: *const ::c_char) -> ::c_int;
748754
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
749755
link_name = "usleep$UNIX2003")]
750756
pub fn usleep(secs: ::c_uint) -> ::c_int;
@@ -817,6 +823,8 @@ extern {
817823
-> ::c_int;
818824
#[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")]
819825
pub fn sigpending(set: *mut sigset_t) -> ::c_int;
826+
#[cfg_attr(target_os = "netbsd", link_name = "__sigsuspend14")]
827+
pub fn sigsuspend(mask: *const sigset_t) -> ::c_int;
820828

821829
#[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
822830
pub fn timegm(tm: *mut ::tm) -> time_t;

src/unix/notbsd/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,9 @@ extern {
853853
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
854854
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
855855
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
856+
pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
857+
pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
858+
pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
856859
pub fn epoll_create(size: ::c_int) -> ::c_int;
857860
pub fn epoll_create1(flags: ::c_int) -> ::c_int;
858861
pub fn epoll_ctl(epfd: ::c_int,

0 commit comments

Comments
 (0)