summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml6
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md6
-rw-r--r--Cargo.toml2
-rw-r--r--libc-test/Cargo.toml4
-rw-r--r--libc-test/semver/freebsd.txt2
-rw-r--r--libc-test/semver/linux.txt1
-rw-r--r--libc-test/semver/netbsd.txt7
-rw-r--r--libc-test/semver/openbsd.txt7
-rw-r--r--libc-test/semver/redox.txt1
-rw-r--r--src/fuchsia/aarch64.rs1
-rw-r--r--src/fuchsia/mod.rs3
-rw-r--r--src/fuchsia/riscv64.rs44
-rw-r--r--src/unix/aix/mod.rs1075
-rw-r--r--src/unix/aix/powerpc64.rs131
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs12
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/x86.rs155
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs28
-rw-r--r--src/unix/bsd/netbsdlike/openbsd/mod.rs11
-rw-r--r--src/unix/haiku/mod.rs3
-rw-r--r--src/unix/linux_like/android/mod.rs18
-rw-r--r--src/unix/linux_like/linux/arch/generic/mod.rs11
-rw-r--r--src/unix/linux_like/linux/gnu/b32/arm/mod.rs1
-rw-r--r--src/unix/linux_like/mod.rs8
-rw-r--r--src/unix/redox/mod.rs1
-rw-r--r--src/unix/solarish/mod.rs4
25 files changed, 1473 insertions, 69 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index fb152bab0f..d9fc3c90a8 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -3,7 +3,7 @@ task:
freebsd_instance:
image_family: freebsd-12-4
setup_script:
- - pkg install -y curl
+ - pkg install -y libnghttp2 curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh --default-toolchain nightly -y --profile=minimal
- . $HOME/.cargo/env
@@ -17,7 +17,7 @@ task:
freebsd_instance:
image_family: freebsd-13-1
setup_script:
- - pkg install -y curl
+ - pkg install -y libnghttp2 curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
- . $HOME/.cargo/env
@@ -29,7 +29,7 @@ task:
task:
name: nightly x86_64-unknown-freebsd-14
freebsd_instance:
- image_family: freebsd-14-0-snap
+ image: freebsd-14-0-current-amd64-v20230330
setup_script:
- pkg install -y libnghttp2 curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index a4958ba8c5..3e49d7473f 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -3,8 +3,10 @@ Thanks for considering submitting a PR!
Here's a checklist for things that will be checked during review or continuous integration.
- \[ ] Edit corresponding file(s) under `libc-test/semver` when you add/remove item(s)
+- \[ ] Your PR doesn't contain any *unstable* values like `*LAST` or `*MAX` (see [#3131](https://github.com/rust-lang/libc/issues/3131))
+- \[ ] If your PR increments version number, it must not contain any other changes
- \[ ] `rustc ci/style.rs && ./style src`
-- \[ ] `cd libc-test && cargo test` (This might fail on your env due to environment difference between your env and CI. Ignore failures if you are not sure.)
-- \[ ] Your PR that bumps up the crate version doesn't contain any other changes
+- \[ ] `cd libc-test && cargo test`
+ - (this might fail on your env due to environment difference between your env and CI. Ignore failures if you are not sure)
Delete this line and everything above before opening your PR.
diff --git a/Cargo.toml b/Cargo.toml
index 21b4e312bf..dd7c11a110 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc"
-version = "0.2.141"
+version = "0.2.142"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index d72311c4e2..83bfcba9c6 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libc-test"
-version = "0.2.141"
+version = "0.2.142"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
@@ -12,7 +12,7 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.141"
+version = "0.2.142"
default-features = false
[build-dependencies]
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index eadb4e9c73..5776e8a421 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -705,6 +705,8 @@ MALLOCX_ARENA
MALLOCX_ALIGN
MALLOCX_TCACHE
MALLOCX_ZERO
+MAP_ALIGNED
+MAP_ALIGNED_SUPER
MAP_COPY
MAP_EXCL
MAP_FILE
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index c360a7da86..4e9ff8d420 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -2032,6 +2032,7 @@ RESOLVE_IN_ROOT
RESOLVE_NO_MAGICLINKS
RESOLVE_NO_SYMLINKS
RESOLVE_NO_XDEV
+RLIM64_INFINITY
RLIMIT_AS
RLIMIT_CORE
RLIMIT_CPU
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 3dc84da635..6dd75bde86 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -628,6 +628,7 @@ MADV_NORMAL
MADV_RANDOM
MADV_SEQUENTIAL
MADV_WILLNEED
+MAP_ALIGNED
MAP_ALIGNMENT_16MB
MAP_ALIGNMENT_1TB
MAP_ALIGNMENT_256TB
@@ -1054,9 +1055,13 @@ VM_PROC_MAP
VREPRINT
VSTATUS
VWERASE
+WALLSIG
+WALTSIG
WEXITED
WNOWAIT
+WNOZOMBIE
WSTOPPED
+WTRAPPED
YESEXPR
YESSTR
_IOFBF
@@ -1562,3 +1567,5 @@ EXTATTR_NAMESPACE_EMPTY
extattr_list_fd
extattr_list_file
extattr_list_link
+EOWNERDEAD
+ENOTRECOVERABLE
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index d95190ee8c..090311982c 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -618,6 +618,9 @@ O_RSYNC
O_SHLOCK
O_SYNC
PENDIN
+P_ALL
+P_PGID
+P_PID
PF_APPLETALK
PF_BLUETOOTH
PF_BPF
@@ -835,6 +838,10 @@ UTIME_OMIT
UT_HOSTSIZE
UT_LINESIZE
UT_NAMESIZE
+WEXITED
+WNOWAIT
+WSTOPPED
+WTRAPPED
VDISCARD
VDSUSP
VLNEXT
diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt
index c8f5d400c5..4b6e126ea6 100644
--- a/libc-test/semver/redox.txt
+++ b/libc-test/semver/redox.txt
@@ -194,6 +194,7 @@ getrlimit
getrusage
getservbyport
getservent
+getdtablesize
killpg
lockf
madvise
diff --git a/src/fuchsia/aarch64.rs b/src/fuchsia/aarch64.rs
index 259893c0fa..33e3934d66 100644
--- a/src/fuchsia/aarch64.rs
+++ b/src/fuchsia/aarch64.rs
@@ -62,5 +62,6 @@ s! {
}
}
+// From https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/third_party/ulib/musl/include/bits/signal.h;l=20-21;drc=0827b18ab9540c46f8037f407d17ea15a79e9ba7
pub const MINSIGSTKSZ: ::size_t = 6144;
pub const SIGSTKSZ: ::size_t = 12288;
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index ea1ae466b2..6b12185413 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -4260,6 +4260,9 @@ cfg_if! {
} else if #[cfg(any(target_arch = "x86_64"))] {
mod x86_64;
pub use self::x86_64::*;
+ } else if #[cfg(any(target_arch = "riscv64"))] {
+ mod riscv64;
+ pub use self::riscv64::*;
} else {
// Unknown target_arch
}
diff --git a/src/fuchsia/riscv64.rs b/src/fuchsia/riscv64.rs
new file mode 100644
index 0000000000..de2b7197d7
--- /dev/null
+++ b/src/fuchsia/riscv64.rs
@@ -0,0 +1,44 @@
+// From psABI Calling Convention for RV64
+pub type c_char = u8;
+pub type __u64 = ::c_ulonglong;
+pub type wchar_t = i32;
+
+pub type nlink_t = ::c_ulong;
+pub type blksize_t = ::c_long;
+
+pub type stat64 = stat;
+s! {
+ pub struct stat {
+ pub st_dev: ::dev_t,
+ pub st_ino: ::ino_t,
+ pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ __pad0: ::c_int,
+ pub st_rdev: ::dev_t,
+ pub st_size: ::off_t,
+ pub st_blksize: ::blksize_t,
+ pub st_blocks: ::blkcnt_t,
+ pub st_atime: ::time_t,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::time_t,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::time_t,
+ pub st_ctime_nsec: ::c_long,
+ __unused: [::c_long; 3],
+ }
+
+ // Not actually used, IPC calls just return ENOSYS
+ pub struct ipc_perm {
+ pub __ipc_perm_key: ::key_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: ::mode_t,
+ pub __seq: ::c_ushort,
+ __unused1: ::c_ulong,
+ __unused2: ::c_ulong,
+ }
+}
diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs
index 98a09b5abc..ffe3f18284 100644
--- a/src/unix/aix/mod.rs
+++ b/src/unix/aix/mod.rs
@@ -6,16 +6,19 @@ pub type blkcnt_t = ::c_long;
pub type clock_t = ::c_int;
pub type daddr_t = ::c_long;
pub type dev_t = ::c_ulong;
+pub type fpos64_t = ::c_longlong;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
+pub type idtype_t = ::c_int;
pub type ino_t = ::c_ulong;
-pub type key_t = ::c_long;
+pub type key_t = ::c_int;
pub type mode_t = ::c_uint;
pub type nlink_t = ::c_short;
pub type rlim_t = ::c_ulong;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type time_t = ::c_long;
+pub type time64_t = ::int64_t;
pub type timer_t = ::c_long;
pub type wchar_t = ::c_uint;
pub type nfds_t = ::c_int;
@@ -23,6 +26,7 @@ pub type projid_t = ::c_int;
pub type id_t = ::c_uint;
pub type blksize64_t = ::c_ulonglong;
pub type blkcnt64_t = ::c_ulonglong;
+pub type sctp_assoc_t = ::uint32_t;
pub type suseconds_t = ::c_int;
pub type useconds_t = ::c_uint;
@@ -37,10 +41,13 @@ pub type in_addr_t = ::c_uint;
pub type signal_t = ::c_int;
pub type pthread_t = ::c_uint;
pub type pthread_key_t = ::c_uint;
+pub type thread_t = pthread_t;
pub type blksize_t = ::c_long;
pub type nl_item = ::c_int;
pub type mqd_t = ::c_int;
pub type shmatt_t = ::c_ulong;
+pub type regoff_t = ::c_long;
+pub type rlim64_t = ::c_ulonglong;
pub type sem_t = ::c_int;
pub type pollset_t = ::c_int;
@@ -49,6 +56,9 @@ pub type pthread_rwlockattr_t = *mut ::c_void;
pub type pthread_condattr_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
pub type pthread_attr_t = *mut ::c_void;
+pub type pthread_barrierattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_char;
+pub type iconv_t = *mut ::c_void;
e! {
pub enum uio_rw {
@@ -303,7 +313,7 @@ s! {
pub sigev_value: ::sigval,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
- pub sigev_notify_function: extern fn(val: sigval),
+ pub sigev_notify_function: extern fn(val: ::sigval),
pub sigev_notify_attributes: *mut pthread_attr_t,
}
@@ -342,6 +352,186 @@ s! {
pub trailer_length: ::c_uint,
pub bytes_sent: ::uint64_t,
}
+
+ pub struct mmsghdr {
+ pub msg_hdr: ::msghdr,
+ pub msg_len: ::c_uint,
+ }
+
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ pub sched_policy: ::c_int,
+ pub sched_reserved: [::c_int; 6],
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_size: ::size_t,
+ pub ss_flags: ::c_int,
+ pub __pad: [::c_int; 4],
+ }
+
+ pub struct posix_spawnattr_t {
+ pub posix_attr_flags: ::c_short,
+ pub posix_attr_pgroup: ::pid_t,
+ pub posix_attr_sigmask: ::sigset_t,
+ pub posix_attr_sigdefault: ::sigset_t,
+ pub posix_attr_schedpolicy: ::c_int,
+ pub posix_attr_schedparam: sched_param,
+ }
+
+ pub struct glob_t {
+ pub gl_pathc: ::size_t,
+ pub gl_pathv: *mut *mut c_char,
+ pub gl_offs: ::size_t,
+ pub gl_padr: *mut ::c_void,
+ pub gl_ptx: *mut ::c_void,
+ }
+
+ pub struct mallinfo {
+ pub arena: ::c_ulong,
+ pub ordblks: ::c_int,
+ pub smblks: ::c_int,
+ pub hblks: ::c_int,
+ pub hblkhd: ::c_int,
+ pub usmblks: ::c_ulong,
+ pub fsmblks: ::c_ulong,
+ pub uordblks: ::c_ulong,
+ pub fordblks: ::c_ulong,
+ pub keepcost: ::c_int,
+ }
+
+ pub struct utmp_exit_status {
+ pub e_termination: ::c_short,
+ pub e_exit: ::c_short,
+ }
+
+ pub struct utmp {
+ pub ut_user: [::c_char; 256],
+ pub ut_id: [::c_char; 14],
+ pub ut_line: [::c_char; 64],
+ pub ut_pid: ::pid_t,
+ pub ut_type: ::c_short,
+ pub ut_time: time64_t,
+ pub ut_exit: utmp_exit_status,
+ pub ut_host: [::c_char; 256],
+ pub __dbl_word_pad: ::c_int,
+ pub __reservedA: [::c_int; 2],
+ pub __reservedV: [::c_int; 6],
+ }
+
+ pub struct regmatch_t {
+ pub rm_so: regoff_t,
+ pub rm_eo: regoff_t,
+ }
+
+ pub struct regex_t {
+ pub re_nsub: ::size_t,
+ pub re_comp: *mut ::c_void,
+ pub re_cflags: ::c_int,
+ pub re_erroff: ::size_t,
+ pub re_len: ::size_t,
+ pub re_ucoll: [::wchar_t; 2],
+ pub re_lsub: [*mut ::c_void; 24],
+ pub re_esub: [*mut ::c_void; 24],
+ pub re_map: *mut ::c_uchar,
+ pub __maxsub: ::c_int,
+ pub __unused: [*mut ::c_void; 34],
+ }
+
+ pub struct rlimit64 {
+ pub rlim_cur: rlim64_t,
+ pub rlim_max: rlim64_t,
+ }
+
+ pub struct shmid_ds {
+ pub shm_perm: ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_nattch: shmatt_t,
+ pub shm_cnattch: shmatt_t,
+ pub shm_atime: time_t,
+ pub shm_dtime: time_t,
+ pub shm_ctime: time_t,
+ pub shm_handle: ::uint32_t,
+ pub shm_extshm: ::c_int,
+ pub shm_pagesize: ::int64_t,
+ pub shm_lba: ::uint64_t,
+ pub shm_reserved: ::int64_t,
+ pub shm_reserved1: ::int64_t,
+ }
+
+ pub struct stat64 {
+ pub st_dev: dev_t,
+ pub st_ino: ino_t,
+ pub st_mode: mode_t,
+ pub st_nlink: nlink_t,
+ pub st_flag: ::c_ushort,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ pub st_rdev: dev_t,
+ pub st_ssize: ::c_int,
+ pub st_atim: st_timespec,
+ pub st_mtim: st_timespec,
+ pub st_ctim: st_timespec,
+ pub st_blksize: blksize_t,
+ pub st_blocks: blkcnt_t,
+ pub st_vfstype: ::c_int,
+ pub st_vfs: ::c_uint,
+ pub st_type: ::c_uint,
+ pub st_gen: ::c_uint,
+ pub st_reserved: [::c_uint; 10],
+ pub st_size: off64_t,
+ }
+
+ pub struct mntent {
+ pub mnt_fsname: *mut ::c_char,
+ pub mnt_dir: *mut ::c_char,
+ pub mnt_type: *mut ::c_char,
+ pub mnt_opts: *mut ::c_char,
+ pub mnt_freq: ::c_int,
+ pub mnt_passno: ::c_int,
+ }
+
+ pub struct ipc_perm {
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: mode_t,
+ pub seq: ::c_ushort,
+ pub __reserved: ::c_ushort,
+ pub key: key_t,
+ }
+
+ pub struct entry {
+ pub key: *mut ::c_char,
+ pub data: *mut ::c_void,
+ }
+
+ pub struct mq_attr {
+ pub mq_flags: ::c_long,
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ }
+
+ pub struct sembuf {
+ pub sem_num: ::c_ushort,
+ pub sem_op: ::c_short,
+ pub sem_flg: ::c_short,
+ }
+
+ pub struct if_nameindex {
+ pub if_index: ::c_uint,
+ pub if_name: *mut ::c_char,
+ }
+
+ pub struct itimerspec {
+ pub it_interval: ::timespec,
+ pub it_value: ::timespec,
+ }
}
s_no_extra_traits! {
@@ -520,6 +710,8 @@ pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_GLOBAL: ::c_int = 0x10000;
pub const RTLD_LOCAL: ::c_int = 0x80000;
pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
+pub const RTLD_MYSELF: *mut ::c_void = -2isize as *mut ::c_void;
+pub const RTLD_NEXT: *mut ::c_void = -3isize as *mut ::c_void;
// fcntl.h
pub const O_RDONLY: ::c_int = 0x0;
@@ -539,6 +731,10 @@ pub const O_EXEC: ::c_int = 0x20;
pub const O_CLOEXEC: ::c_int = 0x800000;
pub const O_ACCMODE: ::c_int = O_RDONLY | O_WRONLY | O_RDWR;
pub const O_DIRECT: ::c_int = 0x8000000;
+pub const O_TTY_INIT: ::c_int = 0;
+pub const O_RSYNC: ::c_int = 0x200000;
+pub const O_LARGEFILE: ::c_int = 0x4000000;
+pub const F_CLOSEM: ::c_int = 10;
pub const F_DUPFD_CLOEXEC: ::c_int = 16;
pub const F_GETLK64: ::c_int = 11;
pub const F_SETLK64: ::c_int = 12;
@@ -562,6 +758,7 @@ pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const O_SYNC: ::c_int = 16;
pub const O_NONBLOCK: ::c_int = 4;
+pub const FASYNC: ::c_int = 0x20000;
pub const POSIX_FADV_NORMAL: ::c_int = 1;
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_FADV_RANDOM: ::c_int = 3;
@@ -580,6 +777,7 @@ pub const GLOB_NOESCAPE: ::c_int = 0x80;
pub const GLOB_NOSPACE: ::c_int = 0x2000;
pub const GLOB_ABORTED: ::c_int = 0x1000;
pub const GLOB_NOMATCH: ::c_int = 0x4000;
+pub const GLOB_NOSYS: ::c_int = 0x8000;
// langinfo.h
pub const DAY_1: ::nl_item = 13;
@@ -641,6 +839,7 @@ pub const YESEXPR: ::nl_item = 61;
pub const NOEXPR: ::nl_item = 62;
// locale.h
+pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;
pub const LC_CTYPE: ::c_int = 1;
pub const LC_NUMERIC: ::c_int = 3;
pub const LC_TIME: ::c_int = 4;
@@ -690,6 +889,33 @@ pub const AI_ALL: ::c_int = 0x20;
pub const AI_NUMERICSERV: ::c_int = 0x40;
pub const AI_EXTFLAGS: ::c_int = 0x80;
pub const AI_DEFAULT: ::c_int = AI_V4MAPPED | AI_ADDRCONFIG;
+pub const IPV6_ADDRFORM: ::c_int = 22;
+pub const IPV6_ADDR_PREFERENCES: ::c_int = 74;
+pub const IPV6_CHECKSUM: ::c_int = 39;
+pub const IPV6_DONTFRAG: ::c_int = 45;
+pub const IPV6_DSTOPTS: ::c_int = 54;
+pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 16777215;
+pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 251658240;
+pub const IPV6_HOPLIMIT: ::c_int = 40;
+pub const IPV6_HOPOPTS: ::c_int = 52;
+pub const IPV6_NEXTHOP: ::c_int = 48;
+pub const IPV6_PATHMTU: ::c_int = 46;
+pub const IPV6_PKTINFO: ::c_int = 33;
+pub const IPV6_PREFER_SRC_CGA: ::c_int = 16;
+pub const IPV6_PREFER_SRC_COA: ::c_int = 2;
+pub const IPV6_PREFER_SRC_HOME: ::c_int = 1;
+pub const IPV6_PREFER_SRC_NONCGA: ::c_int = 32;
+pub const IPV6_PREFER_SRC_PUBLIC: ::c_int = 4;
+pub const IPV6_PREFER_SRC_TMP: ::c_int = 8;
+pub const IPV6_RECVDSTOPTS: ::c_int = 56;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 41;
+pub const IPV6_RECVHOPOPTS: ::c_int = 53;
+pub const IPV6_RECVPATHMTU: ::c_int = 47;
+pub const IPV6_RECVRTHDR: ::c_int = 51;
+pub const IPV6_RECVTCLASS: ::c_int = 42;
+pub const IPV6_RTHDR: ::c_int = 50;
+pub const IPV6_RTHDRDSTOPTS: ::c_int = 55;
+pub const IPV6_TCLASS: ::c_int = 43;
// net/bpf.h
pub const DLT_NULL: ::c_int = 0x18;
@@ -716,8 +942,50 @@ pub const BIOCGSTATS: ::c_int = 0x4008426f;
pub const BIOCIMMEDIATE: ::c_int = 0x80044270;
pub const BIOCVERSION: ::c_int = 0x40044271;
pub const BIOCSDEVNO: ::c_int = 0x20004272;
+pub const BIOCGETIF: ::c_ulong = 0x4020426b;
+pub const BIOCSETIF: ::c_ulong = 0xffffffff8020426c;
+pub const BPF_ABS: ::c_int = 32;
+pub const BPF_ADD: ::c_int = 0;
+pub const BPF_ALIGNMENT: ::c_ulong = 4;
+pub const BPF_ALU: ::c_int = 4;
+pub const BPF_AND: ::c_int = 80;
+pub const BPF_B: ::c_int = 16;
+pub const BPF_DIV: ::c_int = 48;
+pub const BPF_H: ::c_int = 8;
+pub const BPF_IMM: ::c_int = 0;
+pub const BPF_IND: ::c_int = 64;
+pub const BPF_JA: ::c_int = 0;
+pub const BPF_JEQ: ::c_int = 16;
+pub const BPF_JGE: ::c_int = 48;
+pub const BPF_JGT: ::c_int = 32;
+pub const BPF_JMP: ::c_int = 5;
+pub const BPF_JSET: ::c_int = 64;
+pub const BPF_K: ::c_int = 0;
+pub const BPF_LD: ::c_int = 0;
+pub const BPF_LDX: ::c_int = 1;
+pub const BPF_LEN: ::c_int = 128;
+pub const BPF_LSH: ::c_int = 96;
+pub const BPF_MAXINSNS: ::c_int = 512;
+pub const BPF_MEM: ::c_int = 96;
+pub const BPF_MEMWORDS: ::c_int = 16;
+pub const BPF_MISC: ::c_int = 7;
+pub const BPF_MSH: ::c_int = 160;
+pub const BPF_MUL: ::c_int = 32;
+pub const BPF_NEG: ::c_int = 128;
+pub const BPF_OR: ::c_int = 64;
+pub const BPF_RET: ::c_int = 6;
+pub const BPF_RSH: ::c_int = 112;
+pub const BPF_ST: ::c_int = 2;
+pub const BPF_STX: ::c_int = 3;
+pub const BPF_SUB: ::c_int = 16;
+pub const BPF_W: ::c_int = 0;
+pub const BPF_X: ::c_int = 8;
// net/if.h
+pub const IFNET_SLOWHZ: ::c_int = 1;
+pub const IFQ_MAXLEN: ::c_int = 50;
+pub const IF_NAMESIZE: ::c_int = 16;
+pub const IFNAMSIZ: ::c_int = 16;
pub const IFF_UP: ::c_int = 0x1;
pub const IFF_BROADCAST: ::c_int = 0x2;
pub const IFF_DEBUG: ::c_int = 0x4;
@@ -729,6 +997,19 @@ pub const IFF_NOARP: ::c_int = 0x80;
pub const IFF_PROMISC: ::c_int = 0x100;
pub const IFF_ALLMULTI: ::c_int = 0x200;
pub const IFF_MULTICAST: ::c_int = 0x80000;
+pub const IFF_LINK0: ::c_int = 0x100000;
+pub const IFF_LINK1: ::c_int = 0x200000;
+pub const IFF_LINK2: ::c_int = 0x400000;
+pub const IFF_OACTIVE: ::c_int = 0x400;
+pub const IFF_SIMPLEX: ::c_int = 0x800;
+
+// net/if_arp.h
+pub const ARPHRD_ETHER: ::c_int = 1;
+pub const ARPHRD_802_5: ::c_int = 6;
+pub const ARPHRD_802_3: ::c_int = 6;
+pub const ARPHRD_FDDI: ::c_int = 1;
+pub const ARPOP_REQUEST: ::c_int = 1;
+pub const ARPOP_REPLY: ::c_int = 2;
// net/route.h
pub const RTM_ADD: ::c_int = 0x1;
@@ -878,6 +1159,46 @@ pub const IPV6_ADD_MEMBERSHIP: ::c_int = IP_ADD_MEMBERSHIP;
pub const IPV6_DROP_MEMBERSHIP: ::c_int = IP_DROP_MEMBERSHIP;
pub const IPV6_JOIN_GROUP: ::c_int = IP_ADD_MEMBERSHIP;
pub const IPV6_LEAVE_GROUP: ::c_int = IP_DROP_MEMBERSHIP;
+pub const MCAST_BLOCK_SOURCE: ::c_int = 64;
+pub const MCAST_EXCLUDE: ::c_int = 2;
+pub const MCAST_INCLUDE: ::c_int = 1;
+pub const MCAST_JOIN_GROUP: ::c_int = 62;
+pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 66;
+pub const MCAST_LEAVE_GROUP: ::c_int = 63;
+pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 67;
+pub const MCAST_UNBLOCK_SOURCE: ::c_int = 65;
+
+// netinet/ip.h
+pub const MAXTTL: ::c_int = 255;
+pub const IPDEFTTL: ::c_int = 64;
+pub const IPOPT_CONTROL: ::c_int = 0;
+pub const IPOPT_EOL: ::c_int = 0;
+pub const IPOPT_LSRR: ::c_int = 131;
+pub const IPOPT_MINOFF: ::c_int = 4;
+pub const IPOPT_NOP: ::c_int = 1;
+pub const IPOPT_OFFSET: ::c_int = 2;
+pub const IPOPT_OLEN: ::c_int = 1;
+pub const IPOPT_OPTVAL: ::c_int = 0;
+pub const IPOPT_RESERVED1: ::c_int = 0x20;
+pub const IPOPT_RESERVED2: ::c_int = 0x60;
+pub const IPOPT_RR: ::c_int = 7;
+pub const IPOPT_SSRR: ::c_int = 137;
+pub const IPOPT_TS: ::c_int = 68;
+pub const IPOPT_TS_PRESPEC: ::c_int = 3;
+pub const IPOPT_TS_TSANDADDR: ::c_int = 1;
+pub const IPOPT_TS_TSONLY: ::c_int = 0;
+pub const IPTOS_LOWDELAY: ::c_int = 16;
+pub const IPTOS_PREC_CRITIC_ECP: ::c_int = 160;
+pub const IPTOS_PREC_FLASH: ::c_int = 96;
+pub const IPTOS_PREC_FLASHOVERRIDE: ::c_int = 128;
+pub const IPTOS_PREC_IMMEDIATE: ::c_int = 64;
+pub const IPTOS_PREC_INTERNETCONTROL: ::c_int = 192;
+pub const IPTOS_PREC_NETCONTROL: ::c_int = 224;
+pub const IPTOS_PREC_PRIORITY: ::c_int = 32;
+pub const IPTOS_PREC_ROUTINE: ::c_int = 16;
+pub const IPTOS_RELIABILITY: ::c_int = 4;
+pub const IPTOS_THROUGHPUT: ::c_int = 8;
+pub const IPVERSION: ::c_int = 4;
// netinet/tcp.h
pub const TCP_NODELAY: ::c_int = 0x1;
@@ -899,6 +1220,59 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 5;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 3;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 4;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
+pub const PTHREAD_PRIO_INHERIT: ::c_int = 3;
+pub const PTHREAD_PRIO_NONE: ::c_int = 1;
+pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
+
+// regex.h
+pub const REG_EXTENDED: ::c_int = 1;
+pub const REG_ICASE: ::c_int = 2;
+pub const REG_NEWLINE: ::c_int = 4;
+pub const REG_NOSUB: ::c_int = 8;
+pub const REG_NOTBOL: ::c_int = 0x100;
+pub const REG_NOTEOL: ::c_int = 0x200;
+pub const REG_NOMATCH: ::c_int = 1;
+pub const REG_BADPAT: ::c_int = 2;
+pub const REG_ECOLLATE: ::c_int = 3;
+pub const REG_ECTYPE: ::c_int = 4;
+pub const REG_EESCAPE: ::c_int = 5;
+pub const REG_ESUBREG: ::c_int = 6;
+pub const REG_EBRACK: ::c_int = 7;
+pub const REG_EPAREN: ::c_int = 8;
+pub const REG_EBRACE: ::c_int = 9;
+pub const REG_BADBR: ::c_int = 10;
+pub const REG_ERANGE: ::c_int = 11;
+pub const REG_ESPACE: ::c_int = 12;
+pub const REG_BADRPT: ::c_int = 13;
+pub const REG_ECHAR: ::c_int = 14;
+pub const REG_EBOL: ::c_int = 15;
+pub const REG_EEOL: ::c_int = 16;
+pub const REG_ENOSYS: ::c_int = 17;
+
+// rpcsvc/mount.h
+pub const NFSMNT_ACDIRMAX: ::c_int = 2048;
+pub const NFSMNT_ACDIRMIN: ::c_int = 1024;
+pub const NFSMNT_ACREGMAX: ::c_int = 512;
+pub const NFSMNT_ACREGMIN: ::c_int = 256;
+pub const NFSMNT_INT: ::c_int = 64;
+pub const NFSMNT_NOAC: ::c_int = 128;
+pub const NFSMNT_RETRANS: ::c_int = 16;
+pub const NFSMNT_RSIZE: ::c_int = 4;
+pub const NFSMNT_SOFT: ::c_int = 1;
+pub const NFSMNT_TIMEO: ::c_int = 8;
+pub const NFSMNT_WSIZE: ::c_int = 2;
+
+// rpcsvc/rstat.h
+pub const CPUSTATES: ::c_int = 4;
+
+// search.h
+pub const FIND: ::c_int = 0;
+pub const ENTER: ::c_int = 1;
+
+// semaphore.h
+pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
// spawn.h
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x1;
@@ -938,6 +1312,11 @@ pub const X_OK: ::c_int = 1;
pub const LIO_NOP: ::c_int = 0;
pub const LIO_READ: ::c_int = 1;
pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_NOWAIT: ::c_int = 0;
+pub const LIO_WAIT: ::c_int = 1;
+pub const AIO_ALLDONE: ::c_int = 2;
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 1;
// sys/errno.h
pub const EPERM: ::c_int = 1;
@@ -997,6 +1376,9 @@ pub const ENODATA: ::c_int = 122;
pub const ETIME: ::c_int = 119;
pub const ENOSR: ::c_int = 118;
pub const EREMOTE: ::c_int = 93;
+pub const ENOATTR: ::c_int = 112;
+pub const ESAD: ::c_int = 113;
+pub const ENOTRUST: ::c_int = 114;
pub const ENOLINK: ::c_int = 126;
pub const EPROTO: ::c_int = 121;
pub const EMULTIHOP: ::c_int = 125;
@@ -1115,6 +1497,42 @@ pub const TIOCGETC: ::c_int = 0x40067412;
pub const TANDEM: ::c_int = 0x1;
pub const CBREAK: ::c_int = 0x2;
pub const LCASE: ::c_int = 0x4;
+pub const MDMBUF: ::c_int = 0x800000;
+pub const XTABS: ::c_int = 0xc00;
+pub const SIOCADDMULTI: ::c_int = -2145359567;
+pub const SIOCADDRT: ::c_int = -2143784438;
+pub const SIOCDARP: ::c_int = -2142476000;
+pub const SIOCDELMULTI: ::c_int = -2145359566;
+pub const SIOCDELRT: ::c_int = -2143784437;
+pub const SIOCDIFADDR: ::c_int = -2144835303;
+pub const SIOCGARP: ::c_int = -1068734170;
+pub const SIOCGIFADDR: ::c_int = -1071093471;
+pub const SIOCGIFBRDADDR: ::c_int = -1071093469;
+pub const SIOCGIFCONF: ::c_int = -1072666299;
+pub const SIOCGIFDSTADDR: ::c_int = -1071093470;
+pub const SIOCGIFFLAGS: ::c_int = -1071093487;
+pub const SIOCGIFHWADDR: ::c_int = -1068209771;
+pub const SIOCGIFMETRIC: ::c_int = -1071093481;
+pub const SIOCGIFMTU: ::c_int = -1071093418;
+pub const SIOCGIFNETMASK: ::c_int = -1071093467;
+pub const SIOCSARP: ::c_int = -2142476002;
+pub const SIOCSIFADDR: ::c_int = -2144835316;
+pub const SIOCSIFBRDADDR: ::c_int = -2144835309;
+pub const SIOCSIFDSTADDR: ::c_int = -2144835314;
+pub const SIOCSIFFLAGS: ::c_int = -2144835312;
+pub const SIOCSIFMETRIC: ::c_int = -2144835304;
+pub const SIOCSIFMTU: ::c_int = -2144835240;
+pub const SIOCSIFNETMASK: ::c_int = -2144835306;
+pub const TIOCUCNTL: ::c_int = -2147191706;
+pub const TIOCCONS: ::c_int = -2147191710;
+pub const TIOCPKT: ::c_int = -2147191696;
+pub const TIOCPKT_DATA: ::c_int = 0;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 1;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 2;
+pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
+pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
+pub const TIOCPKT_START: ::c_int = 8;
+pub const TIOCPKT_STOP: ::c_int = 4;
// sys/ipc.h
pub const IPC_ALLOC: ::c_int = 0o100000;
@@ -1127,6 +1545,10 @@ pub const IPC_R: ::c_int = 0o0400;
pub const IPC_W: ::c_int = 0o0200;
pub const IPC_O: ::c_int = 0o1000;
pub const IPC_NOERROR: ::c_int = 0o10000;
+pub const IPC_STAT: ::c_int = 102;
+pub const IPC_PRIVATE: ::key_t = -1;
+pub const SHM_LOCK: ::c_int = 201;
+pub const SHM_UNLOCK: ::c_int = 202;
// sys/ldr.h
pub const L_GETINFO: ::c_int = 2;
@@ -1140,6 +1562,19 @@ pub const PAGESIZE: ::c_int = 4096;
pub const IOV_MAX: ::c_int = 16;
pub const AIO_LISTIO_MAX: ::c_int = 4096;
pub const PIPE_BUF: usize = 32768;
+pub const OPEN_MAX: ::c_int = 65534;
+pub const MAX_INPUT: ::c_int = 512;
+pub const MAX_CANON: ::c_int = 256;
+pub const ARG_MAX: ::c_int = 1048576;
+pub const BC_BASE_MAX: ::c_int = 99;
+pub const BC_DIM_MAX: ::c_int = 0x800;
+pub const BC_SCALE_MAX: ::c_int = 99;
+pub const BC_STRING_MAX: ::c_int = 0x800;
+pub const CHARCLASS_NAME_MAX: ::c_int = 14;
+pub const CHILD_MAX: ::c_int = 128;
+pub const COLL_WEIGHTS_MAX: ::c_int = 4;
+pub const EXPR_NEST_MAX: ::c_int = 32;
+pub const NZERO: ::c_int = 20;
// sys/lockf.h
pub const F_LOCK: ::c_int = 1;
@@ -1147,6 +1582,11 @@ pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
+// sys/machine.h
+pub const BIG_ENDIAN: ::c_int = 4321;
+pub const LITTLE_ENDIAN: ::c_int = 1234;
+pub const PDP_ENDIAN: ::c_int = 3412;
+
// sys/mman.h
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
@@ -1159,6 +1599,7 @@ pub const MAP_FIXED: ::c_int = 0x100;
pub const MAP_ANON: ::c_int = 0x10;
pub const MAP_ANONYMOUS: ::c_int = 0x10;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+pub const MAP_TYPE: ::c_int = 0xf0;
pub const MCL_CURRENT: ::c_int = 0x100;
pub const MCL_FUTURE: ::c_int = 0x200;
pub const MS_SYNC: ::c_int = 0x20;
@@ -1196,6 +1637,12 @@ pub const S_IWOTH: mode_t = 2;
pub const S_IXOTH: mode_t = 1;
pub const S_IFLNK: mode_t = 0o120000;
pub const S_IFSOCK: mode_t = 0o140000;
+pub const S_IEXEC: mode_t = 0o100;
+pub const S_IWRITE: mode_t = 0o200;
+pub const S_IREAD: mode_t = 0o400;
+
+// sys/msg.h
+pub const MSG_NOERROR: ::c_int = 0o10000;
// sys/m_signal.h
pub const SIGSTKSZ: ::size_t = 4096;
@@ -1204,6 +1651,11 @@ pub const MINSIGSTKSZ: ::size_t = 1200;
// sys/params.h
pub const MAXPATHLEN: ::c_int = PATH_MAX + 1;
pub const MAXSYMLINKS: ::c_int = 20;
+pub const MAXHOSTNAMELEN: ::c_int = 256;
+pub const MAXUPRC: ::c_int = 128;
+pub const NGROUPS_MAX: ::c_ulong = 2048;
+pub const NGROUPS: ::c_ulong = NGROUPS_MAX;
+pub const NOFILE: ::c_int = OPEN_MAX;
// sys/poll.h
pub const POLLIN: ::c_short = 0x0001;
@@ -1273,6 +1725,23 @@ pub const PTT_WRITE_FPSCR_HI: ::c_int = 66;
pub const PTT_READ_VSX: ::c_int = 67;
pub const PTT_WRITE_VSX: ::c_int = 68;
pub const PTT_READ_TM: ::c_int = 69;
+pub const PTRACE_ATTACH: ::c_int = 14;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_DETACH: ::c_int = 15;
+pub const PTRACE_GETFPREGS: ::c_int = 12;
+pub const PTRACE_GETREGS: ::c_int = 10;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_SETFPREGS: ::c_int = 13;
+pub const PTRACE_SETREGS: ::c_int = 11;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_SYSCALL: ::c_int = 16;
+pub const PTRACE_TRACEME: ::c_int = 0;
// sys/resource.h
pub const RLIMIT_CPU: ::c_int = 0;
@@ -1290,6 +1759,10 @@ pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RLIM_SAVED_MAX: ::c_ulong = RLIM_INFINITY - 1;
+pub const RLIM_SAVED_CUR: ::c_ulong = RLIM_INFINITY - 2;
+pub const RLIM_NLIMITS: ::c_int = 10;
// sys/sched.h
pub const SCHED_OTHER: ::c_int = 0;
@@ -1376,6 +1849,9 @@ pub const SIGPROF: ::c_int = 32;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGTRAP: ::c_int = 5;
+pub const SIGCLD: ::c_int = 20;
+pub const SIGRTMAX: ::c_int = 57;
+pub const SIGRTMIN: ::c_int = 50;
pub const SI_USER: ::c_int = 0;
pub const SI_UNDEFINED: ::c_int = 8;
pub const SI_EMPTY: ::c_int = 9;
@@ -1437,6 +1913,11 @@ pub const AF_SNA: ::c_int = 11;
pub const AF_DECnet: ::c_int = 12;
pub const AF_DLI: ::c_int = 13;
pub const AF_LAT: ::c_int = 14;
+pub const SO_TIMESTAMPNS: ::c_int = 0x100a;
+pub const SOMAXCONN: ::c_int = 1024;
+pub const AF_LOCAL: ::c_int = AF_UNIX;
+pub const UIO_MAXIOV: ::c_int = 1024;
+pub const pseudo_AF_XTP: ::c_int = 19;
pub const AF_HYLINK: ::c_int = 15;
pub const AF_APPLETALK: ::c_int = 16;
pub const AF_ISO: ::c_int = 7;
@@ -1670,8 +2151,17 @@ pub const ITIMER_PROF: ::c_int = 2;
pub const ITIMER_VIRT: ::c_int = 3;
pub const ITIMER_REAL1: ::c_int = 20;
pub const ITIMER_REAL_TH: ::c_int = ITIMER_REAL1;
+pub const DST_AUST: ::c_int = 2;
+pub const DST_CAN: ::c_int = 6;
+pub const DST_EET: ::c_int = 5;
+pub const DST_MET: ::c_int = 4;
+pub const DST_NONE: ::c_int = 0;
+pub const DST_USA: ::c_int = 1;
+pub const DST_WET: ::c_int = 3;
// sys/termio.h
+pub const CSTART: ::tcflag_t = 0o21;
+pub const CSTOP: ::tcflag_t = 0o23;
pub const TCGETA: ::c_int = TIOC | 5;
pub const TCSETA: ::c_int = TIOC | 6;
pub const TCSETAW: ::c_int = TIOC | 7;
@@ -1720,6 +2210,15 @@ pub const TIOCMBIC: ::c_int = 0x8004746b;
pub const TIOCMGET: ::c_int = 0x4004746a;
pub const TIOCREMOTE: ::c_int = 0x80047469;
+// sys/user.h
+pub const MAXCOMLEN: ::c_int = 32;
+pub const UF_SYSTEM: ::c_int = 0x1000;
+
+// sys/vattr.h
+pub const AT_FLAGS: ::c_int = 0x80;
+pub const AT_GID: ::c_int = 8;
+pub const AT_UID: ::c_int = 4;
+
// sys/wait.h
pub const P_ALL: ::c_int = 0;
pub const P_PID: ::c_int = 1;
@@ -1729,6 +2228,7 @@ pub const WUNTRACED: ::c_int = 0x2;
pub const WEXITED: ::c_int = 0x04;
pub const WCONTINUED: ::c_int = 0x01000000;
pub const WNOWAIT: ::c_int = 0x10;
+pub const WSTOPPED: ::c_int = _W_STOPPED;
pub const _W_STOPPED: ::c_int = 0x00000040;
pub const _W_SLWTED: ::c_int = 0x0000007c;
pub const _W_SEWTED: ::c_int = 0x0000007d;
@@ -1737,6 +2237,7 @@ pub const _W_STRC: ::c_int = 0x0000007f;
// termios.h
pub const NCCS: usize = 16;
+pub const OLCUC: ::tcflag_t = 2;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS5: ::tcflag_t = 0x00000000;
pub const CS6: ::tcflag_t = 0x00000010;
@@ -2151,27 +2652,216 @@ safe_f! {
}
}
+#[link(name = "thread")]
+extern "C" {
+ pub fn thr_kill(id: thread_t, sig: ::c_int) -> ::c_int;
+ pub fn thr_self() -> thread_t;
+}
+
+#[link(name = "pthread")]
+extern "C" {
+ pub fn pthread_atfork(
+ prepare: ::Option<unsafe extern "C" fn()>,
+ parent: ::Option<unsafe extern "C" fn()>,
+ child: ::Option<unsafe extern "C" fn()>,
+ ) -> ::c_int;
+ pub fn pthread_attr_getguardsize(
+ attr: *const ::pthread_attr_t,
+ guardsize: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn pthread_attr_getschedparam(
+ attr: *const ::pthread_attr_t,
+ param: *mut sched_param,
+ ) -> ::c_int;
+ pub fn pthread_attr_getstack(
+ attr: *const ::pthread_attr_t,
+ stackaddr: *mut *mut ::c_void,
+ stacksize: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn pthread_attr_setschedparam(
+ attr: *mut ::pthread_attr_t,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrier_init(
+ barrier: *mut pthread_barrier_t,
+ attr: *const ::pthread_barrierattr_t,
+ count: ::c_uint,
+ ) -> ::c_int;
+ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_getpshared(
+ attr: *const ::pthread_barrierattr_t,
+ shared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_setpshared(
+ attr: *mut ::pthread_barrierattr_t,
+ shared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+ pub fn pthread_condattr_getclock(
+ attr: *const pthread_condattr_t,
+ clock_id: *mut clockid_t,
+ ) -> ::c_int;
+ pub fn pthread_condattr_getpshared(
+ attr: *const pthread_condattr_t,
+ pshared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_condattr_setclock(
+ attr: *mut pthread_condattr_t,
+ clock_id: ::clockid_t,
+ ) -> ::c_int;
+ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_create(
+ native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+ pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+ pub fn pthread_getschedparam(
+ thread: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut sched_param,
+ ) -> ::c_int;
+ pub fn pthread_kill(thread: ::pthread_t, signal: ::c_int) -> ::c_int;
+ pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
+ pub fn pthread_mutex_timedlock(
+ lock: *mut pthread_mutex_t,
+ abstime: *const ::timespec,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getprotocol(
+ attr: *const pthread_mutexattr_t,
+ protocol: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getpshared(
+ attr: *const pthread_mutexattr_t,
+ pshared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getrobust(
+ attr: *mut ::pthread_mutexattr_t,
+ robust: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setprotocol(
+ attr: *mut pthread_mutexattr_t,
+ protocol: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setpshared(
+ attr: *mut pthread_mutexattr_t,
+ pshared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setrobust(
+ attr: *mut ::pthread_mutexattr_t,
+ robust: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_rwlockattr_getpshared(
+ attr: *const pthread_rwlockattr_t,
+ val: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+ pub fn pthread_setschedparam(
+ thread: ::pthread_t,
+ policy: ::c_int,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
+}
+
+#[link(name = "iconv")]
+extern "C" {
+ pub fn iconv(
+ cd: iconv_t,
+ inbuf: *mut *mut ::c_char,
+ inbytesleft: *mut ::size_t,
+ outbuf: *mut *mut ::c_char,
+ outbytesleft: *mut ::size_t,
+ ) -> ::size_t;
+ pub fn iconv_close(cd: iconv_t) -> ::c_int;
+ pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+}
+
extern "C" {
pub fn acct(filename: *const ::c_char) -> ::c_int;
+ pub fn aio_cancel(fildes: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
+ pub fn aio_error(aiocbp: *mut ::aiocb) -> ::c_int;
+ #[link_name = "_posix_aio_fsync"]
+ pub fn aio_fsync(op: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
+ pub fn aio_read(aiocbp: *mut ::aiocb) -> ::c_int;
+ // pub fn aio_suspend
+ // pub fn aio_write
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+ pub fn brk(addr: *mut ::c_void) -> ::c_int;
+ pub fn clearenv() -> ::c_int;
+ pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_nanosleep(
+ clk_id: ::clockid_t,
+ flags: ::c_int,
+ rqtp: *const ::timespec,
+ rmtp: *mut ::timespec,
+ ) -> ::c_int;
pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn drand48() -> ::c_double;
+ pub fn duplocale(arg1: ::locale_t) -> ::locale_t;
pub fn endgrent();
+ pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
pub fn endpwent();
+ pub fn endutent();
+ pub fn endutxent();
+ pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
pub fn faccessat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::c_int,
flags: ::c_int,
) -> ::c_int;
+ pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
+ pub fn fexecve(
+ fd: ::c_int,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
+ pub fn ffs(value: ::c_int) -> ::c_int;
+ pub fn ffsl(value: ::c_long) -> ::c_int;
+ pub fn ffsll(value: ::c_longlong) -> ::c_int;
pub fn fgetgrent(file: *mut ::FILE) -> *mut ::group;
+ pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
pub fn fgetpwent(file: *mut ::FILE) -> *mut ::passwd;
+ pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
+ pub fn freelocale(loc: ::locale_t);
+ pub fn freopen64(
+ filename: *const c_char,
+ mode: *const c_char,
+ file: *mut ::FILE,
+ ) -> *mut ::FILE;
+ pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+ pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
+ pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
+ pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
+ pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
+ pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
+ pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+ pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
+ pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
+ pub fn getdtablesize() -> ::c_int;
pub fn getgrent() -> *mut ::group;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn getgrgid_r(
@@ -2190,6 +2880,18 @@ extern "C" {
result: *mut *mut ::group,
) -> ::c_int;
pub fn getgrset(user: *mut ::c_char) -> *mut ::c_char;
+ pub fn gethostid() -> ::c_long;
+ pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+ pub fn getnameinfo(
+ sa: *const ::sockaddr,
+ salen: ::size_t,
+ host: *mut ::c_char,
+ hostlen: ::size_t,
+ serv: *mut ::c_char,
+ sevlen: ::size_t,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn getpagesize() -> ::c_int;
pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn getpwent() -> *mut ::passwd;
@@ -2208,13 +2910,70 @@ extern "C" {
result: *mut *mut passwd,
) -> ::c_int;
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+ pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+ pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+ pub fn getutent() -> *mut utmp;
+ pub fn getutid(u: *const utmp) -> *mut utmp;
+ pub fn getutline(u: *const utmp) -> *mut utmp;
+ pub fn getutxent() -> *mut utmpx;
+ pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+ pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn glob(
+ pattern: *const ::c_char,
+ flags: ::c_int,
+ errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+ pglob: *mut ::glob_t,
+ ) -> ::c_int;
+ pub fn globfree(pglob: *mut ::glob_t);
+ pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
+ pub fn hcreate(nelt: ::size_t) -> ::c_int;
+ pub fn hdestroy();
+ pub fn hsearch(entry: entry, action: ::c_int) -> *mut entry;
+ pub fn if_freenameindex(ptr: *mut if_nameindex);
+ pub fn if_nameindex() -> *mut if_nameindex;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
+ pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn lcong48(p: *mut ::c_ushort);
+ pub fn lfind(
+ key: *const ::c_void,
+ base: *const ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn lio_listio(
+ mode: ::c_int,
+ aiocb_list: *const *mut aiocb,
+ nitems: ::c_int,
+ sevp: *mut sigevent,
+ ) -> ::c_int;
pub fn loadquery(flags: ::c_int, buf: *mut ::c_char, buflen: ::c_uint) -> ::c_int;
pub fn lpar_get_info(command: ::c_int, buf: *mut ::c_void, bufsize: ::size_t) -> ::c_int;
pub fn lpar_set_resources(id: ::c_int, resource: *mut ::c_void) -> ::c_int;
+ pub fn lrand48() -> c_long;
+ pub fn lsearch(
+ key: *const ::c_void,
+ base: *mut ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
+ pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+ pub fn makecontext(ucp: *mut ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+ pub fn mallinfo() -> ::mallinfo;
+ pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
+ pub fn memmem(
+ haystack: *const ::c_void,
+ haystacklen: ::size_t,
+ needle: *const ::c_void,
+ needlelen: ::size_t,
+ ) -> *mut ::c_void;
+ pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+ pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn mknodat(
dirfd: ::c_int,
@@ -2222,8 +2981,62 @@ extern "C" {
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
+ pub fn mount(device: *const ::c_char, path: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+ pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+ pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+ pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+ pub fn mq_receive(
+ mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msg_prio: *mut ::c_uint,
+ ) -> ::ssize_t;
+ pub fn mq_send(
+ mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msg_prio: ::c_uint,
+ ) -> ::c_int;
+ pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_timedreceive(
+ mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msg_prio: *mut ::c_uint,
+ abs_timeout: *const ::timespec,
+ ) -> ::ssize_t;
+ pub fn mq_timedsend(
+ mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msg_prio: ::c_uint,
+ abs_timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn mrand48() -> c_long;
+ pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
+ pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+ pub fn msgrcv(
+ msqid: ::c_int,
+ msgp: *mut ::c_void,
+ msgsz: ::size_t,
+ msgtyp: ::c_long,
+ msgflg: ::c_int,
+ ) -> ::ssize_t;
+ pub fn msgsnd(
+ msqid: ::c_int,
+ msgp: *const ::c_void,
+ msgsz: ::size_t,
+ msgflg: ::c_int,
+ ) -> ::c_int;
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+ pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
+ pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
pub fn pollset_create(maxfd: ::c_int) -> pollset_t;
pub fn pollset_ctl(
ps: pollset_t,
@@ -2238,26 +3051,109 @@ extern "C" {
timeout: ::c_int,
) -> ::c_int;
pub fn pollset_query(ps: pollset_t, pollfd_query: *mut ::pollfd) -> ::c_int;
+ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+ pub fn posix_fadvise64(
+ fd: ::c_int,
+ offset: ::off64_t,
+ len: ::off64_t,
+ advise: ::c_int,
+ ) -> ::c_int;
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
- pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
- pub fn pthread_atfork(
- prepare: ::Option<unsafe extern "C" fn()>,
- parent: ::Option<unsafe extern "C" fn()>,
- child: ::Option<unsafe extern "C" fn()>,
+ pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+ pub fn posix_spawn(
+ pid: *mut ::pid_t,
+ path: *const ::c_char,
+ file_actions: *const ::posix_spawn_file_actions_t,
+ attrp: *const ::posix_spawnattr_t,
+ argv: *const *mut ::c_char,
+ envp: *const *mut ::c_char,
) -> ::c_int;
- pub fn pthread_condattr_setclock(
- attr: *mut pthread_condattr_t,
- clock_id: ::clockid_t,
+ pub fn posix_spawn_file_actions_addclose(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
) -> ::c_int;
- pub fn pthread_create(
- native: *mut ::pthread_t,
- attr: *const ::pthread_attr_t,
- f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
- value: *mut ::c_void,
+ pub fn posix_spawn_file_actions_adddup2(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
+ newfd: ::c_int,
) -> ::c_int;
- pub fn pthread_kill(thread: ::pthread_t, signal: ::c_int) -> ::c_int;
- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+ pub fn posix_spawn_file_actions_addopen(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
+ path: *const ::c_char,
+ oflag: ::c_int,
+ mode: ::mode_t,
+ ) -> ::c_int;
+ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+ pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+ pub fn posix_spawnattr_getflags(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::c_short,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getpgroup(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::pid_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getschedparam(
+ attr: *const posix_spawnattr_t,
+ param: *mut ::sched_param,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getschedpolicy(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getsigdefault(
+ attr: *const posix_spawnattr_t,
+ default: *mut sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getsigmask(
+ attr: *const posix_spawnattr_t,
+ default: *mut sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+ pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+ pub fn posix_spawnattr_setschedparam(
+ attr: *mut posix_spawnattr_t,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+ pub fn posix_spawnattr_setsigdefault(
+ attr: *mut posix_spawnattr_t,
+ default: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setsigmask(
+ attr: *mut posix_spawnattr_t,
+ default: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnp(
+ pid: *mut ::pid_t,
+ file: *const ::c_char,
+ file_actions: *const ::posix_spawn_file_actions_t,
+ attrp: *const ::posix_spawnattr_t,
+ argv: *const *mut ::c_char,
+ envp: *const *mut ::c_char,
+ ) -> ::c_int;
+ pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+ pub fn ptrace64(
+ request: ::c_int,
+ id: ::c_longlong,
+ addr: ::c_longlong,
+ data: ::c_int,
+ buff: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pututline(u: *const utmp) -> *mut utmp;
+ pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn pwrite64(
+ fd: ::c_int,
+ buf: *const ::c_void,
+ count: ::size_t,
+ offset: off64_t,
+ ) -> ::ssize_t;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
#[link_name = "__linux_quotactl"]
@@ -2267,6 +3163,7 @@ extern "C" {
id: ::c_int,
data: *mut ::c_char,
) -> ::c_int;
+ pub fn rand() -> ::c_int;
pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
pub fn recvfrom(
socket: ::c_int,
@@ -2276,30 +3173,174 @@ extern "C" {
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
+ pub fn recvmmsg(
+ sockfd: ::c_int,
+ msgvec: *mut ::mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_int,
+ timeout: *mut ::timespec,
+ ) -> ::c_int;
pub fn recvmsg(sockfd: ::c_int, msg: *mut msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
+ pub fn regerror(
+ errcode: ::c_int,
+ preg: *const ::regex_t,
+ errbuf: *mut ::c_char,
+ errbuf_size: ::size_t,
+ ) -> ::size_t;
+ pub fn regexec(
+ preg: *const regex_t,
+ input: *const ::c_char,
+ nmatch: ::size_t,
+ pmatch: *mut regmatch_t,
+ eflags: ::c_int,
+ ) -> ::c_int;
+ pub fn regfree(preg: *mut regex_t);
+ pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+ pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+ pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+ pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+ pub fn sched_setscheduler(
+ pid: ::pid_t,
+ policy: ::c_int,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn sctp_opt_info(
+ sd: ::c_int,
+ id: ::sctp_assoc_t,
+ opt: ::c_int,
+ arg_size: *mut ::c_void,
+ size: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn sctp_peeloff(s: ::c_int, id: ::sctp_assoc_t) -> ::c_int;
+ pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+ pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+ pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+ pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+ pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+ pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+ pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
+ pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
pub fn send_file(socket: *mut ::c_int, iobuf: *mut sf_parms, flags: ::c_uint) -> ::ssize_t;
+ pub fn sendmmsg(
+ sockfd: ::c_int,
+ msgvec: *mut mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_int,
+ ) -> ::c_int;
pub fn sendmsg(sockfd: ::c_int, msg: *const msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
+ pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
pub fn setgrent();
+ pub fn sethostid(hostid: ::c_int) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+ pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE;
pub fn setpriority(which: ::c_int, who: id_t, priority: ::c_int) -> ::c_int;
pub fn setpwent();
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+ pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+ pub fn setitimer(
+ which: ::c_int,
+ new_value: *const ::itimerval,
+ old_value: *mut ::itimerval,
+ ) -> ::c_int;
+ pub fn setutent();
+ pub fn setutxent();
+ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+ pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+ pub fn sigtimedwait(
+ set: *const sigset_t,
+ info: *mut siginfo_t,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+ pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+ pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+ pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn splice(socket1: ::c_int, socket2: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn srand(seed: ::c_uint);
+ pub fn srand48(seed: ::c_long);
+ pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
+ pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
+ pub fn statx(
+ path: *const ::c_char,
+ buf: *mut stat,
+ length: ::c_int,
+ command: ::c_int,
+ ) -> ::c_int;
+ pub fn strcasecmp_l(
+ string1: *const ::c_char,
+ string2: *const ::c_char,
+ locale: ::locale_t,
+ ) -> ::c_int;
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+ pub fn strftime(
+ arg1: *mut c_char,
+ arg2: ::size_t,
+ arg3: *const c_char,
+ arg4: *const tm,
+ ) -> ::size_t;
+ pub fn strncasecmp_l(
+ string1: *const ::c_char,
+ string2: *const ::c_char,
+ length: ::size_t,
+ locale: ::locale_t,
+ ) -> ::c_int;
+ pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+ pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char;
+ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
+ pub fn swapoff(puath: *const ::c_char) -> ::c_int;
+ pub fn swapon(path: *const ::c_char) -> ::c_int;
pub fn sync();
+ pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+ pub fn timer_create(
+ clockid: ::clockid_t,
+ sevp: *mut ::sigevent,
+ timerid: *mut ::timer_t,
+ ) -> ::c_int;
+ pub fn timer_delete(timerid: timer_t) -> ::c_int;
+ pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
+ pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
+ pub fn timer_settime(
+ timerid: ::timer_t,
+ flags: ::c_int,
+ new_value: *const ::itimerspec,
+ old_value: *mut ::itimerspec,
+ ) -> ::c_int;
+ pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
+ pub fn updwtmp(file: *const ::c_char, u: *mut utmp);
+ pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+ pub fn utmpname(file: *const ::c_char) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
+ pub fn wait4(
+ pid: ::pid_t,
+ status: *mut ::c_int,
+ options: ::c_int,
+ rusage: *mut ::rusage,
+ ) -> ::pid_t;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
// Use AIX thread-safe version errno.
diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs
index 6c6b87db74..2cacf29f6b 100644
--- a/src/unix/aix/powerpc64.rs
+++ b/src/unix/aix/powerpc64.rs
@@ -93,15 +93,98 @@ s! {
pub f_fpack: [::c_char; 32],
pub f_name_max: ::c_int,
}
-}
-s_no_extra_traits! {
- #[cfg(libc_union)]
- pub union sigval {
- pub sival_ptr: *mut ::c_void,
- pub sival_int: ::c_int,
+ pub struct aiocb {
+ pub aio_lio_opcode: ::c_int,
+ pub aio_fildes: ::c_int,
+ pub aio_word1: ::c_int,
+ pub aio_offset: ::off_t,
+ pub aio_buf: *mut ::c_void,
+ pub aio_return: ::ssize_t,
+ pub aio_errno: ::c_int,
+ pub aio_nbytes: ::size_t,
+ pub aio_reqprio: ::c_int,
+ pub aio_sigevent: ::sigevent,
+ pub aio_word2: ::c_int,
+ pub aio_fp: ::c_int,
+ pub aio_handle: *mut aiocb,
+ pub aio_reserved: [::c_uint; 2],
+ pub aio_sigev_tid: c_long,
+ }
+
+ pub struct ucontext_t {
+ pub __sc_onstack: ::c_int,
+ pub uc_sigmask: ::sigset_t,
+ pub __sc_uerror: ::c_int,
+ pub uc_mcontext: ::mcontext_t,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: ::stack_t,
+ // Should be pointer to __extctx_t
+ pub __extctx: *mut ::c_void,
+ pub __extctx_magic: ::c_int,
+ pub __pad: [::c_int; 1],
}
+ pub struct mcontext_t {
+ pub gpr: [::c_ulonglong; 32],
+ pub msr: ::c_ulonglong,
+ pub iar: ::c_ulonglong,
+ pub lr: ::c_ulonglong,
+ pub ctr: ::c_ulonglong,
+ pub cr: ::c_uint,
+ pub xer: ::c_uint,
+ pub fpscr: ::c_uint,
+ pub fpscrx: ::c_uint,
+ pub except: [::c_ulonglong; 1],
+ // Should be array of double type
+ pub fpr: [::uint64_t; 32],
+ pub fpeu: ::c_char,
+ pub fpinfo: ::c_char,
+ pub fpscr24_31: ::c_char,
+ pub pad: [::c_char; 1],
+ pub excp_type: ::c_int,
+ }
+
+ pub struct utmpx {
+ pub ut_user: [::c_char; 256],
+ pub ut_id: [::c_char; 14],
+ pub ut_line: [::c_char; 64],
+ pub ut_pid: ::pid_t,
+ pub ut_type: ::c_short,
+ pub ut_tv: ::timeval,
+ pub ut_host: [::c_char; 256],
+ pub __dbl_word_pad: ::c_int,
+ pub __reservedA: [::c_int; 2],
+ pub __reservedV: [::c_int; 6],
+ }
+
+ pub struct pthread_spinlock_t {
+ pub __sp_word: [::c_long; 3],
+ }
+
+ pub struct pthread_barrier_t {
+ pub __br_word: [::c_long; 5],
+ }
+
+ pub struct msqid_ds {
+ pub msg_perm: ::ipc_perm,
+ pub msg_first: ::c_uint,
+ pub msg_last: ::c_uint,
+ pub msg_cbytes: ::c_uint,
+ pub msg_qnum: ::c_uint,
+ pub msg_qbytes: ::c_ulong,
+ pub msg_lspid: ::pid_t,
+ pub msg_lrpid: ::pid_t,
+ pub msg_stime: ::time_t,
+ pub msg_rtime: ::time_t,
+ pub msg_ctime: ::time_t,
+ pub msg_rwait: ::c_int,
+ pub msg_wwait: ::c_int,
+ pub msg_reqevents: ::c_ushort,
+ }
+}
+
+s_no_extra_traits! {
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
@@ -111,8 +194,7 @@ s_no_extra_traits! {
pub si_status: ::c_int,
pub si_addr: *mut ::c_void,
pub si_band: ::c_long,
- #[cfg(libc_union)]
- pub si_value: sigval,
+ pub si_value: ::sigval,
pub __si_flags: ::c_int,
pub __pad: [::c_int; 3],
}
@@ -197,7 +279,6 @@ impl siginfo_t {
self.si_addr
}
- #[cfg(libc_union)]
pub unsafe fn si_value(&self) -> ::sigval {
self.si_value
}
@@ -217,36 +298,6 @@ impl siginfo_t {
cfg_if! {
if #[cfg(feature = "extra_traits")] {
- #[cfg(libc_union)]
- impl PartialEq for sigval {
- fn eq(&self, other: &sigval) -> bool {
- unsafe {
- self.sival_ptr == other.sival_ptr
- && self.sival_int == other.sival_int
- }
- }
- }
- #[cfg(libc_union)]
- impl Eq for sigval {}
- #[cfg(libc_union)]
- impl ::fmt::Debug for sigval {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
- f.debug_struct("sigval")
- .field("sival_ptr", unsafe { &self.sival_ptr })
- .field("sival_int", unsafe { &self.sival_int })
- .finish()
- }
- }
- #[cfg(libc_union)]
- impl ::hash::Hash for sigval {
- fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
- unsafe {
- self.sival_ptr.hash(state);
- self.sival_int.hash(state);
- }
- }
- }
-
impl PartialEq for siginfo_t {
fn eq(&self, other: &siginfo_t) -> bool {
#[cfg(libc_union)]
@@ -313,7 +364,7 @@ cfg_if! {
#[cfg(libc_union)]
impl ::fmt::Debug for _kernel_simple_lock {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
- f.debug_struct("sigval")
+ f.debug_struct("_kernel_simple_lock")
.field("_slock", unsafe { &self._slock })
.field("_slockp", unsafe { &self._slockp })
.finish()
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 55b520faab..2ee676d973 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -4670,6 +4670,18 @@ pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008;
pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004;
pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
+cfg_if! {
+ if #[cfg(libc_const_extern_fn)] {
+ pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+ a << 24
+ }
+ } else {
+ pub fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+ a << 24
+ }
+ }
+}
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs
index d3a3f34b0f..4046ec3109 100644
--- a/src/unix/bsd/freebsdlike/freebsd/x86.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs
@@ -6,6 +6,41 @@ pub type time_t = i32;
pub type suseconds_t = i32;
pub type register_t = i32;
+s_no_extra_traits! {
+ pub struct mcontext_t {
+ pub mc_onstack: register_t,
+ pub mc_gs: register_t,
+ pub mc_fs: register_t,
+ pub mc_es: register_t,
+ pub mc_ds: register_t,
+ pub mc_edi: register_t,
+ pub mc_esi: register_t,
+ pub mc_ebp: register_t,
+ pub mc_isp: register_t,
+ pub mc_ebx: register_t,
+ pub mc_edx: register_t,
+ pub mc_ecx: register_t,
+ pub mc_eax: register_t,
+ pub mc_trapno: register_t,
+ pub mc_err: register_t,
+ pub mc_eip: register_t,
+ pub mc_cs: register_t,
+ pub mc_eflags: register_t,
+ pub mc_esp: register_t,
+ pub mc_ss: register_t,
+ pub mc_len: ::c_int,
+ pub mc_fpformat: ::c_int,
+ pub mc_ownedfp: ::c_int,
+ pub mc_flags: register_t,
+ pub mc_fpstate: [[::c_int; 32]; 4],
+ pub mc_fsbase: register_t,
+ pub mc_gsbase: register_t,
+ pub mc_xfpustate: register_t,
+ pub mc_xfpustate_len: register_t,
+ pub mc_spare2: [::c_int; 4],
+ }
+}
+
s! {
pub struct stat {
pub st_dev: ::dev_t,
@@ -31,6 +66,15 @@ s! {
pub st_birthtime_nsec: ::c_long,
__unused: [u8; 8],
}
+
+ pub struct ucontext_t {
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: ::mcontext_t,
+ pub uc_link: *mut ::ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_flags: ::c_int,
+ __spare__: [::c_int; 4],
+ }
}
// should be pub(crate), but that requires Rust 1.18.0
@@ -43,4 +87,115 @@ cfg_if! {
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.mc_onstack == other.mc_onstack &&
+ self.mc_gs == other.mc_gs &&
+ self.mc_fs == other.mc_fs &&
+ self.mc_es == other.mc_es &&
+ self.mc_ds == other.mc_ds &&
+ self.mc_edi == other.mc_edi &&
+ self.mc_esi == other.mc_esi &&
+ self.mc_ebp == other.mc_ebp &&
+ self.mc_isp == other.mc_isp &&
+ self.mc_ebx == other.mc_ebx &&
+ self.mc_edx == other.mc_edx &&
+ self.mc_ecx == other.mc_ecx &&
+ self.mc_eax == other.mc_eax &&
+ self.mc_trapno == other.mc_trapno &&
+ self.mc_err == other.mc_err &&
+ self.mc_eip == other.mc_eip &&
+ self.mc_cs == other.mc_cs &&
+ self.mc_eflags == other.mc_eflags &&
+ self.mc_esp == other.mc_esp &&
+ self.mc_ss == other.mc_ss &&
+ self.mc_len == other.mc_len &&
+ self.mc_fpformat == other.mc_fpformat &&
+ self.mc_ownedfp == other.mc_ownedfp &&
+ self.mc_flags == other.mc_flags &&
+ self.mc_fpstate.iter().zip(other.mc_fpstate.iter()).all(|(a, b)| a == b) &&
+ self.mc_fsbase == other.mc_fsbase &&
+ self.mc_gsbase == other.mc_gsbase &&
+ self.mc_xfpustate == other.mc_xfpustate &&
+ self.mc_xfpustate_len == other.mc_xfpustate_len &&
+ self.mc_spare2.iter().zip(other.mc_spare2.iter()).all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("mc_onstack", &self.mc_onstack)
+ .field("mc_gs", &self.mc_gs)
+ .field("mc_fs", &self.mc_fs)
+ .field("mc_es", &self.mc_es)
+ .field("mc_ds", &self.mc_ds)
+ .field("mc_edi", &self.mc_edi)
+ .field("mc_esi", &self.mc_esi)
+ .field("mc_ebp", &self.mc_ebp)
+ .field("mc_isp", &self.mc_isp)
+ .field("mc_ebx", &self.mc_ebx)
+ .field("mc_edx", &self.mc_edx)
+ .field("mc_ecx", &self.mc_ecx)
+ .field("mc_eax", &self.mc_eax)
+ .field("mc_trapno", &self.mc_trapno)
+ .field("mc_err", &self.mc_err)
+ .field("mc_eip", &self.mc_eip)
+ .field("mc_cs", &self.mc_cs)
+ .field("mc_eflags", &self.mc_eflags)
+ .field("mc_esp", &self.mc_esp)
+ .field("mc_ss", &self.mc_ss)
+ .field("mc_len", &self.mc_len)
+ .field("mc_fpformat", &self.mc_fpformat)
+ .field("mc_ownedfp", &self.mc_ownedfp)
+ .field("mc_flags", &self.mc_flags)
+ .field("mc_fpstate", &self.mc_fpstate)
+ .field("mc_fsbase", &self.mc_fsbase)
+ .field("mc_gsbase", &self.mc_gsbase)
+ .field("mc_xfpustate", &self.mc_xfpustate)
+ .field("mc_xfpustate_len", &self.mc_xfpustate_len)
+ .field("mc_spare2", &self.mc_spare2)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.mc_onstack.hash(state);
+ self.mc_gs.hash(state);
+ self.mc_fs.hash(state);
+ self.mc_es.hash(state);
+ self.mc_ds.hash(state);
+ self.mc_edi.hash(state);
+ self.mc_esi.hash(state);
+ self.mc_ebp.hash(state);
+ self.mc_isp.hash(state);
+ self.mc_ebx.hash(state);
+ self.mc_edx.hash(state);
+ self.mc_ecx.hash(state);
+ self.mc_eax.hash(state);
+ self.mc_trapno.hash(state);
+ self.mc_err.hash(state);
+ self.mc_eip.hash(state);
+ self.mc_cs.hash(state);
+ self.mc_eflags.hash(state);
+ self.mc_esp.hash(state);
+ self.mc_ss.hash(state);
+ self.mc_len.hash(state);
+ self.mc_fpformat.hash(state);
+ self.mc_ownedfp.hash(state);
+ self.mc_flags.hash(state);
+ self.mc_fpstate.hash(state);
+ self.mc_fsbase.hash(state);
+ self.mc_gsbase.hash(state);
+ self.mc_xfpustate.hash(state);
+ self.mc_xfpustate_len.hash(state);
+ self.mc_spare2.hash(state);
+ }
+ }
+ }
+}
+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index fd7175583e..c750cfb1d0 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1464,7 +1464,15 @@ pub const ENOATTR: ::c_int = 93;
pub const EMULTIHOP: ::c_int = 94;
pub const ENOLINK: ::c_int = 95;
pub const EPROTO: ::c_int = 96;
-pub const ELAST: ::c_int = 96;
+pub const EOWNERDEAD: ::c_int = 97;
+pub const ENOTRECOVERABLE: ::c_int = 98;
+#[deprecated(
+ since = "0.2.143",
+ note = "This value will always match the highest defined error number \
+ and thus is not stable. \
+ See #3040 for more info."
+)]
+pub const ELAST: ::c_int = 98;
pub const F_DUPFD_CLOEXEC: ::c_int = 12;
pub const F_CLOSEM: ::c_int = 10;
@@ -2220,6 +2228,11 @@ pub const WCONTINUED: ::c_int = 0x00000010;
pub const WEXITED: ::c_int = 0x000000020;
pub const WNOWAIT: ::c_int = 0x00010000;
+pub const WALTSIG: ::c_int = 0x00000004;
+pub const WALLSIG: ::c_int = 0x00000008;
+pub const WTRAPPED: ::c_int = 0x00000040;
+pub const WNOZOMBIE: ::c_int = 0x00020000;
+
pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 4;
@@ -2384,6 +2397,19 @@ pub const GRND_NONBLOCK: ::c_uint = 0x1;
pub const GRND_RANDOM: ::c_uint = 0x2;
pub const GRND_INSECURE: ::c_uint = 0x4;
+cfg_if! {
+
+ if #[cfg(libc_const_extern_fn)] {
+ pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+ alignment << MAP_ALIGNMENT_SHIFT
+ }
+ } else {
+ pub fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+ alignment << MAP_ALIGNMENT_SHIFT
+ }
+ }
+}
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 7f8f9400df..8099bad1d1 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -7,6 +7,7 @@ pub type sigset_t = ::c_uint;
pub type blksize_t = i32;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
+pub type idtype_t = ::c_uint;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_mutex_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
@@ -1615,7 +1616,15 @@ pub const BIOCSDLT: ::c_ulong = 0x8004427a;
pub const PTRACE_FORK: ::c_int = 0x0002;
-pub const WCONTINUED: ::c_int = 8;
+pub const WCONTINUED: ::c_int = 0x08;
+pub const WEXITED: ::c_int = 0x04;
+pub const WSTOPPED: ::c_int = 0x02; // same as WUNTRACED
+pub const WNOWAIT: ::c_int = 0x10;
+pub const WTRAPPED: ::c_int = 0x20;
+
+pub const P_ALL: ::idtype_t = 0;
+pub const P_PGID: ::idtype_t = 1;
+pub const P_PID: ::idtype_t = 2;
// search.h
pub const FIND: ::ACTION = 0;
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs
index 8af90b0de3..2fa3327834 100644
--- a/src/unix/haiku/mod.rs
+++ b/src/unix/haiku/mod.rs
@@ -685,6 +685,9 @@ pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
+pub const L_SET: ::c_int = SEEK_SET;
+pub const L_INCR: ::c_int = SEEK_CUR;
+pub const L_XTND: ::c_int = SEEK_END;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index e2fa0826f2..fd4b0593b4 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -1579,6 +1579,23 @@ pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
pub const TIOCSBRK: ::c_int = 0x5427;
pub const TIOCCBRK: ::c_int = 0x5428;
+cfg_if! {
+ if #[cfg(any(target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "arm",
+ target_arch = "aarch64",
+ target_arch = "riscv64",
+ target_arch = "s390x"))] {
+ pub const FICLONE: ::c_int = 0x40049409;
+ pub const FICLONERANGE: ::c_int = 0x4020940D;
+ } else if #[cfg(any(target_arch = "mips",
+ target_arch = "mips64",
+ target_arch = "powerpc",
+ target_arch = "powerpc64"))] {
+ pub const FICLONE: ::c_int = 0x80049409;
+ pub const FICLONERANGE: ::c_int = 0x8020940D;
+ }
+}
pub const ST_RDONLY: ::c_ulong = 1;
pub const ST_NOSUID: ::c_ulong = 2;
@@ -3531,6 +3548,7 @@ extern "C" {
longindex: *mut ::c_int,
) -> ::c_int;
+ pub fn sync();
pub fn syncfs(fd: ::c_int) -> ::c_int;
}
diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
index cffe748de9..4693978311 100644
--- a/src/unix/linux_like/linux/arch/generic/mod.rs
+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -108,9 +108,18 @@ cfg_if! {
cfg_if! {
if #[cfg(any(target_arch = "x86",
target_arch = "x86_64",
- target_arch = "aarch64"))] {
+ target_arch = "arm",
+ target_arch = "aarch64",
+ target_arch = "riscv64",
+ target_arch = "s390x"))] {
pub const FICLONE: ::c_ulong = 0x40049409;
pub const FICLONERANGE: ::c_ulong = 0x4020940D;
+ } else if #[cfg(any(target_arch = "mips",
+ target_arch = "mips64",
+ target_arch = "powerpc",
+ target_arch = "powerpc64"))] {
+ pub const FICLONE: ::c_ulong = 0x80049409;
+ pub const FICLONERANGE: ::c_ulong = 0x8020940D;
}
}
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
index ea905eb7ca..fd690a17e1 100644
--- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
@@ -837,6 +837,7 @@ pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
pub const SYS_statx: ::c_long = 397;
pub const SYS_rseq: ::c_long = 398;
+pub const SYS_kexec_file_load: ::c_long = 401;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index 61f03ad8c2..5142ac499f 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -557,6 +557,14 @@ pub const XATTR_CREATE: ::c_int = 0x1;
pub const XATTR_REPLACE: ::c_int = 0x2;
cfg_if! {
+ if #[cfg(target_os = "android")] {
+ pub const RLIM64_INFINITY: ::c_ulonglong = !0;
+ } else {
+ pub const RLIM64_INFINITY: ::rlim64_t = !0;
+ }
+}
+
+cfg_if! {
if #[cfg(target_env = "ohos")] {
pub const LC_CTYPE: ::c_int = 0;
pub const LC_NUMERIC: ::c_int = 1;
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index 6661ea7358..dec47c610b 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -993,6 +993,7 @@ extern "C" {
// unistd.h
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn getdtablesize() -> ::c_int;
// malloc.h
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index 88f9cab9d6..cc688331f4 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -2579,7 +2579,7 @@ pub const AT_SUN_FPTYPE: ::c_uint = 2027;
// and 4 bytes everywhere else:
#[cfg(target_arch = "sparc64")]
const _CMSG_HDR_ALIGNMENT: usize = 8;
-#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+#[cfg(not(target_arch = "sparc64"))]
const _CMSG_HDR_ALIGNMENT: usize = 4;
const _CMSG_DATA_ALIGNMENT: usize = ::mem::size_of::<::c_int>();
@@ -3196,6 +3196,8 @@ extern "C" {
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;
+
+ pub fn sync();
}
#[link(name = "sendfile")]