summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/signal.cc
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2017-06-14 10:20:05 -0500
committerYaakov Selkowitz <yselkowi@redhat.com>2017-06-14 14:23:52 -0500
commitdde6af6f82d117532cc8a57f34ccbb52ca3160fa (patch)
tree8c72371339bef911eb50cf430fee33d85631d5ef /winsup/cygwin/signal.cc
parent40ca6f02ed9083890f8e2aecaca7df6e2a72ae7d (diff)
downloadcygnal-dde6af6f82d117532cc8a57f34ccbb52ca3160fa.tar.gz
cygnal-dde6af6f82d117532cc8a57f34ccbb52ca3160fa.tar.bz2
cygnal-dde6af6f82d117532cc8a57f34ccbb52ca3160fa.zip
Export XSI sigpause
There are two common sigpause variants, both of which take an int argument. If you request _XOPEN_SOURCE or _GNU_SOURCE, you get the System V version, which removes the given signal from the process's signal mask; otherwise you get the BSD version, which sets the process's signal mask to the given value. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'winsup/cygwin/signal.cc')
-rw-r--r--winsup/cygwin/signal.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index f371a231b..fbd2b241e 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -524,6 +524,18 @@ sigpause (int signal_mask)
}
extern "C" int
+__xpg_sigpause (int sig)
+{
+ int res;
+ sigset_t signal_mask;
+ sigprocmask (0, NULL, &signal_mask);
+ sigdelset (&signal_mask, sig);
+ res = handle_sigsuspend (signal_mask);
+ syscall_printf ("%R = __xpg_sigpause(%y)", res, sig);
+ return res;
+}
+
+extern "C" int
pause (void)
{
int res = handle_sigsuspend (_my_tls.sigmask);