Merge branch 'split-sigset-t' into 'master'

split out sigset_t from signal header

See merge request redox-os/relibc!1242
This commit is contained in:
Jeremy Soller
2026-04-29 06:51:47 -06:00
16 changed files with 50 additions and 21 deletions
+18
View File
@@ -0,0 +1,18 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/signal.h.html
#
# This type is split out to prevent importing all of signal.h into other headers.
#
# POSIX headers that require sigset_t:
# - poll.h
# - signal.h (where it should be defined)
# - sys/select.h
sys_includes = []
include_guard = "_RELIBC_BITS_SIGSET_T_H"
language = "C"
style = "type"
no_includes = true
cpp_compat = true
[export]
include = ["sigset_t"]
[enum]
prefix_with_name = true
+4
View File
@@ -0,0 +1,4 @@
use crate::platform::types::c_ulonglong;
#[allow(non_camel_case_types)]
pub type sigset_t = c_ulonglong;
+2
View File
@@ -11,6 +11,8 @@ pub mod bits_locale_t;
pub mod bits_pthread;
#[path = "bits_safamily-t/mod.rs"]
pub mod bits_safamily_t;
#[path = "bits_sigset-t/mod.rs"]
pub mod bits_sigset_t;
#[path = "bits_socklen-t/mod.rs"]
pub mod bits_socklen_t;
pub mod bits_timespec;
+1 -1
View File
@@ -7,9 +7,9 @@ use core::{mem, ptr, slice};
use crate::{
fs::File,
header::{
bits_sigset_t::sigset_t,
bits_timespec::timespec,
errno::EBADF,
signal::sigset_t,
sys_epoll::{
EPOLL_CLOEXEC, EPOLL_CTL_ADD, EPOLLERR, EPOLLHUP, EPOLLIN, EPOLLNVAL, EPOLLOUT,
EPOLLPRI, EPOLLRDBAND, EPOLLRDNORM, EPOLLWRBAND, EPOLLWRNORM, epoll_create1, epoll_ctl,
+5 -3
View File
@@ -5,7 +5,9 @@
use core::{mem, ptr, slice};
use crate::{
header::{fcntl, limits, pthread, signal, sys_ioctl, sys_wait, termios, unistd, utmp},
header::{
bits_sigset_t, fcntl, limits, pthread, signal, sys_ioctl, sys_wait, termios, unistd, utmp,
},
platform::{
self,
types::{c_char, c_int, c_void},
@@ -69,8 +71,8 @@ pub unsafe extern "C" fn forkpty(
let mut p: [c_int; 2] = [0; 2];
let mut cs = 0;
let mut pid = -1;
let mut set = signal::sigset_t::default();
let mut oldset = signal::sigset_t::default();
let mut set = bits_sigset_t::sigset_t::default();
let mut oldset = bits_sigset_t::sigset_t::default();
if unsafe { openpty(&raw mut m, &raw mut s, name, tio, ws) } < 0 {
return -1;
+1 -1
View File
@@ -9,6 +9,7 @@
sys_includes = ["sys/types.h"]
include_guard = "_RELIBC_SIGNAL_H"
after_includes = """
#include <bits/sigset-t.h> // for sigset_t
#include <bits/timespec.h> // for timespec from time.h
#define SIG_DFL ((void (*)(int))0)
@@ -17,7 +18,6 @@ after_includes = """
#define SIG_HOLD ((void (*)(int))2)
typedef struct siginfo siginfo_t;
typedef unsigned long long sigset_t;
typedef struct ucontext ucontext_t;
typedef struct mcontext mcontext_t;
typedef long sig_atomic_t;
+1 -3
View File
@@ -8,7 +8,7 @@ use cbitset::BitSet;
use crate::{
error::{Errno, ResultExt},
header::{bits_timespec::timespec, errno, setjmp},
header::{bits_sigset_t::sigset_t, bits_timespec::timespec, errno, setjmp},
platform::{
self, ERRNO, Pal, PalSignal, Sys,
types::{
@@ -102,8 +102,6 @@ pub union sigval {
pub sival_ptr: *mut c_void,
}
/// cbindgen:ignore
pub type sigset_t = c_ulonglong;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/signal.h.html>.
/// cbindgen:ignore
pub type siginfo_t = siginfo;
+1 -1
View File
@@ -6,7 +6,7 @@ use core::ptr;
use crate::{
error::ResultExt,
header::signal::sigset_t,
header::bits_sigset_t::sigset_t,
platform::{
PalEpoll, Sys,
types::{c_int, c_void},
+2 -2
View File
@@ -15,10 +15,12 @@ use crate::{
c_str::CStr,
error::{Errno, ResultExt},
header::{
bits_sigset_t::sigset_t,
bits_timespec::timespec,
crypt::{crypt_data, crypt_r},
errno::{self, ENAMETOOLONG},
fcntl, limits,
signal::{sigprocmask, sigsuspend},
stdlib::getenv,
sys_ioctl, sys_resource,
sys_select::timeval,
@@ -50,8 +52,6 @@ use super::{
stdio::snprintf,
};
use crate::header::signal::{sigprocmask, sigset_t, sigsuspend};
mod brk;
mod getopt;
mod getpass;
+5 -2
View File
@@ -3,8 +3,11 @@ use core::mem;
use super::{Sys, e_raw};
use crate::{
error::Result,
header::{signal::sigset_t, sys_epoll::epoll_event},
platform::{PalEpoll, types::*},
header::{bits_sigset_t::sigset_t, sys_epoll::epoll_event},
platform::{
PalEpoll,
types::{c_int, size_t},
},
};
impl PalEpoll for Sys {
+3 -2
View File
@@ -15,10 +15,11 @@ use crate::header::sys_time::itimerval;
use crate::{
error::{Errno, Result},
header::{
bits_sigset_t::sigset_t,
bits_timespec::timespec,
signal::{
SA_RESTORER, SI_QUEUE, SIGALRM, SIGEV_SIGNAL, sigaction, sigevent, siginfo_t, sigset_t,
sigval, stack_t,
SA_RESTORER, SI_QUEUE, SIGALRM, SIGEV_SIGNAL, sigaction, sigevent, siginfo_t, sigval,
stack_t,
},
time,
},
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::{
error::Result,
header::{signal::sigset_t, sys_epoll::epoll_event},
header::{bits_sigset_t::sigset_t, sys_epoll::epoll_event},
platform::{Pal, types::c_int},
};
+2 -1
View File
@@ -7,8 +7,9 @@ use crate::header::sys_time::itimerval;
use crate::{
error::{Errno, Result},
header::{
bits_sigset_t::sigset_t,
bits_timespec::timespec,
signal::{sigaction, siginfo_t, sigset_t, sigval, stack_t},
signal::{sigaction, siginfo_t, sigval, stack_t},
},
};
+1 -1
View File
@@ -6,7 +6,7 @@ use super::{
use crate::{
error::Errno,
fs::File,
header::{errno::*, fcntl::*, signal::sigset_t, sys_epoll::*},
header::{bits_sigset_t::sigset_t, errno::*, fcntl::*, sys_epoll::*},
io::prelude::*,
};
use core::{mem, slice};
+1 -1
View File
@@ -1,9 +1,9 @@
use core::mem::size_of;
use crate::header::{
bits_sigset_t::sigset_t,
bits_timespec::timespec,
fcntl::{O_CLOEXEC, O_CREAT, O_RDWR},
signal::sigset_t,
};
use super::libredox::RawResult;
+2 -2
View File
@@ -7,12 +7,12 @@ use crate::header::sys_time::{ITIMER_REAL, itimerval};
use crate::{
error::{Errno, Result},
header::{
bits_sigset_t::sigset_t,
bits_timespec::timespec,
errno::{EINVAL, ENOSYS},
signal::{
SIG_BLOCK, SIG_DFL, SIG_IGN, SIG_SETMASK, SIG_UNBLOCK, SIGALRM, SIGEV_SIGNAL,
SS_DISABLE, SS_ONSTACK, sigaction, sigevent, siginfo_t, sigset_t, sigval, stack_t,
ucontext_t,
SS_DISABLE, SS_ONSTACK, sigaction, sigevent, siginfo_t, sigval, stack_t, ucontext_t,
},
time::{itimerspec, timer_internal_t},
},