Added sigsuspend_test, courtesy of Vasilis Kaoutsis - thanks!
It currently fails on Haiku. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22777 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6e927a5fc0
commit
9121620d41
@ -53,6 +53,7 @@ SetSupportedPlatformsForTarget set_area_protection_test1
|
|||||||
: $(HAIKU_BEOS_COMPATIBLE_PLATFORMS) ;
|
: $(HAIKU_BEOS_COMPATIBLE_PLATFORMS) ;
|
||||||
SimpleTest set_area_protection_test1 : set_area_protection_test1.cpp ;
|
SimpleTest set_area_protection_test1 : set_area_protection_test1.cpp ;
|
||||||
|
|
||||||
|
SimpleTest sigsuspend_test : sigsuspend_test.cpp ;
|
||||||
|
|
||||||
SubInclude HAIKU_TOP src tests system kernel cache ;
|
SubInclude HAIKU_TOP src tests system kernel cache ;
|
||||||
#SubInclude HAIKU_TOP src tests system kernel disk_device_manager ;
|
#SubInclude HAIKU_TOP src tests system kernel disk_device_manager ;
|
||||||
|
34
src/tests/system/kernel/sigsuspend_test.cpp
Normal file
34
src/tests/system/kernel/sigsuspend_test.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
handler(int signal)
|
||||||
|
{
|
||||||
|
printf( "inside handler()\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
struct sigaction signalAction;
|
||||||
|
sigset_t blockedSignalSet;
|
||||||
|
|
||||||
|
sigfillset(&blockedSignalSet);
|
||||||
|
sigdelset(&blockedSignalSet, SIGALRM);
|
||||||
|
|
||||||
|
sigemptyset(&signalAction.sa_mask);
|
||||||
|
signalAction.sa_flags = 0;
|
||||||
|
signalAction.sa_handler = handler;
|
||||||
|
sigaction(SIGALRM, &signalAction, NULL);
|
||||||
|
|
||||||
|
fprintf(stdout, "before sigsuspend()\n");
|
||||||
|
alarm(2);
|
||||||
|
sigsuspend(&blockedSignalSet);
|
||||||
|
fprintf(stdout, "after sigsuspend()\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user