diff --git a/src/tests/system/libroot/posix/Jamfile b/src/tests/system/libroot/posix/Jamfile index 254a7fde1c..01aae3abc7 100644 --- a/src/tests/system/libroot/posix/Jamfile +++ b/src/tests/system/libroot/posix/Jamfile @@ -25,3 +25,4 @@ SEARCH on [ FGristFiles SubInclude HAIKU_TOP src tests system libroot posix bonnie ; SubInclude HAIKU_TOP src tests system libroot posix math ; +SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite ; diff --git a/src/tests/system/libroot/posix/posixtestsuite/Jamfile b/src/tests/system/libroot/posix/posixtestsuite/Jamfile new file mode 100644 index 0000000000..9a9b52a9ea --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/Jamfile @@ -0,0 +1,3 @@ +SubDir HAIKU_TOP src tests system libroot posix posixtestsuite ; + +SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance ; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/Jamfile b/src/tests/system/libroot/posix/posixtestsuite/conformance/Jamfile new file mode 100644 index 0000000000..187d08451a --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/Jamfile @@ -0,0 +1,3 @@ +SubDir HAIKU_TOP src tests system libroot posix posixtestsuite conformance ; + +SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces ; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/Jamfile b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/Jamfile new file mode 100644 index 0000000000..69d9561dd6 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/Jamfile @@ -0,0 +1,3 @@ +SubDir HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces ; + +SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigprocmask ; diff --git a/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c new file mode 100644 index 0000000000..da5a96a8b6 --- /dev/null +++ b/src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + + Steps: + 1. Set the signal mask to only having SIGABRT. + 2. Call sigprocmask again, this time with a randomly generated value of + how that is checked to make sure it does not equal any of the three defined + values of how which are SIG_SETMASK, SIG_BLOCK, or SIG_UNBLOCK. This should + cause sigprocmask() to return -1. For the second parameter in the sigprocmask() + function, use a set which contains SIGABRT and SIGALRM. + 3. Now verify using the is_changed() function that the only signal that is still + in the signal mask is SIGABRT. Neither SIGALRM nor any other signal should be + in the signal mask of the process. + +*/ + +#include +#include +#include +#include "posixtest.h" + +#define NUMSIGNALS 25 + +int is_changed(sigset_t set) { + + int i; + int siglist[] = {SIGALRM, SIGBUS, SIGCHLD, + SIGCONT, SIGFPE, SIGHUP, SIGILL, SIGINT, + SIGPIPE, SIGQUIT, SIGSEGV, + SIGTERM, SIGTSTP, SIGTTIN, SIGTTOU, + SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, + SIGTRAP, SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ }; + + for (i=0; i +#include +#include "posixtest.h" + +#define NUMSIGNALS 26 + +int is_changed(sigset_t set, int sig) { + + int i; + int siglist[] = {SIGABRT, SIGALRM, SIGBUS, SIGCHLD, + SIGCONT, SIGFPE, SIGHUP, SIGILL, SIGINT, + SIGPIPE, SIGQUIT, SIGSEGV, + SIGTERM, SIGTSTP, SIGTTIN, SIGTTOU, + SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, + SIGTRAP, SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ }; + + if (sigismember(&set, sig) != 1) { + return 1; + } + for (i=0; i +#include +#include "posixtest.h" + +#define NUMSIGNALS 26 + +int is_changed(sigset_t set, int sig) { + + int i; + int siglist[] = {SIGABRT, SIGALRM, SIGBUS, SIGCHLD, + SIGCONT, SIGFPE, SIGHUP, SIGILL, SIGINT, + SIGPIPE, SIGQUIT, SIGSEGV, + SIGTERM, SIGTSTP, SIGTTIN, SIGTTOU, + SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, + SIGTRAP, SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ }; + + if (sigismember(&set, sig) != 1) { + return 1; + } + for (i=0; i +#include +#include "posixtest.h" + +#define NUMSIGNALS 26 + +int is_changed(sigset_t set, int sig) { + + int i; + int siglist[] = {SIGABRT, SIGALRM, SIGBUS, SIGCHLD, + SIGCONT, SIGFPE, SIGHUP, SIGILL, SIGINT, + SIGPIPE, SIGQUIT, SIGSEGV, + SIGTERM, SIGTSTP, SIGTTIN, SIGTTOU, + SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, + SIGTRAP, SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ }; + + if (sigismember(&set, sig) != 1) { + return 1; + } + for (i=0; i