@@ -245,14 +245,14 @@ pub const AT_SYMLINK_FOLLOW: c_int = 0x2;
245245pub const AT_REMOVEDIR : c_int = 0x4 ;
246246pub const UTIME_OMIT : c_long = 0xfffffffe ;
247247pub const UTIME_NOW : c_long = 0xffffffff ;
248- pub const S_IFIFO : mode_t = 49152 ;
248+ pub const S_IFIFO : mode_t = 0o1_0000 ;
249249pub const S_IFCHR : mode_t = 8192 ;
250250pub const S_IFBLK : mode_t = 24576 ;
251251pub const S_IFDIR : mode_t = 16384 ;
252252pub const S_IFREG : mode_t = 32768 ;
253253pub const S_IFLNK : mode_t = 40960 ;
254254pub const S_IFSOCK : mode_t = 49152 ;
255- pub const S_IFMT : mode_t = 57344 ;
255+ pub const S_IFMT : mode_t = 0o17_0000 ;
256256pub const S_IRWXO : mode_t = 0x7 ;
257257pub const S_IXOTH : mode_t = 0x1 ;
258258pub const S_IWOTH : mode_t = 0x2 ;
@@ -372,16 +372,26 @@ pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
372372pub const _SC_IOV_MAX: c_int = 60 ;
373373pub const _SC_SYMLOOP_MAX: c_int = 173 ;
374374
375- #[ allow( unused_unsafe) ] // `addr_of!(EXTERN_STATIC)` is now safe; remove `unsafe` when MSRV >= 1.82
376- pub static CLOCK_MONOTONIC : clockid_t = unsafe { clockid_t ( ptr_addr_of ! ( _CLOCK_MONOTONIC) ) } ;
377- #[ allow( unused_unsafe) ]
378- pub static CLOCK_PROCESS_CPUTIME_ID : clockid_t =
379- unsafe { clockid_t ( ptr_addr_of ! ( _CLOCK_PROCESS_CPUTIME_ID) ) } ;
380- #[ allow( unused_unsafe) ]
381- pub static CLOCK_REALTIME : clockid_t = unsafe { clockid_t ( ptr_addr_of ! ( _CLOCK_REALTIME) ) } ;
382- #[ allow( unused_unsafe) ]
383- pub static CLOCK_THREAD_CPUTIME_ID : clockid_t =
384- unsafe { clockid_t ( ptr_addr_of ! ( _CLOCK_THREAD_CPUTIME_ID) ) } ;
375+ cfg_if ! {
376+ if #[ cfg( libc_ctest) ] {
377+ // skip these constants when this is active because `ctest` currently
378+ // panics on parsing the constants below
379+ } else {
380+ // `addr_of!(EXTERN_STATIC)` is now safe; remove `unsafe` when MSRV >= 1.82
381+ #[ allow( unused_unsafe) ]
382+ pub static CLOCK_MONOTONIC : clockid_t =
383+ unsafe { clockid_t( ptr_addr_of!( _CLOCK_MONOTONIC) ) } ;
384+ #[ allow( unused_unsafe) ]
385+ pub static CLOCK_PROCESS_CPUTIME_ID : clockid_t =
386+ unsafe { clockid_t( ptr_addr_of!( _CLOCK_PROCESS_CPUTIME_ID) ) } ;
387+ #[ allow( unused_unsafe) ]
388+ pub static CLOCK_REALTIME : clockid_t =
389+ unsafe { clockid_t( ptr_addr_of!( _CLOCK_REALTIME) ) } ;
390+ #[ allow( unused_unsafe) ]
391+ pub static CLOCK_THREAD_CPUTIME_ID : clockid_t =
392+ unsafe { clockid_t( ptr_addr_of!( _CLOCK_THREAD_CPUTIME_ID) ) } ;
393+ }
394+ }
385395
386396pub const ABDAY_1 : :: nl_item = 0x20000 ;
387397pub const ABDAY_2 : :: nl_item = 0x20001 ;
0 commit comments