From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id B36583858C83; Tue, 1 Mar 2022 15:24:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B36583858C83 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: wait_sig: allow to compute process-wide mask of pending signals X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 05e7a60dd7fac7efd1ac792d45377d6971b55e23 X-Git-Newrev: 195169186bfd58e45aaa31236575fb9d5957adad Message-Id: <20220301152440.B36583858C83@sourceware.org> Date: Tue, 1 Mar 2022 15:24:40 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2022 15:24:40 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D195169186bf= d58e45aaa31236575fb9d5957adad commit 195169186bfd58e45aaa31236575fb9d5957adad Author: Corinna Vinschen Date: Tue Mar 1 16:14:39 2022 +0100 Cygwin: wait_sig: allow to compute process-wide mask of pending signals =20 Add a signal __SIGPENDINGALL to allow computing the mask of all currently pending signals. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/sigproc.cc | 20 ++++++++++++++++++++ winsup/cygwin/sigproc.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index edfdffd7c..449777cda 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 =3D 0; + while ((q =3D q->next)) + { + if (q->sigtls->sigmask & (bit =3D SIGTOMASK (q->si.si_signo))) + { + tl_entry =3D cygheap->find_tls (q->si.si_signo, issig_wait); + if (tl_entry) + { + *pack.mask |=3D bit; + cygheap->unlock_tls (tl_entry); + } + } + } + } + break; case __SIGPENDING: { unsigned bit; diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index 2a3d248d1..23287c85b 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -22,7 +22,8 @@ enum __SIGHOLD =3D -(_NSIG + 7), __SIGNOHOLD =3D -(_NSIG + 8), __SIGSETPGRP =3D -(_NSIG + 9), - __SIGTHREADEXIT =3D -(_NSIG + 10) + __SIGTHREADEXIT =3D -(_NSIG + 10), + __SIGPENDINGALL =3D -(_NSIG + 11), }; #endif