diff --git a/src/header/time/mod.rs b/src/header/time/mod.rs index 8c4baf2159..0880deb7d6 100644 --- a/src/header/time/mod.rs +++ b/src/header/time/mod.rs @@ -107,11 +107,6 @@ static TIMEZONE_NAMES: Mutex>> = Mutex::new(OnceCell: // Hold `TIMEZONE_LOCK` when updating `tzname`, `timezone`, and `daylight`. static TIMEZONE_LOCK: Mutex<(Option, Option)> = Mutex::new((None, None)); -/// See . -#[allow(non_upper_case_globals)] -#[no_mangle] -pub static mut tzname: TzName = TzName([ptr::null_mut(); 2]); - /// See . #[allow(non_upper_case_globals)] #[no_mangle] @@ -122,6 +117,11 @@ pub static mut daylight: c_int = 0; #[no_mangle] pub static mut timezone: c_long = 0; +/// See . +#[allow(non_upper_case_globals)] +#[no_mangle] +pub static mut tzname: TzName = TzName([ptr::null_mut(); 2]); + /// See . #[repr(C)] pub struct itimerspec { @@ -526,6 +526,12 @@ pub unsafe extern "C" fn time(tloc: *mut time_t) -> time_t { ts.tv_sec } +/// Non-POSIX, see . +#[no_mangle] +pub unsafe extern "C" fn timegm(tm: *mut tm) -> time_t { + mktime(tm) +} + /// Non-POSIX, see . #[deprecated] #[no_mangle] @@ -534,12 +540,6 @@ pub unsafe extern "C" fn timelocal(tm: *mut tm) -> time_t { timegm(tm) } -/// Non-POSIX, see . -#[no_mangle] -pub unsafe extern "C" fn timegm(tm: *mut tm) -> time_t { - mktime(tm) -} - /// See . // #[no_mangle] pub extern "C" fn timer_create( @@ -556,6 +556,29 @@ pub extern "C" fn timer_delete(timerid: timer_t) -> c_int { unimplemented!(); } +/// See . +// #[no_mangle] +pub extern "C" fn timer_getoverrun(timerid: timer_t) -> c_int { + unimplemented!(); +} + +/// See . +// #[no_mangle] +pub extern "C" fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int { + unimplemented!(); +} + +/// See . +// #[no_mangle] +pub extern "C" fn timer_settime( + timerid: timer_t, + flags: c_int, + value: *const itimerspec, + ovalue: *mut itimerspec, +) -> c_int { + unimplemented!(); +} + /// See . #[no_mangle] pub unsafe extern "C" fn tzset() { @@ -574,29 +597,6 @@ pub unsafe extern "C" fn tzset() { set_timezone(&mut lock, &std_time, dst_time) } -/// See . -// #[no_mangle] -pub extern "C" fn timer_settime( - timerid: timer_t, - flags: c_int, - value: *const itimerspec, - ovalue: *mut itimerspec, -) -> c_int { - unimplemented!(); -} - -/// See . -// #[no_mangle] -pub extern "C" fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int { - unimplemented!(); -} - -/// See . -// #[no_mangle] -pub extern "C" fn timer_getoverrun(timerid: timer_t) -> c_int { - unimplemented!(); -} - fn clear_timezone(guard: &mut MutexGuard<'_, (Option, Option)>) { guard.0 = None; guard.1 = None;