qemu-patch-raspberry4/tests/tcg/cris/check_sigalrm.c
Anthony Liguori c09015dd04 tests: mv tests/* -> tests/tcg
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-12 10:03:28 -06:00

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;
}