summaryrefslogtreecommitdiffstats
path: root/vendor/libc/src/unix/bsd
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libc/src/unix/bsd')
-rw-r--r--vendor/libc/src/unix/bsd/apple/mod.rs105
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs14
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs10
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs10
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs10
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs10
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs7
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs52
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs155
-rw-r--r--vendor/libc/src/unix/bsd/freebsdlike/mod.rs33
-rw-r--r--vendor/libc/src/unix/bsd/mod.rs1
-rw-r--r--vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs94
-rw-r--r--vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs44
13 files changed, 509 insertions, 36 deletions
diff --git a/vendor/libc/src/unix/bsd/apple/mod.rs b/vendor/libc/src/unix/bsd/apple/mod.rs
index 519a99346..4b6ce9b4c 100644
--- a/vendor/libc/src/unix/bsd/apple/mod.rs
+++ b/vendor/libc/src/unix/bsd/apple/mod.rs
@@ -435,6 +435,80 @@ s! {
pub ifm_data: if_data,
}
+ pub struct ifa_msghdr {
+ pub ifam_msglen: ::c_ushort,
+ pub ifam_version: ::c_uchar,
+ pub ifam_type: ::c_uchar,
+ pub ifam_addrs: ::c_int,
+ pub ifam_flags: ::c_int,
+ pub ifam_index: ::c_ushort,
+ pub ifam_metric: ::c_int,
+ }
+
+ pub struct ifma_msghdr {
+ pub ifmam_msglen: ::c_ushort,
+ pub ifmam_version: ::c_uchar,
+ pub ifmam_type: ::c_uchar,
+ pub ifmam_addrs: ::c_int,
+ pub ifmam_flags: ::c_int,
+ pub ifmam_index: ::c_ushort,
+ }
+
+ pub struct ifma_msghdr2 {
+ pub ifmam_msglen: ::c_ushort,
+ pub ifmam_version: ::c_uchar,
+ pub ifmam_type: ::c_uchar,
+ pub ifmam_addrs: ::c_int,
+ pub ifmam_flags: ::c_int,
+ pub ifmam_index: ::c_ushort,
+ pub ifmam_refcount: i32,
+ }
+
+ pub struct rt_metrics {
+ pub rmx_locks: u32,
+ pub rmx_mtu: u32,
+ pub rmx_hopcount: u32,
+ pub rmx_expire: i32,
+ pub rmx_recvpipe: u32,
+ pub rmx_sendpipe: u32,
+ pub rmx_ssthresh: u32,
+ pub rmx_rtt: u32,
+ pub rmx_rttvar: u32,
+ pub rmx_pksent: u32,
+ pub rmx_state: u32,
+ pub rmx_filler: [u32; 3],
+ }
+
+ pub struct rt_msghdr {
+ pub rtm_msglen: ::c_ushort,
+ pub rtm_version: ::c_uchar,
+ pub rtm_type: ::c_uchar,
+ pub rtm_index: ::c_ushort,
+ pub rtm_flags: ::c_int,
+ pub rtm_addrs: ::c_int,
+ pub rtm_pid: ::pid_t,
+ pub rtm_seq: ::c_int,
+ pub rtm_errno: ::c_int,
+ pub rtm_use: ::c_int,
+ pub rtm_inits: u32,
+ pub rtm_rmx: rt_metrics,
+ }
+
+ pub struct rt_msghdr2 {
+ pub rtm_msglen: ::c_ushort,
+ pub rtm_version: ::c_uchar,
+ pub rtm_type: ::c_uchar,
+ pub rtm_index: ::c_ushort,
+ pub rtm_flags: ::c_int,
+ pub rtm_addrs: ::c_int,
+ pub rtm_refcnt: i32,
+ pub rtm_parentflags: ::c_int,
+ pub rtm_reserved: ::c_int,
+ pub rtm_use: ::c_int,
+ pub rtm_inits: u32,
+ pub rtm_rmx: rt_metrics,
+ }
+
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
@@ -4916,6 +4990,18 @@ pub const VOL_CAP_INT_RENAME_SWAP: attrgroup_t = 0x00040000;
pub const VOL_CAP_INT_RENAME_EXCL: attrgroup_t = 0x00080000;
pub const VOL_CAP_INT_RENAME_OPENFAIL: attrgroup_t = 0x00100000;
+// <proc.h>
+/// Process being created by fork.
+pub const SIDL: u32 = 1;
+/// Currently runnable.
+pub const SRUN: u32 = 2;
+/// Sleeping on an address.
+pub const SSLEEP: u32 = 3;
+/// Process debugging or suspension.
+pub const SSTOP: u32 = 4;
+/// Awaiting collection by parent.
+pub const SZOMB: u32 = 5;
+
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
const fn __DARWIN_ALIGN32(p: usize) -> usize {
@@ -5021,7 +5107,7 @@ f! {
as ::c_uint
}
- pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+ pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
as ::c_uint
}
@@ -5121,6 +5207,23 @@ extern "C" {
pub fn endutxent();
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+ pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
+ pub fn ctime(clock: *const time_t) -> *mut ::c_char;
+ pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
+ pub fn strftime(
+ buf: *mut ::c_char,
+ maxsize: ::size_t,
+ format: *const ::c_char,
+ timeptr: *const ::tm,
+ ) -> ::size_t;
+ pub fn strptime(
+ buf: *const ::c_char,
+ format: *const ::c_char,
+ timeptr: *mut ::tm,
+ ) -> *mut ::c_char;
+ pub fn asctime_r(tm: *const ::tm, result: *mut ::c_char) -> *mut ::c_char;
+ pub fn ctime_r(clock: *const time_t, result: *mut ::c_char) -> *mut ::c_char;
+
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 70fe6e2ed..7d01e3e0d 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1091,6 +1091,7 @@ pub const EV_NODATA: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_ERROR: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
+pub const EV_HUP: u16 = 0x8000;
pub const EV_SYSFLAGS: u16 = 0xf000;
pub const FIODNAME: ::c_ulong = 0x80106678;
@@ -1518,6 +1519,9 @@ pub const MAXCOMLEN: usize = 16;
pub const MAXLOGNAME: usize = 33;
pub const NGROUPS: usize = 16;
+pub const RB_PAUSE: ::c_int = 0x40000;
+pub const RB_VIDEO: ::c_int = 0x20000000;
+
const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
(n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
@@ -1530,7 +1534,7 @@ f! {
.offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
- pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+ pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize)
as ::c_uint
}
@@ -1577,6 +1581,14 @@ f! {
let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
0 != cpuset.ary[idx] & (1 << offset)
}
+
+ pub fn major(dev: ::dev_t) -> ::c_int {
+ ((dev >> 8) & 0xff) as ::c_int
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_int {
+ (dev & 0xffff00ff) as ::c_int
+ }
}
safe_f! {
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
index f2d170fb2..de34069ea 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
@@ -442,6 +442,16 @@ safe_f! {
}
}
+f! {
+ pub fn major(dev: ::dev_t) -> ::c_int {
+ ((dev >> 8) & 0xff) as ::c_int
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_int {
+ (dev & 0xffff00ff) as ::c_int
+ }
+}
+
extern "C" {
// Return type ::c_int was removed in FreeBSD 12
pub fn setgrent() -> ::c_int;
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
index 5cd4eff26..10fcaa03a 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
@@ -462,6 +462,16 @@ safe_f! {
}
}
+f! {
+ pub fn major(dev: ::dev_t) -> ::c_int {
+ (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_int {
+ (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
+ }
+}
+
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
index 56564eeb4..0e04a12e7 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
@@ -481,6 +481,16 @@ safe_f! {
}
}
+f! {
+ pub fn major(dev: ::dev_t) -> ::c_int {
+ (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_int {
+ (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
+ }
+}
+
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
index d60f1a174..a86ca6e7c 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
@@ -481,6 +481,16 @@ safe_f! {
}
}
+f! {
+ pub fn major(dev: ::dev_t) -> ::c_int {
+ (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_int {
+ (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
+ }
+}
+
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
index 7bf253445..01d0b4328 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
@@ -3,3 +3,10 @@ pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
+pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
+pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3;
+pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1;
+pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2;
+pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3;
+pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000;
+pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000;
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
index b70a40f15..633d1dac3 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -2693,15 +2693,20 @@ pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
pub const EV_ENABLE: u16 = 0x4;
pub const EV_DISABLE: u16 = 0x8;
+pub const EV_FORCEONESHOT: u16 = 0x100;
+pub const EV_KEEPUDATA: u16 = 0x200;
+
pub const EV_ONESHOT: u16 = 0x10;
pub const EV_CLEAR: u16 = 0x20;
pub const EV_RECEIPT: u16 = 0x40;
pub const EV_DISPATCH: u16 = 0x80;
+pub const EV_SYSFLAGS: u16 = 0xf000;
pub const EV_DROP: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
-pub const EV_ERROR: u16 = 0x4000;
+pub const EV_FLAG2: u16 = 0x4000;
+
pub const EV_EOF: u16 = 0x8000;
-pub const EV_SYSFLAGS: u16 = 0xf000;
+pub const EV_ERROR: u16 = 0x4000;
pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
@@ -2711,6 +2716,7 @@ pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
+pub const NOTE_FILE_POLL: u32 = 0x00000002;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
@@ -2718,6 +2724,10 @@ pub const NOTE_ATTRIB: u32 = 0x00000008;
pub const NOTE_LINK: u32 = 0x00000010;
pub const NOTE_RENAME: u32 = 0x00000020;
pub const NOTE_REVOKE: u32 = 0x00000040;
+pub const NOTE_OPEN: u32 = 0x00000080;
+pub const NOTE_CLOSE: u32 = 0x00000100;
+pub const NOTE_CLOSE_WRITE: u32 = 0x00000200;
+pub const NOTE_READ: u32 = 0x00000400;
pub const NOTE_EXIT: u32 = 0x80000000;
pub const NOTE_FORK: u32 = 0x40000000;
pub const NOTE_EXEC: u32 = 0x20000000;
@@ -2730,6 +2740,7 @@ pub const NOTE_SECONDS: u32 = 0x00000001;
pub const NOTE_MSECONDS: u32 = 0x00000002;
pub const NOTE_USECONDS: u32 = 0x00000004;
pub const NOTE_NSECONDS: u32 = 0x00000008;
+pub const NOTE_ABSTIME: u32 = 0x00000010;
pub const MADV_PROTECT: ::c_int = 10;
@@ -2986,6 +2997,10 @@ pub const MNT_SNAPSHOT: ::c_int = 0x01000000;
pub const MNT_UNION: ::c_int = 0x00000020;
pub const MNT_NONBUSY: ::c_int = 0x04000000;
+pub const SCM_BINTIME: ::c_int = 0x04;
+pub const SCM_REALTIME: ::c_int = 0x05;
+pub const SCM_MONOTONIC: ::c_int = 0x06;
+pub const SCM_TIME_INFO: ::c_int = 0x07;
pub const SCM_CREDS2: ::c_int = 0x08;
pub const SO_BINTIME: ::c_int = 0x2000;
@@ -3685,6 +3700,7 @@ pub const MSG_NBIO: ::c_int = 0x00004000;
pub const MSG_COMPAT: ::c_int = 0x00008000;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
pub const MSG_NOSIGNAL: ::c_int = 0x20000;
+pub const MSG_WAITFORONE: ::c_int = 0x00080000;
// utmpx entry types
pub const EMPTY: ::c_short = 0;
@@ -3756,6 +3772,15 @@ pub const AT_EUID: ::c_int = 12;
pub const AT_GID: ::c_int = 13;
pub const AT_EGID: ::c_int = 14;
pub const AT_EXECPATH: ::c_int = 15;
+pub const AT_CANARY: ::c_int = 16;
+pub const AT_OSRELDATE: ::c_int = 18;
+pub const AT_NCPUS: ::c_int = 19;
+pub const AT_PAGESIZES: ::c_int = 20;
+pub const AT_TIMEKEEP: ::c_int = 22;
+pub const AT_HWCAP: ::c_int = 25;
+pub const AT_HWCAP2: ::c_int = 26;
+pub const AT_USRSTACKBASE: ::c_int = 35;
+pub const AT_USRSTACKLIM: ::c_int = 36;
pub const TABDLY: ::tcflag_t = 0x00000004;
pub const TAB0: ::tcflag_t = 0x00000000;
@@ -4659,6 +4684,27 @@ 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;
+pub const KENV_DUMP_LOADER: ::c_int = 4;
+pub const KENV_DUMP_STATIC: ::c_int = 5;
+
+pub const RB_PAUSE: ::c_int = 0x100000;
+pub const RB_REROOT: ::c_int = 0x200000;
+pub const RB_POWERCYCLE: ::c_int = 0x400000;
+pub const RB_PROBE: ::c_int = 0x10000000;
+pub const RB_MULTIPLE: ::c_int = 0x20000000;
+
+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
@@ -4671,7 +4717,7 @@ f! {
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
- pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+ pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs
index d3a3f34b0..4046ec310 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs
+++ b/vendor/libc/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/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs
index 6a0f383bc..f328f0dd7 100644
--- a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs
+++ b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs
@@ -1434,6 +1434,31 @@ pub const SHM_RND: ::c_int = 0o20000;
pub const SHM_R: ::c_int = 0o400;
pub const SHM_W: ::c_int = 0o200;
+pub const KENV_GET: ::c_int = 0;
+pub const KENV_SET: ::c_int = 1;
+pub const KENV_UNSET: ::c_int = 2;
+pub const KENV_DUMP: ::c_int = 3;
+pub const KENV_MNAMELEN: ::c_int = 128;
+pub const KENV_MVALLEN: ::c_int = 128;
+
+pub const RB_ASKNAME: ::c_int = 0x001;
+pub const RB_SINGLE: ::c_int = 0x002;
+pub const RB_NOSYNC: ::c_int = 0x004;
+pub const RB_HALT: ::c_int = 0x008;
+pub const RB_INITNAME: ::c_int = 0x010;
+pub const RB_DFLTROOT: ::c_int = 0x020;
+pub const RB_KDB: ::c_int = 0x040;
+pub const RB_RDONLY: ::c_int = 0x080;
+pub const RB_DUMP: ::c_int = 0x100;
+pub const RB_MINIROOT: ::c_int = 0x200;
+pub const RB_VERBOSE: ::c_int = 0x800;
+pub const RB_SERIAL: ::c_int = 0x1000;
+pub const RB_CDROM: ::c_int = 0x2000;
+pub const RB_POWEROFF: ::c_int = 0x4000;
+pub const RB_GDB: ::c_int = 0x8000;
+pub const RB_MUTE: ::c_int = 0x10000;
+pub const RB_SELFTEST: ::c_int = 0x20000;
+
safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
@@ -1737,6 +1762,14 @@ extern "C" {
pub fn eui64_hostton(hostname: *const ::c_char, id: *mut eui64) -> ::c_int;
pub fn eaccess(path: *const ::c_char, mode: ::c_int) -> ::c_int;
+
+ pub fn kenv(
+ action: ::c_int,
+ name: *const ::c_char,
+ value: *mut ::c_char,
+ len: ::c_int,
+ ) -> ::c_int;
+ pub fn reboot(howto: ::c_int) -> ::c_int;
}
#[link(name = "rt")]
diff --git a/vendor/libc/src/unix/bsd/mod.rs b/vendor/libc/src/unix/bsd/mod.rs
index 84e572eda..6ce041357 100644
--- a/vendor/libc/src/unix/bsd/mod.rs
+++ b/vendor/libc/src/unix/bsd/mod.rs
@@ -628,6 +628,7 @@ extern "C" {
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
+ pub fn setlogin(name: *const ::c_char) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn kqueue() -> ::c_int;
pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
diff --git a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 87132e258..de5ec3863 100644
--- a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/vendor/libc/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;
@@ -1986,6 +1994,13 @@ pub const EV_ERROR: u32 = 0x4000;
pub const EV_EOF: u32 = 0x8000;
pub const EV_SYSFLAGS: u32 = 0xf000;
+pub const NOTE_TRIGGER: u32 = 0x01000000;
+pub const NOTE_FFNOP: u32 = 0x00000000;
+pub const NOTE_FFAND: u32 = 0x40000000;
+pub const NOTE_FFOR: u32 = 0x80000000;
+pub const NOTE_FFCOPY: u32 = 0xc0000000;
+pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
+pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
@@ -2213,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;
@@ -2377,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
@@ -2389,7 +2422,7 @@ f! {
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
- pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+ pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}
@@ -2439,6 +2472,17 @@ f! {
pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int {
(x >> 3) & 0x7
}
+
+ pub fn major(dev: ::dev_t) -> ::c_int {
+ (((dev as u32) & 0x000fff00) >> 8) as ::c_int
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_int {
+ let mut res = 0;
+ res |= ((dev as u32) & 0xfff00000) >> 12;
+ res |= (dev as u32) & 0x000000ff;
+ res as ::c_int
+ }
}
safe_f! {
@@ -2480,31 +2524,7 @@ extern "C" {
) -> ::c_int;
pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
-}
-#[link(name = "rt")]
-extern "C" {
- pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
- pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
- pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
- pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
- pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
- #[link_name = "__aio_suspend50"]
- pub fn aio_suspend(
- aiocb_list: *const *const aiocb,
- nitems: ::c_int,
- timeout: *const ::timespec,
- ) -> ::c_int;
- pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
- pub fn lio_listio(
- mode: ::c_int,
- aiocb_list: *const *mut aiocb,
- nitems: ::c_int,
- sevp: *mut sigevent,
- ) -> ::c_int;
-}
-
-extern "C" {
pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
@@ -2934,6 +2954,28 @@ extern "C" {
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
}
+#[link(name = "rt")]
+extern "C" {
+ pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+ pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
+ pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
+ #[link_name = "__aio_suspend50"]
+ pub fn aio_suspend(
+ aiocb_list: *const *const aiocb,
+ nitems: ::c_int,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
+ pub fn lio_listio(
+ mode: ::c_int,
+ aiocb_list: *const *mut aiocb,
+ nitems: ::c_int,
+ sevp: *mut sigevent,
+ ) -> ::c_int;
+}
+
#[link(name = "util")]
extern "C" {
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
diff --git a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 87acecb6a..3b87dc211 100644
--- a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/vendor/libc/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;
@@ -1072,6 +1073,8 @@ pub const IP_RECVIF: ::c_int = 30;
pub const TCP_MD5SIG: ::c_int = 0x04;
pub const TCP_NOPUSH: ::c_int = 0x10;
+pub const MSG_WAITFORONE: ::c_int = 0x1000;
+
pub const AF_ECMA: ::c_int = 8;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_ENCAP: ::c_int = 28;
@@ -1279,13 +1282,15 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;
+pub const EVFILT_READ: i16 = -1;
+pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
+pub const EVFILT_VNODE: i16 = -4;
pub const EVFILT_PROC: i16 = -5;
-pub const EVFILT_READ: i16 = -1;
pub const EVFILT_SIGNAL: i16 = -6;
pub const EVFILT_TIMER: i16 = -7;
-pub const EVFILT_VNODE: i16 = -4;
-pub const EVFILT_WRITE: i16 = -2;
+pub const EVFILT_DEVICE: i16 = -8;
+pub const EVFILT_EXCEPT: i16 = -9;
pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
@@ -1304,6 +1309,7 @@ pub const EV_SYSFLAGS: u16 = 0xf800;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_EOF: u32 = 0x00000002;
+pub const NOTE_OOB: u32 = 0x00000004;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
@@ -1320,6 +1326,7 @@ pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
+pub const NOTE_CHANGE: u32 = 0x00000001;
pub const TMP_MAX: ::c_uint = 0x7fffffff;
@@ -1611,7 +1618,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;
@@ -1660,6 +1675,12 @@ pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;
pub const MNT_LAZY: ::c_int = 3;
+// sys/_time.h
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
+pub const CLOCK_UPTIME: ::clockid_t = 5;
+pub const CLOCK_BOOTTIME: ::clockid_t = 6;
+
pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
@@ -1684,7 +1705,7 @@ f! {
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
- pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
+ pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}
@@ -1710,6 +1731,19 @@ f! {
(_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
as ::c_uint
}
+
+ pub fn major(dev: ::dev_t) -> ::c_uint{
+ ((dev as ::c_uint) >> 8) & 0xff
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_uint {
+ let dev = dev as ::c_uint;
+ let mut res = 0;
+ res |= (dev) & 0xff;
+ res |= ((dev) & 0xffff0000) >> 8;
+
+ res
+ }
}
safe_f! {