diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2022-03-01 16:14:39 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2022-03-01 16:23:24 +0100 |
commit | 195169186bfd58e45aaa31236575fb9d5957adad (patch) | |
tree | f50db22dce71e5dd9666943b3a4f1db3bba9ecf4 | |
parent | 05e7a60dd7fac7efd1ac792d45377d6971b55e23 (diff) | |
download | newlib-195169186bfd58e45aaa31236575fb9d5957adad.zip newlib-195169186bfd58e45aaa31236575fb9d5957adad.tar.gz newlib-195169186bfd58e45aaa31236575fb9d5957adad.tar.bz2 |
Cygwin: wait_sig: allow to compute process-wide mask of pending signals
Add a signal __SIGPENDINGALL to allow computing the mask of all
currently pending signals.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/sigproc.cc | 20 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.h | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index edfdffd..449777c 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -1371,6 +1371,26 @@ wait_sig (VOID *) case __SIGSTRACE: strace.activate (false); break; + case __SIGPENDINGALL: + { + unsigned bit; + bool issig_wait; + + *pack.mask = 0; + while ((q = q->next)) + { + if (q->sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo))) + { + tl_entry = cygheap->find_tls (q->si.si_signo, issig_wait); + if (tl_entry) + { + *pack.mask |= bit; + cygheap->unlock_tls (tl_entry); + } + } + } + } + break; case __SIGPENDING: { unsigned bit; diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index 2a3d248..23287c8 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -22,7 +22,8 @@ enum __SIGHOLD = -(_NSIG + 7), __SIGNOHOLD = -(_NSIG + 8), __SIGSETPGRP = -(_NSIG + 9), - __SIGTHREADEXIT = -(_NSIG + 10) + __SIGTHREADEXIT = -(_NSIG + 10), + __SIGPENDINGALL = -(_NSIG + 11), }; #endif |