Skip to content

Commit 707294d

Browse files
committed
Signal controlling constants for windows
SIG_DFL and similar. Closes #1600.
1 parent 5d2c3a4 commit 707294d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

libc-test/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,9 @@ fn test_windows(target: &str) {
583583
match name {
584584
// FIXME: API error:
585585
// SIG_ERR type is "void (*)(int)", not "int"
586-
"SIG_ERR" => true,
586+
"SIG_ERR" |
587+
// Similar for SIG_DFL/IGN/GET/SGE/ACK
588+
"SIG_DFL" | "SIG_IGN" | "SIG_GET" | "SIG_SGE" | "SIG_ACK" => true,
587589
// FIXME: newer windows-gnu environment on CI?
588590
"_O_OBTAIN_DIR" if gnu => true,
589591
_ => false,

libc-test/semver/windows.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ SIGILL
123123
SIGINT
124124
SIGSEGV
125125
SIGTERM
126+
SIG_ACK
127+
SIG_DFL
126128
SIG_ERR
129+
SIG_GET
130+
SIG_IGN
131+
SIG_SGE
127132
SOCKET
128133
STRUNCATE
129134
S_IEXEC

src/windows/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,13 @@ pub const SIGSEGV: ::c_int = 11;
244244
pub const SIGTERM: ::c_int = 15;
245245
pub const SIGABRT: ::c_int = 22;
246246
pub const NSIG: ::c_int = 23;
247+
247248
pub const SIG_ERR: ::c_int = -1;
249+
pub const SIG_DFL: ::sighandler_t = 0;
250+
pub const SIG_IGN: ::sighandler_t = 1;
251+
pub const SIG_GET: ::sighandler_t = 2;
252+
pub const SIG_SGE: ::sighandler_t = 3;
253+
pub const SIG_ACK: ::sighandler_t = 4;
248254

249255
// inline comment below appeases style checker
250256
#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if "

0 commit comments

Comments
 (0)