diff --git a/src/tests/system/kernel/Jamfile b/src/tests/system/kernel/Jamfile index 3e12e01131..3bd673a37c 100644 --- a/src/tests/system/kernel/Jamfile +++ b/src/tests/system/kernel/Jamfile @@ -53,6 +53,7 @@ SetSupportedPlatformsForTarget set_area_protection_test1 : $(HAIKU_BEOS_COMPATIBLE_PLATFORMS) ; 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 disk_device_manager ; diff --git a/src/tests/system/kernel/sigsuspend_test.cpp b/src/tests/system/kernel/sigsuspend_test.cpp new file mode 100644 index 0000000000..a25e8d6b6d --- /dev/null +++ b/src/tests/system/kernel/sigsuspend_test.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include + + +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; +}