diff options
author | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-02-28 11:23:20 +0000 |
---|---|---|
committer | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-02-28 11:23:20 +0000 |
commit | cbdbb7713da116f2ba534470de6707bc0f8cc91b (patch) | |
tree | e25f39f8a74f9bd07c265658a7e5ebc79d8c6d49 /tests/cris/check_sigalrm.c | |
parent | 4f400ab52009ed8f76fa541454a4368f9515f897 (diff) |
Add small testcase for ordinary signals.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3998 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests/cris/check_sigalrm.c')
-rw-r--r-- | tests/cris/check_sigalrm.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/cris/check_sigalrm.c b/tests/cris/check_sigalrm.c new file mode 100644 index 0000000000..39fa8d9bac --- /dev/null +++ b/tests/cris/check_sigalrm.c @@ -0,0 +1,26 @@ +#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; +} |