Skip to content

Commit eb97186

Browse files
fiveopcarllerche
authored andcommitted
add NSIG constant
glibc defines this constant as "the total number of signals defined. Since the signal numbers are allocated consecutively, NSIG is also one greater than the largest defined signal number."
1 parent 1164ea7 commit eb97186

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/sys/signal.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ pub use self::signal::{
4141
SIGWINCH,
4242
SIGUSR1,
4343
SIGUSR2,
44+
45+
NSIG,
4446
};
4547

4648
pub use self::signal::SockFlag;
@@ -102,6 +104,8 @@ pub mod signal {
102104
pub const SIGSYS: libc::c_int = 31;
103105
pub const SIGUNUSED: libc::c_int = 31;
104106

107+
pub const NSIG: libc::c_int = 32;
108+
105109
// This definition is not as accurate as it could be, {pid, uid, status} is
106110
// actually a giant union. Currently we're only interested in these fields,
107111
// however.
@@ -188,6 +192,8 @@ pub mod signal {
188192
pub const SIGXCPU: libc::c_int = 30;
189193
pub const SIGFSZ: libc::c_int = 31;
190194

195+
pub const NSIG: libc::c_int = 32;
196+
191197
// This definition is not as accurate as it could be, {pid, uid, status} is
192198
// actually a giant union. Currently we're only interested in these fields,
193199
// however.
@@ -266,6 +272,8 @@ pub mod signal {
266272
pub const SIGUSR1: libc::c_int = 30;
267273
pub const SIGUSR2: libc::c_int = 31;
268274

275+
pub const NSIG: libc::c_int = 32;
276+
269277
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "openbsd"))]
270278
pub type sigset_t = u32;
271279
#[cfg(target_os = "freebsd")]

0 commit comments

Comments
 (0)