summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-01 23:33:19 +0000
committerbors <bors@rust-lang.org>2021-06-01 23:33:19 +0000
commit4952853f4e3418c237aab3c1b58d22baa069e97d (patch)
treeb15edbe9d815bbc4ccdea05ccf380a7a9fd188b1
parent2fc433a587bd00cd1b2f5814da38f53eb2590439 (diff)
parent707294d2b678d9cdea975d4e7f9d94b03cccdab5 (diff)
downloadrust-libc-4952853f4e3418c237aab3c1b58d22baa069e97d.tar.gz
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.
-rwxr-xr-xlibc-test/build.rs4
-rw-r--r--libc-test/semver/windows.txt5
-rw-r--r--src/windows/mod.rs6
3 files changed, 14 insertions, 1 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 76938e0ae0..653b83164e 100755
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -585,7 +585,9 @@ fn test_windows(target: &str) {
match name {
// FIXME: API error:
// SIG_ERR type is "void (*)(int)", not "int"
- "SIG_ERR" => true,
+ "SIG_ERR" |
+ // Similar for SIG_DFL/IGN/GET/SGE/ACK
+ "SIG_DFL" | "SIG_IGN" | "SIG_GET" | "SIG_SGE" | "SIG_ACK" => true,
// FIXME: newer windows-gnu environment on CI?
"_O_OBTAIN_DIR" if gnu => true,
_ => false,
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
index eaa7790898..1f66d622eb 100644
--- a/libc-test/semver/windows.txt
+++ b/libc-test/semver/windows.txt
@@ -123,7 +123,12 @@ SIGILL
SIGINT
SIGSEGV
SIGTERM
+SIG_ACK
+SIG_DFL
SIG_ERR
+SIG_GET
+SIG_IGN
+SIG_SGE
SOCKET
STRUNCATE
S_IEXEC
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index 377a6c75f9..ad0dc77d23 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -244,7 +244,13 @@ pub const SIGSEGV: ::c_int = 11;
pub const SIGTERM: ::c_int = 15;
pub const SIGABRT: ::c_int = 22;
pub const NSIG: ::c_int = 23;
+
pub const SIG_ERR: ::c_int = -1;
+pub const SIG_DFL: ::sighandler_t = 0;
+pub const SIG_IGN: ::sighandler_t = 1;
+pub const SIG_GET: ::sighandler_t = 2;
+pub const SIG_SGE: ::sighandler_t = 3;
+pub const SIG_ACK: ::sighandler_t = 4;
// inline comment below appeases style checker
#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if "