mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-08 04:55:52 +00:00
handlers for SIGKILL or SIGSTOP. This fixes valgrind: vg_signals.c:723 (vgPlain_do__NR_sigaction): Assertion `our_old_handler == ((void *)0)' failed. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@40
36 lines
630 B
C
36 lines
630 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;
|
|
for (i = 1; i <= 64; i++) {
|
|
sa.sa_flags = 0;
|
|
sigemptyset( &sa.sa_mask );
|
|
sa.sa_handler = abend;
|
|
errno = 0;
|
|
fprintf(stderr, "setting signal %d: ", i);
|
|
sigaction (i /*SIGKILL*/, &sa, NULL);
|
|
perror ("");
|
|
errno = 0;
|
|
fprintf(stderr, "getting signal %d: ", i);
|
|
sigaction (i /*SIGKILL*/, NULL, &sa);
|
|
perror ("");
|
|
fprintf(stderr, "\n");
|
|
}
|
|
return 0;
|
|
}
|