@@ -245,14 +245,14 @@ pub const AT_SYMLINK_FOLLOW: c_int = 0x2;
245
245
pub const AT_REMOVEDIR : c_int = 0x4 ;
246
246
pub const UTIME_OMIT : c_long = 0xfffffffe ;
247
247
pub const UTIME_NOW : c_long = 0xffffffff ;
248
- pub const S_IFIFO : mode_t = 49152 ;
248
+ pub const S_IFIFO : mode_t = 0o1_0000 ;
249
249
pub const S_IFCHR : mode_t = 8192 ;
250
250
pub const S_IFBLK : mode_t = 24576 ;
251
251
pub const S_IFDIR : mode_t = 16384 ;
252
252
pub const S_IFREG : mode_t = 32768 ;
253
253
pub const S_IFLNK : mode_t = 40960 ;
254
254
pub const S_IFSOCK : mode_t = 49152 ;
255
- pub const S_IFMT : mode_t = 57344 ;
255
+ pub const S_IFMT : mode_t = 0o17_0000 ;
256
256
pub const S_IRWXO : mode_t = 0x7 ;
257
257
pub const S_IXOTH : mode_t = 0x1 ;
258
258
pub const S_IWOTH : mode_t = 0x2 ;
@@ -372,16 +372,26 @@ pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
372
372
pub const _SC_IOV_MAX: c_int = 60 ;
373
373
pub const _SC_SYMLOOP_MAX: c_int = 173 ;
374
374
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
+ }
385
395
386
396
pub const ABDAY_1 : :: nl_item = 0x20000 ;
387
397
pub const ABDAY_2 : :: nl_item = 0x20001 ;
0 commit comments