summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index f2aec7731..94163fd52 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -813,6 +813,12 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls)
out:
if (locked)
tls->unlock ();
+ if (interrupted && tls->event)
+ {
+ HANDLE h = tls->event;
+ tls->event = NULL;
+ SetEvent (h);
+ }
sigproc_printf ("signal %d %sdelivered", sig, interrupted ? "" : "not ");
return interrupted;
}
@@ -906,6 +912,24 @@ set_process_mask (sigset_t newmask)
set_signal_mask (newmask);
}
+extern "C" int
+sighold (int sig)
+{
+ /* check that sig is in right range */
+ if (sig < 0 || sig >= NSIG)
+ {
+ set_errno (EINVAL);
+ syscall_printf ("signal %d out of range", sig);
+ return -1;
+ }
+ mask_sync->acquire (INFINITE);
+ sigset_t mask = myself->getsigmask ();
+ sigaddset (&mask, sig);
+ set_signal_mask (mask);
+ mask_sync->release ();
+ return 0;
+}
+
/* Set the signal mask for this process.
Note that some signals are unmaskable, as in UNIX. */
extern "C" void __stdcall