split out timeval to reduce namespace pollution
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_select.h.html
|
||||
#
|
||||
# This type is split out to prevent including all of sys/select.h in other headers.
|
||||
#
|
||||
# POSIX headers that require timeval:
|
||||
# - sys/resource.h
|
||||
# - sys/select.h (where it should be defined)
|
||||
# - sys/time.h
|
||||
after_includes = """
|
||||
#include <bits/time-t.h>
|
||||
#include <bits/suseconds-t.h>
|
||||
"""
|
||||
include_guard = "_RELIBC_BITS_TIMEVAL_H"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
no_includes = true
|
||||
cpp_compat = true
|
||||
|
||||
[enum]
|
||||
prefix_with_name = true
|
||||
@@ -0,0 +1,15 @@
|
||||
use crate::platform::types::{suseconds_t, time_t};
|
||||
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_select.h.html>.
|
||||
///
|
||||
/// Note that the `timeval` struct was specified for
|
||||
/// [`sys/time.h`](crate::header::sys_time) in the Open Group Base
|
||||
/// Specifications Issue 7 and prior, see
|
||||
/// <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html>.
|
||||
#[repr(C)]
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Default)]
|
||||
pub struct timeval {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_usec: suseconds_t,
|
||||
}
|
||||
Reference in New Issue
Block a user