diff options
Diffstat (limited to 'vendor/libc/src/unix/bsd/freebsdlike/freebsd')
7 files changed, 251 insertions, 3 deletions
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 |