diff --git a/src/header/sys_time/mod.rs b/src/header/sys_time/mod.rs index 31ae5bb0b2..800471e1f6 100644 --- a/src/header/sys_time/mod.rs +++ b/src/header/sys_time/mod.rs @@ -38,18 +38,8 @@ pub const ITIMER_PROF: c_int = 2; /// /// TODO: specified for `sys/select.h` in modern POSIX? #[repr(C)] -#[derive(Default)] -pub struct timeval { - pub tv_sec: time_t, - pub tv_usec: suseconds_t, -} - -/// Non-POSIX, see . -#[repr(C)] -#[derive(Default)] -pub struct timezone { - pub tz_minuteswest: c_int, - pub tz_dsttime: c_int, +pub struct fd_set { + pub fds_bits: [c_long; 16usize], } /// See . @@ -69,8 +59,18 @@ pub struct itimerval { /// /// TODO: specified for `sys/select.h` in modern POSIX? #[repr(C)] -pub struct fd_set { - pub fds_bits: [c_long; 16usize], +#[derive(Default)] +pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, +} + +/// Non-POSIX, see . +#[repr(C)] +#[derive(Default)] +pub struct timezone { + pub tz_minuteswest: c_int, + pub tz_dsttime: c_int, } /// See . @@ -86,6 +86,20 @@ pub unsafe extern "C" fn getitimer(which: c_int, value: *mut itimerval) -> c_int .or_minus_one_errno() } +/// See . +/// +/// See also +/// for further details on the `tzp` argument. +/// +/// # Deprecation +/// The `gettimeofday()` function was marked obsolescent in the Open Group Base +/// Specifications Issue 7, and removed in Issue 8. +#[deprecated] +#[no_mangle] +pub unsafe extern "C" fn gettimeofday(tp: *mut timeval, tzp: *mut timezone) -> c_int { + Sys::gettimeofday(tp, tzp).map(|()| 0).or_minus_one_errno() +} + /// See . /// /// # Deprecation @@ -103,20 +117,6 @@ pub unsafe extern "C" fn setitimer( .or_minus_one_errno() } -/// See . -/// -/// See also -/// for further details on the `tzp` argument. -/// -/// # Deprecation -/// The `gettimeofday()` function was marked obsolescent in the Open Group Base -/// Specifications Issue 7, and removed in Issue 8. -#[deprecated] -#[no_mangle] -pub unsafe extern "C" fn gettimeofday(tp: *mut timeval, tzp: *mut timezone) -> c_int { - Sys::gettimeofday(tp, tzp).map(|()| 0).or_minus_one_errno() -} - /// See . /// /// # Deprecation