From b74eec62d4ed7ecc08cc439269c539b21350ccc4 Mon Sep 17 00:00:00 2001 From: auronandace Date: Fri, 15 May 2026 08:42:31 +0100 Subject: [PATCH] remove sys_types header from signal header includes --- src/header/signal/cbindgen.toml | 10 +++++++++- src/header/signal/mod.rs | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/header/signal/cbindgen.toml b/src/header/signal/cbindgen.toml index 2534295250..9f7b77b8e3 100644 --- a/src/header/signal/cbindgen.toml +++ b/src/header/signal/cbindgen.toml @@ -6,11 +6,19 @@ # - "pid_t As described in ." # - "The header shall define the pthread_attr_t type as described in ." # - "Inclusion of the header may make visible all symbols from the header." -sys_includes = ["sys/types.h"] +# +# Cycle warning: +# POSIX states signal.h may include time.h and time.h may include signal.h. +# To prevent a cycle between both headers we only import the needed types through bits. +sys_includes = [] include_guard = "_RELIBC_SIGNAL_H" after_includes = """ +#include // for pid_t from sys/types.h +#include // for pthread_t and pthread_attr_t from sys/types.h #include // for sigset_t +#include // for size_t from sys/types.h #include // for timespec from time.h +#include // for uid_t from sys/types.h #define SIG_DFL ((void (*)(int))0) #define SIG_IGN ((void (*)(int))1) diff --git a/src/header/signal/mod.rs b/src/header/signal/mod.rs index db74f8b977..497f6a4d6d 100644 --- a/src/header/signal/mod.rs +++ b/src/header/signal/mod.rs @@ -34,9 +34,13 @@ pub mod sys; type SigSet = BitSet<[u64; 1]>; +/// cbindgen:ignore pub(crate) const SIG_DFL: usize = 0; +/// cbindgen:ignore pub(crate) const SIG_IGN: usize = 1; +/// cbindgen:ignore pub(crate) const SIG_ERR: isize = -1; +/// cbindgen:ignore pub(crate) const SIG_HOLD: isize = 2; pub const SIG_BLOCK: c_int = 0;