|
| 1 | +pub type fsblkcnt_t = ::c_ulong; |
| 2 | +pub type fsfilcnt_t = ::c_ulong; |
| 3 | +pub type rlim_t = c_ulong; |
| 4 | +pub type __priority_which_t = ::c_uint; |
| 5 | + |
| 6 | +s! { |
| 7 | + pub struct glob64_t { |
| 8 | + pub gl_pathc: ::size_t, |
| 9 | + pub gl_pathv: *mut *mut ::c_char, |
| 10 | + pub gl_offs: ::size_t, |
| 11 | + pub gl_flags: ::c_int, |
| 12 | + |
| 13 | + __unused1: *mut ::c_void, |
| 14 | + __unused2: *mut ::c_void, |
| 15 | + __unused3: *mut ::c_void, |
| 16 | + __unused4: *mut ::c_void, |
| 17 | + __unused5: *mut ::c_void, |
| 18 | + } |
| 19 | + |
| 20 | + // FIXME this is actually a union |
| 21 | + pub struct sem_t { |
| 22 | + #[cfg(target_pointer_width = "32")] |
| 23 | + __size: [::c_char; 16], |
| 24 | + #[cfg(target_pointer_width = "64")] |
| 25 | + __size: [::c_char; 32], |
| 26 | + __align: [::c_long; 0], |
| 27 | + } |
| 28 | +} |
| 29 | + |
1 | 30 | pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
|
2 | 31 |
|
3 | 32 | pub const SFD_CLOEXEC: ::c_int = 0x080000;
|
@@ -496,6 +525,44 @@ pub const B3000000: ::speed_t = 0o010015;
|
496 | 525 | pub const B3500000: ::speed_t = 0o010016;
|
497 | 526 | pub const B4000000: ::speed_t = 0o010017;
|
498 | 527 |
|
| 528 | +#[link(name = "util")] |
| 529 | +extern { |
| 530 | + pub fn sysctl(name: *mut ::c_int, |
| 531 | + namelen: ::c_int, |
| 532 | + oldp: *mut ::c_void, |
| 533 | + oldlenp: *mut ::size_t, |
| 534 | + newp: *mut ::c_void, |
| 535 | + newlen: ::size_t) |
| 536 | + -> ::c_int; |
| 537 | + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; |
| 538 | + pub fn backtrace(buf: *mut *mut ::c_void, |
| 539 | + sz: ::c_int) -> ::c_int; |
| 540 | + pub fn glob64(pattern: *const ::c_char, |
| 541 | + flags: ::c_int, |
| 542 | + errfunc: ::dox::Option<extern fn(epath: *const ::c_char, |
| 543 | + errno: ::c_int) |
| 544 | + -> ::c_int>, |
| 545 | + pglob: *mut glob64_t) -> ::c_int; |
| 546 | + pub fn globfree64(pglob: *mut glob64_t); |
| 547 | + pub fn ptrace(request: ::c_uint, ...) -> ::c_long; |
| 548 | + pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t, |
| 549 | + cpusetsize: ::size_t, |
| 550 | + cpuset: *mut ::cpu_set_t) -> ::c_int; |
| 551 | + pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t, |
| 552 | + cpusetsize: ::size_t, |
| 553 | + cpuset: *const ::cpu_set_t) -> ::c_int; |
| 554 | + pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; |
| 555 | + pub fn setpriority(which: ::__priority_which_t, who: ::id_t, |
| 556 | + prio: ::c_int) -> ::c_int; |
| 557 | + pub fn pthread_getaffinity_np(thread: ::pthread_t, |
| 558 | + cpusetsize: ::size_t, |
| 559 | + cpuset: *mut ::cpu_set_t) -> ::c_int; |
| 560 | + pub fn pthread_setaffinity_np(thread: ::pthread_t, |
| 561 | + cpusetsize: ::size_t, |
| 562 | + cpuset: *const ::cpu_set_t) -> ::c_int; |
| 563 | + pub fn sched_getcpu() -> ::c_int; |
| 564 | +} |
| 565 | + |
499 | 566 | cfg_if! {
|
500 | 567 | if #[cfg(target_arch = "mips")] {
|
501 | 568 | mod mips32;
|
|
0 commit comments