From: Garrett C. <ris...@li...> - 2010-07-11 03:56:48
|
The branch, master, has been updated via 88cc8f1cd411cd787ccb09f5dcdca81ce6be6389 (commit) via 50e63b3434fec6e7193ed2710df2af393ba911bb (commit) via 6b6f81b02cbd9b4c7507af6b6aec6980c2eb257d (commit) via 26b17d17e4d1df59ea3b70f72d194e87dafafaa3 (commit) via 0554dd8ef784c223f74e14de513b1752a9949dae (commit) from 5a8278a619f323b252b5a816fabdc997ae688c15 (commit) - Log ----------------------------------------------------------------- commit 88cc8f1cd411cd787ccb09f5dcdca81ce6be6389 Author: Garrett Cooper <yan...@gm...> Date: Sat Jul 10 20:54:11 2010 -0700 Clean up headers and whitespace. Signed-off-by: Garrett Cooper <yan...@gm...> commit 50e63b3434fec6e7193ed2710df2af393ba911bb Author: Garrett Cooper <yan...@gm...> Date: Sat Jul 10 20:46:15 2010 -0700 Update FreeBSD configuration documentation. Add notes about aio_* syscalls on FreeBSD, and fix the mqueue notes as the name of the kernel module wasn't a 1:1 match with the directory name under /sys/modules/... Signed-off-by: Garrett Cooper <yan...@gm...> commit 6b6f81b02cbd9b4c7507af6b6aec6980c2eb257d Author: Garrett Cooper <yan...@gm...> Date: Sat Jul 10 20:43:14 2010 -0700 Check for support w/ sysconf(_SC_ASYNCHRONOUS_IO). Checking for a preprocessor define is very Linux centric (apparently), as FreeBSD states in sys/unistd.h: * Anything which is defined as zero below **must** have an * implementation for the corresponding sysconf() which is able to * determine conclusively whether or not the feature is supported. * Anything which is defined as other than -1 below **must** have * complete headers, types, and function declarations as specified by * the POSIX standard; however, if the relevant sysconf() function * returns -1, the functions may be stubbed out. This is done most likely done to ensure that runtime enabled functionality via kernel modules is properly queried. Signed-off-by: Garrett Cooper <yan...@gm...> commit 26b17d17e4d1df59ea3b70f72d194e87dafafaa3 Author: Garrett Cooper <yan...@gm...> Date: Sat Jul 10 18:45:23 2010 -0700 Fix alignment as per posixtest HEAD. Signed-off-by: Garrett Cooper <yan...@gm...> commit 0554dd8ef784c223f74e14de513b1752a9949dae Author: Garrett Cooper <yan...@gm...> Date: Sat Jul 10 18:38:19 2010 -0700 Commit fixes from posixtest CVS HEAD. Minor formatting fixes, but basically untainted. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: testcases/open_posix_testsuite/BUILD | 13 ++++++++++++- .../definitions/sched_h/3-1-buildonly.c | 2 +- .../definitions/sched_h/4-1-buildonly.c | 2 +- .../definitions/sched_h/8-3-buildonly.c | 7 +++++++ .../conformance/interfaces/clock_gettime/3-1.c | 8 ++++---- .../conformance/interfaces/lio_listio/1-1.c | 5 ++--- .../conformance/interfaces/lio_listio/10-1.c | 5 ++--- .../conformance/interfaces/lio_listio/11-1.c | 7 +++---- .../conformance/interfaces/lio_listio/12-1.c | 6 ++---- .../conformance/interfaces/lio_listio/13-1.c | 5 ++--- .../conformance/interfaces/lio_listio/14-1.c | 17 +++++++++++------ .../conformance/interfaces/lio_listio/15-1.c | 5 ++--- .../conformance/interfaces/lio_listio/16-1.c | 8 ++------ .../conformance/interfaces/lio_listio/17-1.c | 6 ++---- .../conformance/interfaces/lio_listio/18-1.c | 5 ++--- .../conformance/interfaces/lio_listio/19-1.c | 8 ++------ .../conformance/interfaces/lio_listio/2-1.c | 5 ++--- .../conformance/interfaces/lio_listio/20-1.c | 12 ++++-------- .../conformance/interfaces/lio_listio/21-1.c | 12 ++++-------- .../conformance/interfaces/lio_listio/22-1.c | 12 ++++-------- .../conformance/interfaces/lio_listio/23-1.c | 12 ++++-------- .../conformance/interfaces/lio_listio/24-1.c | 12 ++++-------- .../conformance/interfaces/lio_listio/25-1.c | 12 ++++-------- .../conformance/interfaces/lio_listio/3-1.c | 5 ++--- .../conformance/interfaces/lio_listio/4-1.c | 5 ++--- .../conformance/interfaces/lio_listio/5-1.c | 19 ++++++++----------- .../conformance/interfaces/lio_listio/6-1.c | 6 +++--- .../conformance/interfaces/lio_listio/7-1.c | 5 ++--- .../conformance/interfaces/lio_listio/8-1.c | 5 ++--- .../conformance/interfaces/lio_listio/9-1.c | 5 ++--- .../interfaces/sched_setscheduler/1-1.c | 5 +++-- .../interfaces/sched_setscheduler/10-1.c | 16 +++++----------- .../interfaces/sched_setscheduler/11-1.c | 17 +++++------------ .../interfaces/sched_setscheduler/17-1.c | 4 ++-- .../interfaces/sched_setscheduler/17-2.c | 4 ++-- .../interfaces/sched_setscheduler/17-3.c | 3 ++- .../interfaces/sched_setscheduler/17-4.c | 4 ++-- .../interfaces/sched_setscheduler/19-1.c | 4 ++-- .../interfaces/sched_setscheduler/19-2.c | 3 +-- .../interfaces/sched_setscheduler/19-3.c | 5 ++--- .../interfaces/sched_setscheduler/19-4.c | 4 ++-- 41 files changed, 132 insertions(+), 173 deletions(-) diff --git a/testcases/open_posix_testsuite/BUILD b/testcases/open_posix_testsuite/BUILD index 1c31f31..c53db90 100644 --- a/testcases/open_posix_testsuite/BUILD +++ b/testcases/open_posix_testsuite/BUILD @@ -22,13 +22,24 @@ FREEBSD ======= ================ +Asynchronous I/O +================ +Realtime asynchronous I/O has been available in FreeBSD since 5.x. Please add: + +options VFS_AIO + +to your kernel conf or build, install, and load the aio module. + +================ Message Queues ================ POSIX message queues have been available in FreeBSD since 6.x. Please add: options P1003_1B_MQUEUE -to your kernel conf or build, install, and load the mqueue module. +to your kernel conf or build and install the mqueue module, and load it with: + +kldload mqueuefs ================ Realtime Support diff --git a/testcases/open_posix_testsuite/conformance/definitions/sched_h/3-1-buildonly.c b/testcases/open_posix_testsuite/conformance/definitions/sched_h/3-1-buildonly.c index 06f500a..6054eca 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/sched_h/3-1-buildonly.c +++ b/testcases/open_posix_testsuite/conformance/definitions/sched_h/3-1-buildonly.c @@ -18,7 +18,7 @@ #include <sched.h> #include <unistd.h> -#ifdef _POSIX_SPORADIC_SERVER +#if defined(_POSIX_SPORADIC_SERVER) && _POSIX_SPORADIC_SERVER != -1 struct sched_param s; diff --git a/testcases/open_posix_testsuite/conformance/definitions/sched_h/4-1-buildonly.c b/testcases/open_posix_testsuite/conformance/definitions/sched_h/4-1-buildonly.c index 7a5de7f..e9bb17c 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/sched_h/4-1-buildonly.c +++ b/testcases/open_posix_testsuite/conformance/definitions/sched_h/4-1-buildonly.c @@ -18,7 +18,7 @@ #include <sched.h> #include <unistd.h> -#ifdef _POSIX_THREAD_SPORADIC_SERVER +#if defined(_POSIX_SPORADIC_SERVER) && _POSIX_SPORADIC_SERVER != -1 struct sched_param s; diff --git a/testcases/open_posix_testsuite/conformance/definitions/sched_h/8-3-buildonly.c b/testcases/open_posix_testsuite/conformance/definitions/sched_h/8-3-buildonly.c index 8dde471..83b06da 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/sched_h/8-3-buildonly.c +++ b/testcases/open_posix_testsuite/conformance/definitions/sched_h/8-3-buildonly.c @@ -14,7 +14,14 @@ */ #include <sched.h> +#include <unistd.h> + +#if (defined(_POSIX_SPORADIC_SERVER) && _POSIX_SPORADIC_SERVER != -1) \ + || (defined(_POSIX_THREAD_SPORADIC_SERVER) && \ + POSIX_THREAD_SPORADIC_SERVER != -1) #ifndef SCHED_SPORADIC #error SCHED_SPORADIC not defined #endif + +#endif diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c index d8b1271..73b0da1 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c @@ -20,14 +20,14 @@ int main(int argc, char *argv[]) { #ifdef CLOCK_MONOTONIC + struct timespec ts1, ts2, ts3, ts4; + /* Test that MONOTONIC CLOCK functionality really exists */ - if(sysconf(_SC_MONOTONIC_CLOCK) == -1) - { + if(sysconf(_SC_MONOTONIC_CLOCK) == -1) + { printf("CLOCK_MONOTONIC unsupported\n"); return PTS_UNSUPPORTED; } - - struct timespec ts1, ts2, ts3, ts4; if (clock_gettime(CLOCK_MONOTONIC, &ts1) != 0) { printf("clock_gettime() failed\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c index 0fd71c7..f19fcd3 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c @@ -67,9 +67,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_1_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c index 4b25669..ace94ab 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c @@ -66,9 +66,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_10_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/11-1.c index ca5be00..216f3b8 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/11-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/11-1.c @@ -66,9 +66,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_11_1_%d", getpid()); @@ -145,7 +144,7 @@ int main() } if (errno != EIO) { - printf(TNAME " lio_listio() sould set errno to EIO %d\n", errno); + printf(TNAME " lio_listio() should set errno to EIO %d\n", errno); for (i=0; i<NUM_AIOCBS; i++) free (aiocbs[i]); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c index 5dfc989..4539fdc 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c @@ -29,7 +29,6 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> - #include "posixtest.h" #define TNAME "lio_listio/12-1.c" @@ -49,9 +48,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_12_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c index c948381..a502ea9 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c @@ -48,9 +48,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_13_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c index 7e46612..a5e7614 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c @@ -66,9 +66,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_14_1_%d", getpid()); @@ -95,8 +94,14 @@ int main() /* Queue up a bunch of aio writes */ for (i = 0; i < NUM_AIOCBS; i++) { - aiocbs[i] = (struct aiocb *)malloc(sizeof(struct aiocb)); - memset(aiocbs[i], 0, sizeof(struct aiocb)); + aiocbs[i] = (struct aiocb *)calloc(sizeof(struct aiocb), 1); + if (aiocbs == NULL) { + printf (TNAME " Error at malloc(): %s\n", + strerror (errno)); + free(bufs); + close (fd); + exit(PTS_UNRESOLVED); + } if (i == 2) aiocbs[i]->aio_fildes = -1; @@ -147,7 +152,7 @@ int main() while (received_all == 0) sleep (1); - if (num_received != NUM_AIOCBS-1) { + if (num_received != NUM_AIOCBS) { printf(TNAME " Error incomplete number of completed requests\n"); for (i=0; i<NUM_AIOCBS; i++) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c index 8e0b68d..bacfeac 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c @@ -66,9 +66,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_15_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c index 6843b91..407c396 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c @@ -20,17 +20,13 @@ */ #define _XOPEN_SOURCE 600 -#include <aio.h> -#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "posixtest.h" int main(void) { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#else + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); exit(PTS_UNTESTED); -#endif } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c index 57508a8..1a89500 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c @@ -15,9 +15,7 @@ int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#else + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); exit(PTS_UNTESTED); -#endif } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c index 869397f..26631b7 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c @@ -46,9 +46,8 @@ int main() char *bufs; int ret; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_18_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c index 09e14d1..b1673b2 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c @@ -7,17 +7,13 @@ */ #define _XOPEN_SOURCE 600 -#include <aio.h> -#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "posixtest.h" int main(void) { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#else + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); exit(PTS_UNTESTED); -#endif } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c index a5b5b7f..d174585 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c @@ -65,9 +65,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_2_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c index c079c7d..a7aa26a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c @@ -7,17 +7,13 @@ */ #define _XOPEN_SOURCE 600 -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> -#include <aio.h> - #include "posixtest.h" int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif - - return PTS_UNTESTED; + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); + exit(PTS_UNTESTED); } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c index c079c7d..a7aa26a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c @@ -7,17 +7,13 @@ */ #define _XOPEN_SOURCE 600 -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> -#include <aio.h> - #include "posixtest.h" int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif - - return PTS_UNTESTED; + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); + exit(PTS_UNTESTED); } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c index c079c7d..a7aa26a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c @@ -7,17 +7,13 @@ */ #define _XOPEN_SOURCE 600 -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> -#include <aio.h> - #include "posixtest.h" int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif - - return PTS_UNTESTED; + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); + exit(PTS_UNTESTED); } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c index c079c7d..a7aa26a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c @@ -7,17 +7,13 @@ */ #define _XOPEN_SOURCE 600 -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> -#include <aio.h> - #include "posixtest.h" int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif - - return PTS_UNTESTED; + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); + exit(PTS_UNTESTED); } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c index c079c7d..a7aa26a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c @@ -7,17 +7,13 @@ */ #define _XOPEN_SOURCE 600 -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> -#include <aio.h> - #include "posixtest.h" int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif - - return PTS_UNTESTED; + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); + exit(PTS_UNTESTED); } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c index c079c7d..a7aa26a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c @@ -7,17 +7,13 @@ */ #define _XOPEN_SOURCE 600 -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> -#include <aio.h> - #include "posixtest.h" int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif - - return PTS_UNTESTED; + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); + exit(PTS_UNTESTED); } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c index cee9869..1ceb7de 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c @@ -66,9 +66,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_3_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c index 922830c..6745660 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c @@ -66,9 +66,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_4_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c index 8367e4d..3a46ced 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c @@ -23,16 +23,15 @@ */ #define _XOPEN_SOURCE 600 -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> #include <sys/stat.h> -#include <fcntl.h> -#include <string.h> +#include <sys/types.h> +#include <aio.h> #include <errno.h> +#include <fcntl.h> +#include <stdio.h> #include <stdlib.h> -#include <aio.h> - +#include <string.h> +#include <unistd.h> #include "posixtest.h" #define NUM_AIOCBS 3 @@ -52,10 +51,8 @@ int main() int err; int i; - -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_4_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c index d40e996..29dd804 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c @@ -34,9 +34,9 @@ int main() { -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); #ifndef LIO_READ printf(TNAME " LIO_READ not defined\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c index 513ffe5..f5a71f7 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c @@ -67,9 +67,8 @@ int main() int err; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_4_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c index cad47b4..18ec827 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c @@ -48,9 +48,8 @@ int main() int err; int ret; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_8_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c index f477fcf..9689a6a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c @@ -48,9 +48,8 @@ int main() int ret; int i; -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif + if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L) + exit(PTS_UNSUPPORTED); snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_lio_listio_9_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c index 073db70..54fa9ec 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/1-1.c @@ -15,10 +15,11 @@ * For all policy describe in the spec, the test will check the policy and the * param of the process after the call of sched_setscheduler. */ -#include <sched.h> + #include <errno.h> -#include <unistd.h> +#include <sched.h> #include <stdio.h> +#include <unistd.h> #include "posixtest.h" struct unique { diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/10-1.c index 9e86025..f4e4c85 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/10-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/10-1.c @@ -14,20 +14,14 @@ * @pt:SS */ -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -#ifdef _POSIX_SPORADIC_SERVER int main() { - printf("Not yet tested.\n"); - return PTS_UNTESTED; -} - +#if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) + exit(PTS_UNSUPPORTED); #else -int main() { - printf("Does not support SS (SPORADIC SERVER)\n"); - return PTS_UNSUPPORTED; -} - + exit(PTS_UNTESTED); #endif +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/11-1.c index 17ffcf9..c245fab 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/11-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/11-1.c @@ -11,25 +11,18 @@ * sched_ss_init_budget members of the param argument have no effect on the * scheduling behavior if the scheduling policy of the target process is either * SCHED_FIFO or SCHED_RR. - * * @pt:SS */ -#include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include "posixtest.h" -#ifdef _POSIX_SPORADIC_SERVER int main() { - printf("Not yet tested.\n"); - return PTS_UNTESTED; -} - +#if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) + exit(PTS_UNSUPPORTED); #else -int main() { - printf("Does not support SS (SPORADIC SERVER)\n"); - return PTS_UNSUPPORTED; -} - + exit(PTS_UNTESTED); #endif +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c index 73393bd..ca0b45a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-1.c @@ -18,10 +18,11 @@ * 2. Call sched_setscheduler with invalid args. * 3. Check that the policy and priority have not changed. */ + +#include <errno.h> #include <sched.h> #include <stdio.h> #include <unistd.h> -#include <errno.h> #include "posixtest.h" struct unique { @@ -121,4 +122,3 @@ int main(){ } return result; } - diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c index ae3c230..8f429a2 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-2.c @@ -19,13 +19,13 @@ * * @pt:SS */ + +#include <errno.h> #include <sched.h> #include <stdio.h> -#include <errno.h> #include <unistd.h> #include "posixtest.h" - #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) int main(){ diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c index 9198bec..4cc77a4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-3.c @@ -19,9 +19,10 @@ * * @pt:SS */ + +#include <errno.h> #include <sched.h> #include <stdio.h> -#include <errno.h> #include <unistd.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c index d36b05b..49ab0b7 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-4.c @@ -19,13 +19,13 @@ * * @pt:SS */ + +#include <errno.h> #include <sched.h> #include <stdio.h> -#include <errno.h> #include <unistd.h> #include "posixtest.h" - #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) int main(){ diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c index 1d247a7..84075cc 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-1.c @@ -13,10 +13,11 @@ * * Test is done for all policy defined in the spec into a loop. */ + +#include <errno.h> #include <sched.h> #include <stdio.h> #include <unistd.h> -#include <errno.h> #include "posixtest.h" struct unique { @@ -92,4 +93,3 @@ int main(){ } return result; } - diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c index 04f5caa..674b7ae 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-2.c @@ -15,10 +15,9 @@ * @pt:SS */ - +#include <errno.h> #include <sched.h> #include <stdio.h> -#include <errno.h> #include "posixtest.h" #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c index 3a46ce3..f10ed89 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-3.c @@ -14,14 +14,13 @@ * * @pt:SS */ + +#include <errno.h> #include <sched.h> #include <stdio.h> -#include <errno.h> #include <unistd.h> #include "posixtest.h" - - #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) int main(){ diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c index 9f92b2c..cc6c874 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/19-4.c @@ -15,13 +15,13 @@ * * @pt:SS */ + +#include <errno.h> #include <sched.h> #include <stdio.h> -#include <errno.h> #include <unistd.h> #include "posixtest.h" - #if defined(_POSIX_SPORADIC_SERVER)&&(_POSIX_SPORADIC_SERVER != -1) int main(){ hooks/post-receive -- ltp |