diff --git a/libc-test/build.rs b/libc-test/build.rs index d033ce843c79f..2074d71d10f64 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -408,6 +408,9 @@ fn test_apple(target: &str) { ("ifreq", "ifr_ifru") => true, ("ifkpi", "ifk_data") => true, ("ifconf", "ifc_ifcu") => true, + // FIXME: this field has been incorporated into a resized `rmx_filler` array. + ("rt_metrics", "rmx_state") => true, + ("rt_metrics", "rmx_filler") => true, _ => false, } }); diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 70019ea0b313e..f21c0ae6e54aa 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -509,6 +509,8 @@ s! { pub rmx_rtt: u32, pub rmx_rttvar: u32, pub rmx_pksent: u32, + /// This field does not exist anymore, the u32 is now part of a resized + /// `rmx_filler` array. pub rmx_state: u32, pub rmx_filler: [u32; 3], } diff --git a/src/wasi.rs b/src/wasi.rs index ae490bf94d7a2..8b32405b9fbfe 100644 --- a/src/wasi.rs +++ b/src/wasi.rs @@ -366,10 +366,14 @@ pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; pub const _SC_IOV_MAX: c_int = 60; pub const _SC_SYMLOOP_MAX: c_int = 173; +#[allow(unused_unsafe)] // `addr_of!(EXTERN_STATIC)` is now safe; remove `unsafe` when MSRV >= 1.82 pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) }; +#[allow(unused_unsafe)] pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) }; +#[allow(unused_unsafe)] pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) }; +#[allow(unused_unsafe)] pub static CLOCK_THREAD_CPUTIME_ID: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };