diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-03-22 17:31:38 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-03-22 17:31:38 +0000 |
commit | 1b6b029e40c4297ce9c27e0f8b8ae177085c990a (patch) | |
tree | ffcae72b2e16e395ec983f3718adcf9a981b9a66 /tests/testsig.c | |
parent | 612384d77146639cebdc9b71c87ee4a94bf44501 (diff) |
basic clone() support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@40 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests/testsig.c')
-rw-r--r-- | tests/testsig.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/testsig.c b/tests/testsig.c new file mode 100644 index 0000000000..59af54fc8e --- /dev/null +++ b/tests/testsig.c @@ -0,0 +1,24 @@ +#include <stdlib.h> +#include <stdio.h> +#include <signal.h> +#include <unistd.h> + +void alarm_handler(int sig) +{ + printf("alarm signal=%d\n", sig); + alarm(1); +} + +int main(int argc, char **argv) +{ + struct sigaction act; + act.sa_handler = alarm_handler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + sigaction(SIGALRM, &act, NULL); + alarm(1); + for(;;) { + sleep(1); + } + return 0; +} |