diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/libc/src/unix/bsd/apple | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/libc/src/unix/bsd/apple')
-rw-r--r-- | vendor/libc/src/unix/bsd/apple/mod.rs | 361 |
1 files changed, 353 insertions, 8 deletions
diff --git a/vendor/libc/src/unix/bsd/apple/mod.rs b/vendor/libc/src/unix/bsd/apple/mod.rs index a2fbf8767..21efb23eb 100644 --- a/vendor/libc/src/unix/bsd/apple/mod.rs +++ b/vendor/libc/src/unix/bsd/apple/mod.rs @@ -145,6 +145,16 @@ pub type CCRNGStatus = ::CCCryptorStatus; pub type copyfile_state_t = *mut ::c_void; pub type copyfile_flags_t = u32; +pub type copyfile_callback_t = ::Option< + extern "C" fn( + ::c_int, + ::c_int, + copyfile_state_t, + *const ::c_char, + *const ::c_char, + *mut ::c_void, + ) -> ::c_int, +>; pub type attrgroup_t = u32; pub type vol_capabilities_set_t = [u32; 4]; @@ -368,6 +378,25 @@ s! { pub fst_bytesalloc: ::off_t, } + pub struct fpunchhole_t { + pub fp_flags: ::c_uint, /* unused */ + pub reserved: ::c_uint, /* (to maintain 8-byte alignment) */ + pub fp_offset: ::off_t, /* IN: start of the region */ + pub fp_length: ::off_t, /* IN: size of the region */ + } + + pub struct ftrimactivefile_t { + pub fta_offset: ::off_t, + pub fta_length: ::off_t, + } + + pub struct fspecread_t { + pub fsr_flags: ::c_uint, + pub reserved: ::c_uint, + pub fsr_offset: ::off_t, + pub fsr_length: ::off_t, + } + pub struct radvisory { pub ra_offset: ::off_t, pub ra_count: ::c_int, @@ -768,7 +797,7 @@ s! { pub struct sockaddr_ndrv { pub snd_len: ::c_uchar, pub snd_family: ::c_uchar, - pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h + pub snd_name: [::c_uchar; ::IFNAMSIZ], } // sys/socket.h @@ -1100,6 +1129,15 @@ s! { pub validattr: attribute_set_t, pub nativeattr: attribute_set_t, } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct ifconf { + pub ifc_len: ::c_int, + #[cfg(libc_union)] + pub ifc_ifcu: __c_anonymous_ifc_ifcu, + #[cfg(not(libc_union))] + pub ifc_ifcu: *mut ifreq, + } } s_no_extra_traits! { @@ -1390,6 +1428,60 @@ s_no_extra_traits! { pub svm_port: ::c_uint, pub svm_cid: ::c_uint, } + + pub struct ifdevmtu { + pub ifdm_current: ::c_int, + pub ifdm_min: ::c_int, + pub ifdm_max: ::c_int, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifk_data { + pub ifk_ptr: *mut ::c_void, + pub ifk_value: ::c_int, + } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct ifkpi { + pub ifk_module_id: ::c_uint, + pub ifk_type: ::c_uint, + #[cfg(libc_union)] + pub ifk_data: __c_anonymous_ifk_data, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifr_ifru { + pub ifru_addr: ::sockaddr, + pub ifru_dstaddr: ::sockaddr, + pub ifru_broadaddr: ::sockaddr, + pub ifru_flags: ::c_short, + pub ifru_metrics: ::c_int, + pub ifru_mtu: ::c_int, + pub ifru_phys: ::c_int, + pub ifru_media: ::c_int, + pub ifru_intval: ::c_int, + pub ifru_data: *mut ::c_char, + pub ifru_devmtu: ifdevmtu, + pub ifru_kpi: ifkpi, + pub ifru_wake_flags: u32, + pub ifru_route_refcnt: u32, + pub ifru_cap: [::c_int; 2], + pub ifru_functional_type: u32, + } + + pub struct ifreq { + pub ifr_name: [::c_char; ::IFNAMSIZ], + #[cfg(libc_union)] + pub ifr_ifru: __c_anonymous_ifr_ifru, + #[cfg(not(libc_union))] + pub ifr_ifru: ::sockaddr, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifc_ifcu { + pub ifcu_buf: *mut ::c_char, + pub ifcu_req: *mut ifreq, + } } impl siginfo_t { @@ -2738,6 +2830,222 @@ cfg_if! { svm_cid.hash(state); } } + + impl PartialEq for ifdevmtu { + fn eq(&self, other: &ifdevmtu) -> bool { + self.ifdm_current == other.ifdm_current + && self.ifdm_min == other.ifdm_min + && self.ifdm_max == other.ifdm_max + } + } + + impl Eq for ifdevmtu {} + + impl ::fmt::Debug for ifdevmtu { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifdevmtu") + .field("ifdm_current", &self.ifdm_current) + .field("ifdm_min", &self.ifdm_min) + .field("ifdm_max", &self.ifdm_max) + .finish() + } + } + + impl ::hash::Hash for ifdevmtu { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.ifdm_current.hash(state); + self.ifdm_min.hash(state); + self.ifdm_max.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifk_data { + fn eq(&self, other: &__c_anonymous_ifk_data) -> bool { + unsafe { + self.ifk_ptr == other.ifk_ptr + && self.ifk_value == other.ifk_value + } + } + } + + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifk_data {} + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifk_data { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("__c_anonymous_ifk_data") + .field("ifk_ptr", unsafe { &self.ifk_ptr }) + .field("ifk_value", unsafe { &self.ifk_value }) + .finish() + } + } + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifk_data { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + unsafe { + self.ifk_ptr.hash(state); + self.ifk_value.hash(state); + } + } + } + + impl PartialEq for ifkpi { + fn eq(&self, other: &ifkpi) -> bool { + self.ifk_module_id == other.ifk_module_id + && self.ifk_type == other.ifk_type + } + } + + impl Eq for ifkpi {} + + impl ::fmt::Debug for ifkpi { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifkpi") + .field("ifk_module_id", &self.ifk_module_id) + .field("ifk_type", &self.ifk_type) + .finish() + } + } + + impl ::hash::Hash for ifkpi { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.ifk_module_id.hash(state); + self.ifk_type.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifr_ifru { + fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool { + unsafe { + self.ifru_addr == other.ifru_addr + && self.ifru_dstaddr == other.ifru_dstaddr + && self.ifru_broadaddr == other.ifru_broadaddr + && self.ifru_flags == other.ifru_flags + && self.ifru_metrics == other.ifru_metrics + && self.ifru_mtu == other.ifru_mtu + && self.ifru_phys == other.ifru_phys + && self.ifru_media == other.ifru_media + && self.ifru_intval == other.ifru_intval + && self.ifru_data == other.ifru_data + && self.ifru_devmtu == other.ifru_devmtu + && self.ifru_kpi == other.ifru_kpi + && self.ifru_wake_flags == other.ifru_wake_flags + && self.ifru_route_refcnt == other.ifru_route_refcnt + && self.ifru_cap.iter().zip(other.ifru_cap.iter()).all(|(a,b)| a == b) + && self.ifru_functional_type == other.ifru_functional_type + } + } + } + + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifr_ifru {} + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifr_ifru { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("__c_anonymous_ifr_ifru") + .field("ifru_addr", unsafe { &self.ifru_addr }) + .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) + .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) + .field("ifru_flags", unsafe { &self.ifru_flags }) + .field("ifru_metrics", unsafe { &self.ifru_metrics }) + .field("ifru_mtu", unsafe { &self.ifru_mtu }) + .field("ifru_phys", unsafe { &self.ifru_phys }) + .field("ifru_media", unsafe { &self.ifru_media }) + .field("ifru_intval", unsafe { &self.ifru_intval }) + .field("ifru_data", unsafe { &self.ifru_data }) + .field("ifru_devmtu", unsafe { &self.ifru_devmtu }) + .field("ifru_kpi", unsafe { &self.ifru_kpi }) + .field("ifru_wake_flags", unsafe { &self.ifru_wake_flags }) + .field("ifru_route_refcnt", unsafe { &self.ifru_route_refcnt }) + .field("ifru_cap", unsafe { &self.ifru_cap }) + .field("ifru_functional_type", unsafe { &self.ifru_functional_type }) + .finish() + } + } + + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifr_ifru { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + unsafe { + self.ifru_addr.hash(state); + self.ifru_dstaddr.hash(state); + self.ifru_broadaddr.hash(state); + self.ifru_flags.hash(state); + self.ifru_metrics.hash(state); + self.ifru_mtu.hash(state); + self.ifru_phys.hash(state); + self.ifru_media.hash(state); + self.ifru_intval.hash(state); + self.ifru_data.hash(state); + self.ifru_devmtu.hash(state); + self.ifru_kpi.hash(state); + self.ifru_wake_flags.hash(state); + self.ifru_route_refcnt.hash(state); + self.ifru_cap.hash(state); + self.ifru_functional_type.hash(state); + } + } + } + + impl PartialEq for ifreq { + fn eq(&self, other: &ifreq) -> bool { + self.ifr_name == other.ifr_name + && self.ifr_ifru == other.ifr_ifru + } + } + + impl Eq for ifreq {} + + impl ::fmt::Debug for ifreq { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifreq") + .field("ifr_name", &self.ifr_name) + .field("ifr_ifru", &self.ifr_ifru) + .finish() + } + } + + impl ::hash::Hash for ifreq { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.ifr_name.hash(state); + self.ifr_ifru.hash(state); + } + } + + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifc_ifcu {} + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifc_ifcu { + fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool { + unsafe { + self.ifcu_buf == other.ifcu_buf && + self.ifcu_req == other.ifcu_req + } + } + } + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifc_ifcu { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifc_ifcu") + .field("ifcu_buf", unsafe { &self.ifcu_buf }) + .field("ifcu_req", unsafe { &self.ifcu_req }) + .finish() + } + } + + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifc_ifcu { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + unsafe { self.ifcu_buf.hash(state) }; + unsafe { self.ifcu_req.hash(state) }; + } + } } } @@ -3231,6 +3539,9 @@ pub const F_GLOBAL_NOCACHE: ::c_int = 55; pub const F_NODIRECT: ::c_int = 62; pub const F_LOG2PHYS_EXT: ::c_int = 65; pub const F_BARRIERFSYNC: ::c_int = 85; +pub const F_PUNCHHOLE: ::c_int = 99; +pub const F_TRIM_ACTIVE_FILE: ::c_int = 100; +pub const F_SPECULATIVE_READ: ::c_int = 101; pub const F_GETPATH_NOFIRMLINK: ::c_int = 102; pub const F_ALLOCATECONTIG: ::c_uint = 0x02; @@ -4687,12 +4998,12 @@ pub const MNT_SNAPSHOT: ::c_int = 0x40000000; pub const MNT_NOBLOCK: ::c_int = 0x00020000; // sys/spawn.h: -pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; -pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; -pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04; -pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08; -pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x40; -pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x80; +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x0001; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x0002; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x0004; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x0008; +pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x0040; +pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x0080; pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000; // sys/ipc.h: @@ -4911,6 +5222,19 @@ pub const COPYFILE_PROGRESS: ::c_int = 4; pub const COPYFILE_CONTINUE: ::c_int = 0; pub const COPYFILE_SKIP: ::c_int = 1; pub const COPYFILE_QUIT: ::c_int = 2; +pub const COPYFILE_STATE_SRC_FD: ::c_int = 1; +pub const COPYFILE_STATE_SRC_FILENAME: ::c_int = 2; +pub const COPYFILE_STATE_DST_FD: ::c_int = 3; +pub const COPYFILE_STATE_DST_FILENAME: ::c_int = 4; +pub const COPYFILE_STATE_QUARANTINE: ::c_int = 5; +pub const COPYFILE_STATE_STATUS_CB: ::c_int = 6; +pub const COPYFILE_STATE_STATUS_CTX: ::c_int = 7; +pub const COPYFILE_STATE_COPIED: ::c_int = 8; +pub const COPYFILE_STATE_XATTRNAME: ::c_int = 9; +pub const COPYFILE_STATE_WAS_CLONED: ::c_int = 10; +pub const COPYFILE_STATE_SRC_BSIZE: ::c_int = 11; +pub const COPYFILE_STATE_DST_BSIZE: ::c_int = 12; +pub const COPYFILE_STATE_BSIZE: ::c_int = 13; // <sys/attr.h> pub const ATTR_BIT_MAP_COUNT: ::c_ushort = 5; @@ -5734,6 +6058,18 @@ extern "C" { subpref: *mut ::cpu_subtype_t, ocount: *mut ::size_t, ) -> ::c_int; + pub fn posix_spawnattr_getbinpref_np( + attr: *const posix_spawnattr_t, + count: ::size_t, + pref: *mut ::cpu_type_t, + ocount: *mut ::size_t, + ) -> ::c_int; + pub fn posix_spawnattr_setbinpref_np( + attr: *mut posix_spawnattr_t, + count: ::size_t, + pref: *mut ::cpu_type_t, + ocount: *mut ::size_t, + ) -> ::c_int; pub fn posix_spawnattr_set_qos_class_np( attr: *mut posix_spawnattr_t, qos_class: ::qos_class_t, @@ -5819,6 +6155,10 @@ extern "C" { state: copyfile_state_t, flags: copyfile_flags_t, ) -> ::c_int; + pub fn copyfile_state_free(s: copyfile_state_t) -> ::c_int; + pub fn copyfile_state_alloc() -> copyfile_state_t; + pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int; + pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int; // Added in macOS 10.13 // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1 @@ -6068,6 +6408,11 @@ extern "C" { dev: dev_t, ) -> ::c_int; pub fn freadlink(fd: ::c_int, buf: *mut ::c_char, size: ::size_t) -> ::c_int; + pub fn execvP( + file: *const ::c_char, + search_path: *const ::c_char, + argv: *const *mut ::c_char, + ) -> ::c_int; } pub unsafe fn mach_task_self() -> ::mach_port_t { @@ -6082,7 +6427,7 @@ cfg_if! { } } cfg_if! { - if #[cfg(any(target_os = "macos", target_os = "ios"))] { + if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] { extern "C" { pub fn memmem( haystack: *const ::c_void, |