historical/m0-applesillicon.git/xnu-qemu-arm64-5.1.0/tests/tcg/cris/libc/check_sigalrm.c
2024-01-16 11:20:27 -06:00

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