X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <502B3567.9090808@dancol.org> Date: Tue, 14 Aug 2012 22:36:39 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Another sigwaitinfo problem (with testcase) Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4C7DECCC182030B47AE561E6" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enig4C7DECCC182030B47AE561E6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable When run on a Linux machine, this program starts up and blocks on sigwaitin= fo. You can suspend and resume the program using usual job control facilities, = and on SIGINT, the program prints a message and exits. When the program resumes after being stopped, it prints "resumed". With the 2012-08-07 Cygwin snapshot, this program prints "resumed" immediat= ely after receiving SIGTSTP, then fails to respond to any signal, even signals = not in the blocked set. A simpler test program that just calls "raise (SIGSTOP)" property stops itself before resuming execution. #define _GNU_SOURCE 1 #include #include #include #include #include int main() { sigset_t waitmask; int sig; sigemptyset (&waitmask); sigaddset (&waitmask, SIGTSTP); sigaddset (&waitmask, SIGINT); sigprocmask (SIG_BLOCK, &waitmask, NULL); for (;;) { sig =3D sigwaitinfo (&waitmask, NULL); fprintf (stderr, "got %s\n", sys_siglist[sig]); if (sig =3D=3D SIGTSTP) { raise (SIGSTOP); /* Block until somebody resumes us. */ } else if (sig =3D=3D SIGINT) { fprintf(stderr, "exiting"); break; } } return 0; } --------------enig4C7DECCC182030B47AE561E6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlArNWoACgkQ17c2LVA10Vt4FACfY8RK1y+2K5FI7VtJzpV33AcB u8sAnjrPY9URb8D+WIvv66yVmI9FCirp =t8r3 -----END PGP SIGNATURE----- --------------enig4C7DECCC182030B47AE561E6--