From: Garrett C. <ris...@li...> - 2010-07-05 22:45:54
|
The branch, pu, has been updated via 070138c410944469346ff6823fc3df58a5e2da6f (commit) via d212516229b8a41d4302620da4a3511b333ed2e5 (commit) via 096c450506ad0f50352a3c8b43de9c1538295d82 (commit) via 85d7f26c7eb5994d4dabdb05998c90d86d7baa46 (commit) via 0414c8fbabd00c4e1df589aa13d995c91c8736ec (commit) from 0894865a51d30399e62a20349061112deaa4b4f6 (commit) - Log ----------------------------------------------------------------- commit 070138c410944469346ff6823fc3df58a5e2da6f Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 14:46:38 2010 -0700 Improve wording. Signed-off-by: Garrett Cooper <yan...@gm...> commit d212516229b8a41d4302620da4a3511b333ed2e5 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 14:45:01 2010 -0700 Get the compile to pass. The run will fail, but that's ok. Signed-off-by: Garrett Cooper <yan...@gm...> commit 096c450506ad0f50352a3c8b43de9c1538295d82 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 14:24:59 2010 -0700 Remove dead code. Signed-off-by: Garrett Cooper <yan...@gm...> commit 85d7f26c7eb5994d4dabdb05998c90d86d7baa46 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 14:21:03 2010 -0700 Make 2-2-buildonly less strict on #defines. Signed-off-by: Garrett Cooper <yan...@gm...> commit 0414c8fbabd00c4e1df589aa13d995c91c8736ec Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 14:09:03 2010 -0700 Properly conditionalize XSR constants. These are optional as per POSIX spec. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../definitions/errno_h/3-1-buildonly.c | 16 +++++- .../conformance/definitions/errno_h/3-2.c | 12 +++- .../conformance/definitions/errno_h/4-1.c | 12 +++- .../conformance/definitions/errno_h/assertions.xml | 4 + .../definitions/pthread_h/2-2-buildonly.c | 61 ++++++------------- .../conformance/interfaces/aio_fsync/2-1.c | 15 ++++- .../stress/threads/fork/s-c1.c | 1 - 7 files changed, 69 insertions(+), 52 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1-buildonly.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1-buildonly.c index ed1c519..7d9cb9c 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1-buildonly.c +++ b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1-buildonly.c @@ -1,6 +1,8 @@ /* - *Following symbols need to be defined in errno.h - *author:ys...@ln... + * Following symbols need to be defined in errno.h + * author:ys...@ln... + * + * All #ifdef'ed constants are optional, depending on the spec definition. */ #include <errno.h> @@ -13,7 +15,9 @@ int dummy5 = EAFNOSUPPORT; int dummy6 = EAGAIN; int dummy7 = EALREADY; int dummy8 = EBADF; +#ifdef EBADMSG int dummy9 = EBADMSG; +#endif int dummy10 = EBUSY; int dummy11 = ECANCELED; int dummy12 = ECHILD; @@ -47,7 +51,9 @@ int dummy39 = ENETRESET; int dummy40 = ENETUNREACH; int dummy41 = ENFILE; int dummy42 = ENOBUFS; +#ifdef ENODATA int dummy43 = ENODATA; +#endif int dummy44 = ENODEV; int dummy45 = ENOENT; int dummy46 = ENOEXEC; @@ -57,8 +63,12 @@ int dummy49 = ENOMEM; int dummy50 = ENOMSG; int dummy51 = ENOPROTOOPT; int dummy52 = ENOSPC; +#ifdef ENOSR int dummy53 = ENOSR; +#endif +#ifdef ENOSTR int dummy54 = ENOSTR; +#endif int dummy55 = ENOSYS; int dummy56 = ENOTCONN; int dummy57 = ENOTDIR; @@ -79,7 +89,9 @@ int dummy71 = EROFS; int dummy72 = ESPIPE; int dummy73 = ESRCH; int dummy74 = ESTALE; +#ifdef ETIME int dummy75 = ETIME; +#endif int dummy76 = ETIMEDOUT; int dummy77 = ETXTBSY; int dummy78 = EWOULDBLOCK; diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c index 35d056d..cfacaa1 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c +++ b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-2.c @@ -49,12 +49,20 @@ struct unique { {ENETDOWN,"ENETDOWN",ENETDOWN}, {ENETRESET,"ENETRESET",ENETRESET},{ENETUNREACH,"ENETUNREACH",ENETUNREACH}, {ENFILE,"ENFILE",ENFILE},{ENOBUFS,"ENOBUFS",ENOBUFS}, - {ENODATA,"ENODATA",ENODATA},{ENODEV,"ENODEV",ENODEV}, +#ifdef ENODATA + {ENODATA,"ENODATA",ENODATA}, +#endif + {ENODEV,"ENODEV",ENODEV}, {ENOENT,"ENOENT",ENOENT},{ENOEXEC,"ENOEXEC",ENOEXEC}, {ENOLCK,"ENOLCK",ENOLCK},{ENOLINK,"ENOLINK",ENOLINK}, {ENOMEM,"ENOMEM",ENOMEM},{ENOMSG,"ENOMSG",ENOMSG}, {ENOPROTOOPT,"ENOPROTOOPT",ENOPROTOOPT},{ENOSPC,"ENOSPC",ENOSPC}, - {ENOSR,"ENOSR",ENOSR},{ENOSTR,"ENOSTR",ENOSTR}, +#ifdef ENOSR + {ENOSR,"ENOSR",ENOSR}, +#endif +#ifdef ENOSTR + {ENOSTR,"ENOSTR",ENOSTR}, +#endif {ENOSYS,"ENOSYS",ENOSYS},{ENOTCONN,"ENOTCONN",ENOTCONN}, {ENOTDIR,"ENOTDIR",ENOTDIR},{ENOTEMPTY,"ENOTEMPTY",ENOTEMPTY}, {ENOTSOCK,"ENOTSOCK",ENOTSOCK},{ENOTSUP,"ENOTSUP",ENOTSUP}, diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c index 017f600..7cc2fb5 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c +++ b/testcases/open_posix_testsuite/conformance/definitions/errno_h/4-1.c @@ -45,12 +45,20 @@ struct unique { {ENETDOWN,"ENETDOWN"}, {ENETRESET,"ENETRESET"},{ENETUNREACH,"ENETUNREACH"}, {ENFILE,"ENFILE"},{ENOBUFS,"ENOBUFS"}, - {ENODATA,"ENODATA"},{ENODEV,"ENODEV"}, +#ifdef ENODATA + {ENODATA,"ENODATA"}, +#endif + {ENODEV,"ENODEV"}, {ENOENT,"ENOENT"},{ENOEXEC,"ENOEXEC"}, {ENOLCK,"ENOLCK"},{ENOLINK,"ENOLINK"}, {ENOMEM,"ENOMEM"},{ENOMSG,"ENOMSG"}, {ENOPROTOOPT,"ENOPROTOOPT"},{ENOSPC,"ENOSPC"}, - {ENOSR,"ENOSR"},{ENOSTR,"ENOSTR"}, +#ifdef ENOSR + {ENOSR,"ENOSR"}, +#endif +#ifdef ENOSTR + {ENOSTR,"ENOSTR"}, +#endif {ENOSYS,"ENOSYS"},{ENOTCONN,"ENOTCONN"}, {ENOTDIR,"ENOTDIR"},{ENOTEMPTY,"ENOTEMPTY"}, {ENOTSOCK,"ENOTSOCK"},{ENOTSUP,"ENOTSUP"}, diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/assertions.xml b/testcases/open_posix_testsuite/conformance/definitions/errno_h/assertions.xml index 55c6a9f..08b7934 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/errno_h/assertions.xml +++ b/testcases/open_posix_testsuite/conformance/definitions/errno_h/assertions.xml @@ -88,6 +88,8 @@ [ETXTBSY] [EWOULDBLOCK] [EXDEV] + NOTE: The constants, [EBADMSG], [ENODATA], [ENOSR], [ENOSTR] are + optional as per the XSR specification. </assertion> <assertion id="4" tag="ref:BD:{headers:error.h:DESCRIPTION}"> errno.h shall give positive values for the following symbolic constants @@ -170,5 +172,7 @@ [ETXTBSY] [EWOULDBLOCK] [EXDEV] + NOTE: The constants, [EBADMSG], [ENODATA], [ENOSR], [ENOSTR] are + optional as per the XSR specification. </assertion> </assertions> diff --git a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2-buildonly.c b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2-buildonly.c index 0dd5ff8..1434be8 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2-buildonly.c +++ b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2-buildonly.c @@ -5,68 +5,45 @@ * 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. - - Test the following symbols are defined by pthread.h - */ + * + * Test the following symbols are defined by pthread.h + * + * This is done with functions, not #ifdefs because the spec doesn't state + * that they have to be #define's, and instead can be values in an enum, like + * on FreeBSD. + */ #include <pthread.h> -/* - * XXX (garrcoop): the following #ifndef checks are invalid on many platforms; POSIX - * doesn't state whether or not these these can or cannot be either global variables - * or indices in enums (FreeBSD does the latter with - * PTHREAD_MUTEX_{ERRORCHECK,NORMAL.RECURSIVE} - * - * These tests need to be sorted out into proper functional tests. - */ +#define TEST_MACRO(CONSTANT) \ + void test_ ## CONSTANT(void) { int dummy = #CONSTANT; } /* BAR */ -#ifndef PTHREAD_BARRIER_SERIAL_THREAD -#error PTHREAD_BARRIER_SERIAL_THREAD not defined -#endif +TEST_MACRO(PTHREAD_BARRIER_SERIAL_THREAD) /* XSI */ -#ifndef PTHREAD_MUTEX_DEFAULT -#error PTHREAD_MUTEX_DEFAULT not defined -#endif +TEST_MACRO(PTHREAD_MUTEX_DEFAULT) /* XSI */ -#ifndef PTHREAD_MUTEX_ERRORCHECK -#error PTHREAD_MUTEX_ERRORCHECK not defined -#endif +TEST_MACRO(PTHREAD_MUTEX_ERRORCHECK) /* XSI */ -#ifndef PTHREAD_MUTEX_NORMAL -#error PTHREAD_MUTEX_NORMAL not defined -#endif +TEST_MACRO(PTHREAD_MUTEX_NORMAL) /* XSI */ -#ifndef PTHREAD_MUTEX_RECURSIVE -#error PTHREAD_MUTEX_RECURSIVE not defined -#endif +TEST_MACRO(PTHREAD_MUTEX_RECURSIVE) /* TPP|TPI */ -#ifndef PTHREAD_PRIO_INHERIT -#error PTHREAD_PRIO_INHERIT not defined -#endif +TEST_MACRO(PTHREAD_PRIO_INHERIT) /* TPP|TPI */ -#ifndef PTHREAD_PRIO_NONE -#error PTHREAD_PRIO_NONE not defined -#endif +TEST_MACRO(PTHREAD_PRIO_NONE) /* TPP|TPI */ -#ifndef PTHREAD_PRIO_PROTECT -#error PTHREAD_PRIO_PROTECT not defined -#endif +TEST_MACRO(PTHREAD_PRIO_PROTECT) /* TPS */ -#ifndef PTHREAD_SCOPE_PROCESS -#error PTHREAD_SCOPE_PROCESS not defined -#endif +TEST_MACRO(PTHREAD_SCOPE_PROCESS) /* TPS */ -#ifndef PTHREAD_SCOPE_SYSTEM -#error PTHREAD_SCOPE_SYSTEM not defined -#endif - +TEST_MACRO(PTHREAD_SCOPE_SYSTEM) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c index 32e6dce..5088d84 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c @@ -23,7 +23,9 @@ #define BUF_SIZE 1024 -int main() +#if defined(_POSIX_ASYNCHRONOUS_IO) && 200112L <= _POSIX_ASYNCHRONOUS_IO +int +main (void) { char tmpfname[256]; char buf[BUF_SIZE]; @@ -31,9 +33,7 @@ int main() struct aiocb aiocb_write; struct aiocb aiocb_fsync; -#if _POSIX_ASYNCHRONOUS_IO != 200112L exit(PTS_UNSUPPORTED); -#endif snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_2_1_%d", getpid()); @@ -76,3 +76,12 @@ int main() return PTS_UNTESTED; } +#else +int +main (void) +{ + printf(TNAME " required _POSIX_ASYNCHRONOUS_IO support isn't " + "available\n"); + exit(PTS_UNSUPPORTED); +} +#endif diff --git a/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c b/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c index ba257fd..d4377c9 100644 --- a/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c +++ b/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c @@ -50,7 +50,6 @@ #include <time.h> #include <semaphore.h> #include <fcntl.h> -//#include <assert.h> #include <math.h> /********************************************************************************************/ hooks/post-receive -- ltp |