You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/tests/tcg/cris/libc/check_sigalrm.c

27 lines
355 B
C

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#define MAGIC (0xdeadbeef)
int s = 0;
void sighandler(int sig)
{
s = MAGIC;
}
int main(int argc, char **argv)
{
int p;
p = getpid();
signal(SIGALRM, sighandler);
kill(p, SIGALRM);
if (s != MAGIC)
return EXIT_FAILURE;
printf ("passed\n");
return EXIT_SUCCESS;
}