Skip to content
Snippets Groups Projects
Commit b9c4a910 authored by Peter Limkilde Svendsen's avatar Peter Limkilde Svendsen
Browse files

Reorder alphabetically

parent 1fea91cb
No related branches found
No related tags found
1 merge request!616Add docs, deprecations for sys/time.h
......@@ -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 <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>.
#[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 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html>.
......@@ -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 <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>.
#[repr(C)]
#[derive(Default)]
pub struct timezone {
pub tz_minuteswest: c_int,
pub tz_dsttime: c_int,
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getitimer.html>.
......@@ -86,6 +86,20 @@ pub unsafe extern "C" fn getitimer(which: c_int, value: *mut itimerval) -> c_int
.or_minus_one_errno()
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html>.
///
/// See also <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>
/// 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 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getitimer.html>.
///
/// # Deprecation
......@@ -103,20 +117,6 @@ pub unsafe extern "C" fn setitimer(
.or_minus_one_errno()
}
/// See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html>.
///
/// See also <https://www.man7.org/linux/man-pages/man2/gettimeofday.2.html>
/// 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 <https://pubs.opengroup.org/onlinepubs/9799919799/functions/utimes.html>.
///
/// # Deprecation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment