forked from aquynh/iVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add small testcase for ordinary signals.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3998 c046a42c-6fe2-441c-8c8c-71466251a162
- Loading branch information
edgar_igl
committed
Feb 28, 2008
1 parent
4f400ab
commit cbdbb77
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |