From 27f65e1b228c23de66cc3b643855daed8f430af0 Mon Sep 17 00:00:00 2001 From: auronandace Date: Mon, 1 Jun 2026 10:34:39 +0100 Subject: [PATCH] verify sys_time header includes --- src/header/sys_select/cbindgen.toml | 5 ++--- src/header/sys_time/cbindgen.toml | 12 +++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/header/sys_select/cbindgen.toml b/src/header/sys_select/cbindgen.toml index 67a366c344..fedc53196f 100644 --- a/src/header/sys_select/cbindgen.toml +++ b/src/header/sys_select/cbindgen.toml @@ -6,14 +6,13 @@ # - "The header shall define the timespec structure as described in ." # - "Inclusion of the header may make visible all symbols from the headers and ." # -# bits/timeval.h brings in time_t and suseconds_t so no need to include all of sys/types.h. -sys_includes = [] +# bits/timeval.h brings in time_t and suseconds_t from sys/types.h. include_guard = "_RELIBC_SYS_SELECT_H" # FD_SETSIZE and fd_set is also defined in C (below) because cbindgen is incompatible with mem::size_of after_includes = """ #include // for sigset_t from signal.h #include // for timespec from time.h -#include // for timeval +#include // for timeval // from musl license MIT { #define FD_SETSIZE 1024 diff --git a/src/header/sys_time/cbindgen.toml b/src/header/sys_time/cbindgen.toml index a42ba5956c..58dc0ed83c 100644 --- a/src/header/sys_time/cbindgen.toml +++ b/src/header/sys_time/cbindgen.toml @@ -1,8 +1,14 @@ -# sys/select brings in bits/timespec.h -# bits/timespec.h brings in time_t +# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_time.h.html +# +# Spec quotations relating to includes: +# - "The header shall define the fd_set type and the timeval structure, as described in ." +# - "The header shall define the time_t and suseconds_t types as described in ." +# - "The header shall define the following as described in : FD_CLR() FD_ISSET() FD_SET() FD_ZERO() FD_SETSIZE" +# - "Inclusion of the header may make visible all symbols from the header." +# # sys/select brings in bits/timeval.h # bits/timeval.h brings in time_t and suseconds_t -# features.h needed for #[deprecated] annotations +# features.h needed for deprecated annotations sys_includes = ["sys/select.h", "features.h"] include_guard = "_RELIBC_SYS_TIME_H" language = "C"