Mail Archives: cygwin/2012/08/15/01:37:23
--------------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 <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>
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--
- Raw text -