move timeval to sys_select

This commit is contained in:
Ron Williams
2026-01-30 15:53:15 +00:00
parent a32fd56e61
commit 2c3201eaeb
11 changed files with 35 additions and 28 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
sys_includes = ["sys/types.h", "features.h"]
sys_includes = ["sys/types.h", "features.h", "sys/select.h"]
include_guard = "_SYS_TIME_H"
language = "C"
trailer = "#include <bits/sys/time.h>"
@@ -8,3 +8,6 @@ cpp_compat = true
[enum]
prefix_with_name = true
[export.rename]
"timeval" = "struct timeval"
+1 -11
View File
@@ -5,7 +5,7 @@
use crate::{
c_str::CStr,
error::ResultExt,
header::time::timespec,
header::{sys_select::timeval, time::timespec},
out::Out,
platform::{
Pal, PalSignal, Sys,
@@ -59,16 +59,6 @@ pub struct itimerval {
pub it_value: timeval,
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_time.h.html>.
///
/// 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)]