Julian Seward 0356d27ca6 Merge in changes from the 2.4.0 line. This basically brings in the
overhaul of the thread support.  Many things are now probably broken,
but at least with --tool=none, simple and not-so-simple threaded and
non-thread programs work.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3265
2005-03-10 23:59:00 +00:00

43 lines
987 B
C

#include <errno.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
static void
abend (int sig)
{
printf ("Abended on signal %d\n", sig);
exit (2);
}
int
main (void)
{
struct sigaction sa;
int i;
int rc;
for (i = 1; i <= 65; i++) {
// skip signals 63 and 64: some systems say "warning, ignored attempt
// to catch 32 because it's used internally by Valgrind", others say
// "invalid argument".
if (i == 63 || i == 64) {
continue;
} // different systems
sa.sa_flags = 0;
sigemptyset( &sa.sa_mask );
sa.sa_handler = abend;
fprintf(stderr,"setting signal %d: ", i);
rc = sigaction (i /*SIGKILL*/, &sa, NULL);
if (rc) perror ("");
else fprintf(stderr,"Success\n");
fprintf(stderr,"getting signal %d: ", i);
rc = sigaction (i /*SIGKILL*/, NULL, &sa);
if (rc) perror ("");
else fprintf(stderr,"Success\n");
fprintf(stderr,"\n");
}
return 0;
}