diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:03:36 +0000 |
commit | 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch) | |
tree | 3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /vendor/libc/src/unix/bsd | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.tar.xz rustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.zip |
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs | 1 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/apple/mod.rs | 59 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs | 69 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs | 103 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/freebsdlike/mod.rs | 42 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/mod.rs | 6 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/netbsdlike/mod.rs | 11 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs | 160 | ||||
-rw-r--r-- | vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs | 11 |
9 files changed, 379 insertions, 83 deletions
diff --git a/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs b/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs index 131e15b69..29db97ec7 100644 --- a/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs +++ b/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs @@ -15,6 +15,7 @@ s! { pub uc_link: *mut ::ucontext_t, pub uc_mcsize: usize, pub uc_mcontext: mcontext_t, + __mcontext_data: __darwin_mcontext64, } pub struct __darwin_mcontext64 { diff --git a/vendor/libc/src/unix/bsd/apple/mod.rs b/vendor/libc/src/unix/bsd/apple/mod.rs index bd69d8aaa..a831ca850 100644 --- a/vendor/libc/src/unix/bsd/apple/mod.rs +++ b/vendor/libc/src/unix/bsd/apple/mod.rs @@ -53,6 +53,8 @@ pub type host_info64_t = *mut integer_t; pub type processor_flavor_t = ::c_int; pub type thread_flavor_t = natural_t; pub type thread_inspect_t = ::mach_port_t; +pub type thread_act_t = ::mach_port_t; +pub type thread_act_array_t = *mut ::thread_act_t; pub type policy_t = ::c_int; pub type mach_vm_address_t = u64; pub type mach_vm_offset_t = u64; @@ -64,6 +66,9 @@ pub type memory_object_offset_t = ::c_ulonglong; pub type vm_inherit_t = ::c_uint; pub type vm_prot_t = ::c_int; +pub type ledger_t = ::mach_port_t; +pub type ledger_array_t = *mut ::ledger_t; + pub type iconv_t = *mut ::c_void; pub type processor_cpu_load_info_t = *mut processor_cpu_load_info; @@ -121,6 +126,7 @@ pub type vm_statistics64_t = *mut vm_statistics64; pub type vm_statistics64_data_t = vm_statistics64; pub type task_t = ::mach_port_t; +pub type task_inspect_t = ::mach_port_t; pub type sysdir_search_path_enumeration_state = ::c_uint; @@ -672,6 +678,13 @@ s! { pub s_addr: ::in_addr_t, } + // net/ndrv.h + pub struct sockaddr_ndrv { + pub snd_len: ::c_uchar, + pub snd_family: ::c_uchar, + pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h + } + // sys/socket.h pub struct sa_endpoints_t { @@ -1038,7 +1051,8 @@ s_no_extra_traits! { pub f_fstypename: [::c_char; 16], pub f_mntonname: [::c_char; 1024], pub f_mntfromname: [::c_char; 1024], - pub f_reserved: [u32; 8], + pub f_flags_ext: u32, + pub f_reserved: [u32; 7], } pub struct dirent { @@ -3466,6 +3480,7 @@ pub const pseudo_AF_RTIP: ::c_int = 22; pub const AF_IPX: ::c_int = 23; pub const AF_SIP: ::c_int = 24; pub const pseudo_AF_PIP: ::c_int = 25; +pub const AF_NDRV: ::c_int = 27; pub const AF_ISDN: ::c_int = 28; pub const AF_E164: ::c_int = AF_ISDN; pub const pseudo_AF_KEY: ::c_int = 29; @@ -3508,6 +3523,7 @@ pub const PF_SIP: ::c_int = AF_SIP; pub const PF_IPX: ::c_int = AF_IPX; pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; pub const PF_PIP: ::c_int = pseudo_AF_PIP; +pub const PF_NDRV: ::c_int = AF_NDRV; pub const PF_ISDN: ::c_int = AF_ISDN; pub const PF_KEY: ::c_int = pseudo_AF_KEY; pub const PF_INET6: ::c_int = AF_INET6; @@ -3552,6 +3568,7 @@ pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70; pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71; pub const IP_BLOCK_SOURCE: ::c_int = 72; pub const IP_UNBLOCK_SOURCE: ::c_int = 73; +pub const IPV6_BOUND_IF: ::c_int = 125; pub const TCP_NOPUSH: ::c_int = 4; pub const TCP_NOOPT: ::c_int = 8; @@ -4672,6 +4689,16 @@ cfg_if! { const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 } + } else { + fn __DARWIN_ALIGN32(p: usize) -> usize { + let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; + p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 + } + } +} + +cfg_if! { + if #[cfg(libc_const_size_of)] { pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = (::mem::size_of::<thread_extended_policy_data_t>() / ::mem::size_of::<integer_t>()) as mach_msg_type_number_t; @@ -4712,10 +4739,6 @@ cfg_if! { (::mem::size_of::<vm_statistics64_data_t>() / ::mem::size_of::<integer_t>()) as mach_msg_type_number_t; } else { - fn __DARWIN_ALIGN32(p: usize) -> usize { - let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1; - p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 - } pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1; pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4; pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1; @@ -5004,6 +5027,8 @@ extern "C" { thread_info_out: thread_info_t, thread_info_outCnt: *mut mach_msg_type_number_t, ) -> kern_return_t; + #[cfg_attr(doc, doc(alias = "__errno_location"))] + #[cfg_attr(doc, doc(alias = "errno"))] pub fn __error() -> *mut ::c_int; pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; pub fn backtrace_symbols(addrs: *const *mut ::c_void, sz: ::c_int) -> *mut *mut ::c_char; @@ -5480,6 +5505,19 @@ extern "C" { task_info_out: task_info_t, task_info_count: *mut mach_msg_type_number_t, ) -> ::kern_return_t; + pub fn task_create( + target_task: ::task_t, + ledgers: ::ledger_array_t, + ledgersCnt: ::mach_msg_type_number_t, + inherit_memory: ::boolean_t, + child_task: *mut ::task_t, + ) -> ::kern_return_t; + pub fn task_terminate(target_task: ::task_t) -> ::kern_return_t; + pub fn task_threads( + target_task: ::task_inspect_t, + act_list: *mut ::thread_act_array_t, + act_listCnt: *mut ::mach_msg_type_number_t, + ) -> ::kern_return_t; pub fn host_statistics( host_priv: host_t, flavor: host_flavor_t, @@ -5508,12 +5546,23 @@ cfg_if! { if #[cfg(target_os = "macos")] { extern "C" { pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + } + } +} +cfg_if! { + if #[cfg(any(target_os = "macos", target_os = "ios"))] { + extern "C" { pub fn memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void; + pub fn task_set_info(target_task: ::task_t, + flavor: ::task_flavor_t, + task_info_in: ::task_info_t, + task_info_inCnt: ::mach_msg_type_number_t + ) -> ::kern_return_t; } } } diff --git a/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs index d56362816..df7719b4b 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -34,6 +34,17 @@ pub type pthread_spinlock_t = ::uintptr_t; pub type segsz_t = usize; +pub type vm_prot_t = u8; +pub type vm_maptype_t = u8; +pub type vm_inherit_t = i8; +pub type vm_subsys_t = ::c_int; +pub type vm_eflags_t = ::c_uint; + +pub type vm_map_t = *mut __c_anonymous_vm_map; +pub type vm_map_entry_t = *mut vm_map_entry; + +pub type pmap = __c_anonymous_pmap; + #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum sem {} impl ::Copy for sem {} @@ -336,6 +347,50 @@ s! { kp_spare: [::c_int; 2], } + pub struct __c_anonymous_vm_map { + _priv: [::uintptr_t; 36], + } + + pub struct vm_map_entry { + _priv: [::uintptr_t; 15], + pub eflags: ::vm_eflags_t, + pub maptype: ::vm_maptype_t, + pub protection: ::vm_prot_t, + pub max_protection: ::vm_prot_t, + pub inheritance: ::vm_inherit_t, + pub wired_count: ::c_int, + pub id: ::vm_subsys_t, + } + + pub struct __c_anonymous_pmap { + _priv1: [::uintptr_t; 32], + _priv2: [::uintptr_t; 32], + _priv3: [::uintptr_t; 32], + _priv4: [::uintptr_t; 32], + _priv5: [::uintptr_t; 8], + } + + pub struct vmspace { + vm_map: __c_anonymous_vm_map, + vm_pmap: __c_anonymous_pmap, + pub vm_flags: ::c_int, + pub vm_shm: *mut ::c_char, + pub vm_rssize: ::segsz_t, + pub vm_swrss: ::segsz_t, + pub vm_tsize: ::segsz_t, + pub vm_dsize: ::segsz_t, + pub vm_ssize: ::segsz_t, + pub vm_taddr: *mut ::c_char, + pub vm_daddr: *mut ::c_char, + pub vm_maxsaddr: *mut ::c_char, + pub vm_minsaddr: *mut ::c_char, + _unused1: ::c_int, + _unused2: ::c_int, + pub vm_pagesupply: ::c_int, + pub vm_holdcnt: ::c_uint, + pub vm_refcnt: ::c_uint, + } + pub struct cpuctl_msr_args_t { pub msr: ::c_int, pub data: u64, @@ -1613,6 +1668,20 @@ extern "C" { pub fn freezero(ptr: *mut ::c_void, size: ::size_t); } +#[link(name = "kvm")] +extern "C" { + pub fn kvm_vm_map_entry_first( + kvm: *mut ::kvm_t, + map: vm_map_t, + entry: vm_map_entry_t, + ) -> vm_map_entry_t; + pub fn kvm_vm_map_entry_next( + kvm: *mut ::kvm_t, + map: vm_map_entry_t, + entry: vm_map_entry_t, + ) -> vm_map_entry_t; +} + cfg_if! { if #[cfg(libc_thread_local)] { mod errno; diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs index 8d27d8860..84e43b23e 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -44,10 +44,6 @@ pub type fhandle_t = fhandle; pub type au_id_t = ::uid_t; pub type au_asid_t = ::pid_t; -// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly, -// making the type definition system dependent. Better not bind it exactly. -pub type kvm_t = ::c_void; - #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] #[repr(u32)] pub enum devstat_support_flags { @@ -3661,6 +3657,19 @@ pub const CPUCLOCK_WHICH_TID: ::c_int = 1; pub const MFD_CLOEXEC: ::c_uint = 0x00000001; pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002; pub const MFD_HUGETLB: ::c_uint = 0x00000004; +pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000; +pub const MFD_HUGE_64KB: ::c_uint = 16 << 26; +pub const MFD_HUGE_512KB: ::c_uint = 19 << 26; +pub const MFD_HUGE_1MB: ::c_uint = 20 << 26; +pub const MFD_HUGE_2MB: ::c_uint = 21 << 26; +pub const MFD_HUGE_8MB: ::c_uint = 23 << 26; +pub const MFD_HUGE_16MB: ::c_uint = 24 << 26; +pub const MFD_HUGE_32MB: ::c_uint = 25 << 26; +pub const MFD_HUGE_256MB: ::c_uint = 28 << 26; +pub const MFD_HUGE_512MB: ::c_uint = 29 << 26; +pub const MFD_HUGE_1GB: ::c_uint = 30 << 26; +pub const MFD_HUGE_2GB: ::c_uint = 31 << 26; +pub const MFD_HUGE_16GB: ::c_uint = 34 << 26; pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0; pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1; @@ -3772,21 +3781,21 @@ f! { } pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () { - let bitset_bits = ::mem::size_of::<::c_long>(); + let bitset_bits = 8 * ::mem::size_of::<::c_long>(); let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); cpuset.__bits[idx] |= 1 << offset; () } pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () { - let bitset_bits = ::mem::size_of::<::c_long>(); + let bitset_bits = 8 * ::mem::size_of::<::c_long>(); let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); cpuset.__bits[idx] &= !(1 << offset); () } pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool { - let bitset_bits = ::mem::size_of::<::c_long>(); + let bitset_bits = 8 * ::mem::size_of::<::c_long>(); let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); 0 != cpuset.__bits[idx] & (1 << offset) } @@ -3794,9 +3803,9 @@ f! { pub fn CPU_COUNT(cpuset: &cpuset_t) -> ::c_int { let mut s: u32 = 0; let cpuset_size = ::mem::size_of::<cpuset_t>(); - let bitset_bits = ::mem::size_of::<::c_long>(); + let bitset_size = ::mem::size_of::<::c_long>(); - for i in cpuset.__bits[..(cpuset_size / bitset_bits)].iter() { + for i in cpuset.__bits[..(cpuset_size / bitset_size)].iter() { s += i.count_ones(); }; s as ::c_int @@ -3839,6 +3848,8 @@ cfg_if! { } extern "C" { + #[cfg_attr(doc, doc(alias = "__errno_location"))] + #[cfg_attr(doc, doc(alias = "errno"))] pub fn __error() -> *mut ::c_int; pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; @@ -4272,71 +4283,39 @@ extern "C" { #[link(name = "kvm")] extern "C" { - pub fn kvm_open( - execfile: *const ::c_char, - corefile: *const ::c_char, - swapfile: *const ::c_char, - flags: ::c_int, - errstr: *const ::c_char, - ) -> *mut kvm_t; - pub fn kvm_close(kd: *mut kvm_t) -> ::c_int; - pub fn kvm_dpcpu_setcpu(kd: *mut kvm_t, cpu: ::c_uint) -> ::c_int; - pub fn kvm_getargv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char; - pub fn kvm_getcptime(kd: *mut kvm_t, cp_time: *mut ::c_long) -> ::c_int; - pub fn kvm_getenvv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char; - pub fn kvm_geterr(kd: *mut kvm_t) -> *mut ::c_char; - pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; - pub fn kvm_getmaxcpu(kd: *mut kvm_t) -> ::c_int; - pub fn kvm_getncpus(kd: *mut kvm_t) -> ::c_int; - pub fn kvm_getpcpu(kd: *mut kvm_t, cpu: ::c_int) -> *mut ::c_void; - pub fn kvm_counter_u64_fetch(kd: *mut kvm_t, base: ::c_ulong) -> u64; - pub fn kvm_getprocs( - kd: *mut kvm_t, - op: ::c_int, - arg: ::c_int, - cnt: *mut ::c_int, - ) -> *mut kinfo_proc; + pub fn kvm_dpcpu_setcpu(kd: *mut ::kvm_t, cpu: ::c_uint) -> ::c_int; + pub fn kvm_getargv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int) + -> *mut *mut ::c_char; + pub fn kvm_getcptime(kd: *mut ::kvm_t, cp_time: *mut ::c_long) -> ::c_int; + pub fn kvm_getenvv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int) + -> *mut *mut ::c_char; + pub fn kvm_geterr(kd: *mut ::kvm_t) -> *mut ::c_char; + pub fn kvm_getmaxcpu(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_getncpus(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_getpcpu(kd: *mut ::kvm_t, cpu: ::c_int) -> *mut ::c_void; + pub fn kvm_counter_u64_fetch(kd: *mut ::kvm_t, base: ::c_ulong) -> u64; pub fn kvm_getswapinfo( - kd: *mut kvm_t, + kd: *mut ::kvm_t, info: *mut kvm_swap, maxswap: ::c_int, flags: ::c_int, ) -> ::c_int; - pub fn kvm_native(kd: *mut kvm_t) -> ::c_int; - pub fn kvm_nlist(kd: *mut kvm_t, nl: *mut nlist) -> ::c_int; - pub fn kvm_nlist2(kd: *mut kvm_t, nl: *mut kvm_nlist) -> ::c_int; - pub fn kvm_openfiles( - execfile: *const ::c_char, - corefile: *const ::c_char, - swapfile: *const ::c_char, - flags: ::c_int, - errbuf: *mut ::c_char, - ) -> *mut kvm_t; - pub fn kvm_read( - kd: *mut kvm_t, - addr: ::c_ulong, - buf: *mut ::c_void, - nbytes: ::size_t, - ) -> ::ssize_t; + pub fn kvm_native(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_nlist(kd: *mut ::kvm_t, nl: *mut nlist) -> ::c_int; + pub fn kvm_nlist2(kd: *mut ::kvm_t, nl: *mut kvm_nlist) -> ::c_int; pub fn kvm_read_zpcpu( - kd: *mut kvm_t, + kd: *mut ::kvm_t, base: ::c_ulong, buf: *mut ::c_void, size: ::size_t, cpu: ::c_int, ) -> ::ssize_t; pub fn kvm_read2( - kd: *mut kvm_t, + kd: *mut ::kvm_t, addr: kvaddr_t, buf: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t; - pub fn kvm_write( - kd: *mut kvm_t, - addr: ::c_ulong, - buf: *const ::c_void, - nbytes: ::size_t, - ) -> ::ssize_t; } #[link(name = "util")] @@ -4486,10 +4465,10 @@ extern "C" { #[link(name = "devstat")] extern "C" { - pub fn devstat_getnumdevs(kd: *mut kvm_t) -> ::c_int; - pub fn devstat_getgeneration(kd: *mut kvm_t) -> ::c_long; - pub fn devstat_getversion(kd: *mut kvm_t) -> ::c_int; - pub fn devstat_checkversion(kd: *mut kvm_t) -> ::c_int; + pub fn devstat_getnumdevs(kd: *mut ::kvm_t) -> ::c_int; + pub fn devstat_getgeneration(kd: *mut ::kvm_t) -> ::c_long; + pub fn devstat_getversion(kd: *mut ::kvm_t) -> ::c_int; + pub fn devstat_checkversion(kd: *mut ::kvm_t) -> ::c_int; pub fn devstat_selectdevs( dev_select: *mut *mut device_selection, num_selected: *mut ::c_int, diff --git a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs index b9d29d825..b314b6856 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs @@ -35,6 +35,10 @@ pub type Elf64_Xword = u64; pub type iconv_t = *mut ::c_void; +// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly, +// making the type definition system dependent. Better not bind it exactly. +pub type kvm_t = ::c_void; + cfg_if! { if #[cfg(target_pointer_width = "64")] { type Elf_Addr = Elf64_Addr; @@ -1790,6 +1794,44 @@ extern "C" { ) -> ::c_int; } +#[link(name = "kvm")] +extern "C" { + pub fn kvm_open( + execfile: *const ::c_char, + corefile: *const ::c_char, + swapfile: *const ::c_char, + flags: ::c_int, + errstr: *const ::c_char, + ) -> *mut ::kvm_t; + pub fn kvm_close(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_getprocs( + kd: *mut ::kvm_t, + op: ::c_int, + arg: ::c_int, + cnt: *mut ::c_int, + ) -> *mut ::kinfo_proc; + pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + pub fn kvm_openfiles( + execfile: *const ::c_char, + corefile: *const ::c_char, + swapfile: *const ::c_char, + flags: ::c_int, + errbuf: *mut ::c_char, + ) -> *mut ::kvm_t; + pub fn kvm_read( + kd: *mut ::kvm_t, + addr: ::c_ulong, + buf: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn kvm_write( + kd: *mut ::kvm_t, + addr: ::c_ulong, + buf: *const ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; +} + cfg_if! { if #[cfg(target_os = "freebsd")] { mod freebsd; diff --git a/vendor/libc/src/unix/bsd/mod.rs b/vendor/libc/src/unix/bsd/mod.rs index 8ebca0930..20e203bde 100644 --- a/vendor/libc/src/unix/bsd/mod.rs +++ b/vendor/libc/src/unix/bsd/mod.rs @@ -449,6 +449,12 @@ pub const TCP_MAXSEG: ::c_int = 2; pub const PIPE_BUF: usize = 512; +// si_code values for SIGBUS signal +pub const BUS_ADRALN: ::c_int = 1; +pub const BUS_ADRERR: ::c_int = 2; +pub const BUS_OBJERR: ::c_int = 3; + +// si_code values for SIGCHLD signal pub const CLD_EXITED: ::c_int = 1; pub const CLD_KILLED: ::c_int = 2; pub const CLD_DUMPED: ::c_int = 3; diff --git a/vendor/libc/src/unix/bsd/netbsdlike/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/mod.rs index d7d40bd97..a7f35ef85 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/mod.rs @@ -639,17 +639,6 @@ pub const TIOCM_DSR: ::c_int = 0o0400; pub const TIOCM_CD: ::c_int = TIOCM_CAR; pub const TIOCM_RI: ::c_int = TIOCM_RNG; -// Flags for chflags(2) -pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; -pub const UF_NODUMP: ::c_ulong = 0x00000001; -pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; -pub const UF_APPEND: ::c_ulong = 0x00000004; -pub const UF_OPAQUE: ::c_ulong = 0x00000008; -pub const SF_SETTABLE: ::c_ulong = 0xffff0000; -pub const SF_ARCHIVED: ::c_ulong = 0x00010000; -pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; -pub const SF_APPEND: ::c_ulong = 0x00040000; - pub const TIMER_ABSTIME: ::c_int = 1; #[link(name = "util")] diff --git a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs index 0afff1cd3..d12fd0730 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -487,6 +487,134 @@ s! { af_arg: [[::c_char; 10]; 24], } + pub struct ki_sigset_t { + pub __bits: [u32; 4], + } + + pub struct kinfo_proc2 { + pub p_forw: u64, + pub p_back: u64, + pub p_paddr: u64, + pub p_addr: u64, + pub p_fd: u64, + pub p_cwdi: u64, + pub p_stats: u64, + pub p_limit: u64, + pub p_vmspace: u64, + pub p_sigacts: u64, + pub p_sess: u64, + pub p_tsess: u64, + pub p_ru: u64, + pub p_eflag: i32, + pub p_exitsig: i32, + pub p_flag: i32, + pub p_pid: i32, + pub p_ppid: i32, + pub p_sid: i32, + pub p__pgid: i32, + pub p_tpgid: i32, + pub p_uid: u32, + pub p_ruid: u32, + pub p_gid: u32, + pub p_rgid: u32, + pub p_groups: [u32; KI_NGROUPS as usize], + pub p_ngroups: i16, + pub p_jobc: i16, + pub p_tdev: u32, + pub p_estcpu: u32, + pub p_rtime_sec: u32, + pub p_rtime_usec: u32, + pub p_cpticks: i32, + pub p_pctcpu: u32, + pub p_swtime: u32, + pub p_slptime: u32, + pub p_schedflags: i32, + pub p_uticks: u64, + pub p_sticks: u64, + pub p_iticks: u64, + pub p_tracep: u64, + pub p_traceflag: i32, + pub p_holdcnt: i32, + pub p_siglist: ki_sigset_t, + pub p_sigmask: ki_sigset_t, + pub p_sigignore: ki_sigset_t, + pub p_sigcatch: ki_sigset_t, + pub p_stat: i8, + pub p_priority: u8, + pub p_usrpri: u8, + pub p_nice: u8, + pub p_xstat: u16, + pub p_acflag: u16, + pub p_comm: [::c_char; KI_MAXCOMLEN as usize], + pub p_wmesg: [::c_char; KI_WMESGLEN as usize], + pub p_wchan: u64, + pub p_login: [::c_char; KI_MAXLOGNAME as usize], + pub p_vm_rssize: i32, + pub p_vm_tsize: i32, + pub p_vm_dsize: i32, + pub p_vm_ssize: i32, + pub p_uvalid: i64, + pub p_ustart_sec: u32, + pub p_ustart_usec: u32, + pub p_uutime_sec: u32, + pub p_uutime_usec: u32, + pub p_ustime_sec: u32, + pub p_ustime_usec: u32, + pub p_uru_maxrss: u64, + pub p_uru_ixrss: u64, + pub p_uru_idrss: u64, + pub p_uru_isrss: u64, + pub p_uru_minflt: u64, + pub p_uru_majflt: u64, + pub p_uru_nswap: u64, + pub p_uru_inblock: u64, + pub p_uru_oublock: u64, + pub p_uru_msgsnd: u64, + pub p_uru_msgrcv: u64, + pub p_uru_nsignals: u64, + pub p_uru_nvcsw: u64, + pub p_uru_nivcsw: u64, + pub p_uctime_sec: u32, + pub p_uctime_usec: u32, + pub p_cpuid: u64, + pub p_realflag: u64, + pub p_nlwps: u64, + pub p_nrlwps: u64, + pub p_realstat: u64, + pub p_svuid: u32, + pub p_svgid: u32, + pub p_ename: [::c_char; KI_MAXEMULLEN as usize], + pub p_vm_vsize: i64, + pub p_vm_msize: i64, + } + + pub struct kinfo_lwp { + pub l_forw: u64, + pub l_back: u64, + pub l_laddr: u64, + pub l_addr: u64, + pub l_lid: i32, + pub l_flag: i32, + pub l_swtime: u32, + pub l_slptime: u32, + pub l_schedflags: i32, + pub l_holdcnt: i32, + pub l_priority: u8, + pub l_usrpri: u8, + pub l_stat: i8, + l_pad1: i8, + l_pad2: i32, + pub l_wmesg: [::c_char; KI_WMESGLEN as usize], + pub l_wchan: u64, + pub l_cpuid: u64, + pub l_rtime_sec: u32, + pub l_rtime_usec: u32, + pub l_cpticks: u32, + pub l_pctcpu: u32, + pub l_pid: u32, + pub l_name: [::c_char; KI_LNAMELEN as usize], + } + pub struct kinfo_vmentry { pub kve_start: u64, pub kve_end: u64, @@ -1440,10 +1568,7 @@ pub const IPPROTO_VRRP: ::c_int = 112; /// Common Address Resolution Protocol pub const IPPROTO_CARP: ::c_int = 112; /// L2TPv3 -// TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16, -// but isn't yet supported by the NetBSD rumprun kernel image used for -// libc testing. -//pub const IPPROTO_L2TP: ::c_int = 115; +pub const IPPROTO_L2TP: ::c_int = 115; /// SCTP pub const IPPROTO_SCTP: ::c_int = 132; /// PFSYNC @@ -2103,9 +2228,18 @@ pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40; // Flags for chflags(2) -pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; +pub const SF_APPEND: ::c_ulong = 0x00040000; +pub const SF_ARCHIVED: ::c_ulong = 0x00010000; +pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; pub const SF_LOG: ::c_ulong = 0x00400000; +pub const SF_SETTABLE: ::c_ulong = 0xffff0000; pub const SF_SNAPINVAL: ::c_ulong = 0x00800000; +pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; +pub const UF_APPEND: ::c_ulong = 0x00000004; +pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; +pub const UF_NODUMP: ::c_ulong = 0x00000001; +pub const UF_OPAQUE: ::c_ulong = 0x00000008; +pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; // sys/sysctl.h pub const KVME_PROT_READ: ::c_int = 0x00000001; @@ -2121,6 +2255,22 @@ pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020; pub const NGROUPS_MAX: ::c_int = 16; +pub const KI_NGROUPS: ::c_int = 16; +pub const KI_MAXCOMLEN: ::c_int = 24; +pub const KI_WMESGLEN: ::c_int = 8; +pub const KI_MAXLOGNAME: ::c_int = 24; +pub const KI_MAXEMULLEN: ::c_int = 16; +pub const KI_LNAMELEN: ::c_int = 20; + +// sys/lwp.h +pub const LSIDL: ::c_int = 1; +pub const LSRUN: ::c_int = 2; +pub const LSSLEEP: ::c_int = 3; +pub const LSSTOP: ::c_int = 4; +pub const LSZOMB: ::c_int = 5; +pub const LSONPROC: ::c_int = 7; +pub const LSSUSPENDED: ::c_int = 8; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES diff --git a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs index 199473dd6..1910f24a4 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1628,6 +1628,17 @@ pub const EPROC_SLEADER: i32 = 0x02; // session leader pub const EPROC_UNVEIL: i32 = 0x04; // has unveil settings pub const EPROC_LKUNVEIL: i32 = 0x08; // unveil is locked +// Flags for chflags(2) +pub const UF_SETTABLE: ::c_uint = 0x0000ffff; +pub const UF_NODUMP: ::c_uint = 0x00000001; +pub const UF_IMMUTABLE: ::c_uint = 0x00000002; +pub const UF_APPEND: ::c_uint = 0x00000004; +pub const UF_OPAQUE: ::c_uint = 0x00000008; +pub const SF_SETTABLE: ::c_uint = 0xffff0000; +pub const SF_ARCHIVED: ::c_uint = 0x00010000; +pub const SF_IMMUTABLE: ::c_uint = 0x00020000; +pub const SF_APPEND: ::c_uint = 0x00040000; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES |