Skip to content

Commit 6b0224e

Browse files
committed
Auto merge of #2201 - vorner:winsig, r=JohnTitor
Signal controlling constants for windows This is replacement of #1626, because I have lost the repository with that branch in the meantime. The content is the same (unless I've made some mistake copying it over), just rebased onto current master.
2 parents 86dff58 + 707294d commit 6b0224e

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
@@ -585,7 +585,9 @@ fn test_windows(target: &str) {
585585
match name {
586586
// FIXME: API error:
587587
// SIG_ERR type is "void (*)(int)", not "int"
588-
"SIG_ERR" => true,
588+
"SIG_ERR" |
589+
// Similar for SIG_DFL/IGN/GET/SGE/ACK
590+
"SIG_DFL" | "SIG_IGN" | "SIG_GET" | "SIG_SGE" | "SIG_ACK" => true,
589591
// FIXME: newer windows-gnu environment on CI?
590592
"_O_OBTAIN_DIR" if gnu => true,
591593
_ => 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)