From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23508 invoked by alias); 15 Aug 2012 05:37:11 -0000 Received: (qmail 23329 invoked by uid 22791); 15 Aug 2012 05:37:09 -0000 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 Received: from dancol.org (HELO dancol.org) (96.126.100.184) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Aug 2012 05:36:55 +0000 Received: from c-76-22-66-162.hsd1.wa.comcast.net ([76.22.66.162] helo=[0.0.0.0]) by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1T1WHn-000798-37 for cygwin@cygwin.com; Tue, 14 Aug 2012 22:36:55 -0700 Message-ID: <502B3567.9090808@dancol.org> Date: Wed, 15 Aug 2012 08:04:00 -0000 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@cygwin.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@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-08/txt/msg00343.txt.bz2 --------------enig4C7DECCC182030B47AE561E6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 1243 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" Content-length: 259 -----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--