[LTP] [PATCH v2 2/3] confstr01: Update to X/Open 7 (POSIX 2008)

Petr Vorel pvorel@suse.cz
Tue Apr 19 08:47:44 CEST 2022


_CS_POSIX_V7_THREADS_{C,LD}FLAGS aren't currently supported on glibc
(2.35) nor on musl (v1.2.2), uclibc-ng (v1.0.40).

_CS_V7_ENV is not on uclibc-ng.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v1->v2:
* wrap _CS_V7_ENV with #ifdef (missing on uclibc)

 testcases/kernel/syscalls/confstr/confstr01.c | 81 ++++++-------------
 1 file changed, 25 insertions(+), 56 deletions(-)

diff --git a/testcases/kernel/syscalls/confstr/confstr01.c b/testcases/kernel/syscalls/confstr/confstr01.c
index 57ac0a9ad9..2b2daa0d4e 100644
--- a/testcases/kernel/syscalls/confstr/confstr01.c
+++ b/testcases/kernel/syscalls/confstr/confstr01.c
@@ -10,19 +10,16 @@
 /*\
  * [Description]
  *
- * Test confstr(3) 500 (X/Open 5) functionality – POSIX 1995.
+ * Test confstr(3) 700 (X/Open 7) functionality – POSIX 2008.
  */
 
-#include "tst_test.h"
-
-#ifdef _XOPEN_SOURCE
-# undef _XOPEN_SOURCE
-#endif
-#define _XOPEN_SOURCE 500
+#define _XOPEN_SOURCE 700
 
 #include <stdlib.h>
 #include <unistd.h>
 
+#include "tst_test.h"
+
 static struct test_case_t {
 	int value;
 	char *name;
@@ -30,55 +27,27 @@ static struct test_case_t {
 	{ _CS_PATH, "PATH" },
 	{ _CS_GNU_LIBC_VERSION, "GNU_LIBC_VERSION" },
 	{ _CS_GNU_LIBPTHREAD_VERSION, "GNU_LIBPTHREAD_VERSION" },
-
-/* checking for obsolete configurations */
-#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
-	{ _CS_XBS5_ILP32_OFF32_CFLAGS, "XBS5_ILP32_OFF32_CFLAGS" },
-#endif
-#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
-	{ _CS_XBS5_ILP32_OFF32_LDFLAGS, "XBS5_ILP32_OFF32_LDFLAGS" },
-#endif
-#ifdef _CS_XBS5_ILP32_OFF32_LIBS
-	{ _CS_XBS5_ILP32_OFF32_LIBS, "XBS5_ILP32_OFF32_LIBS" },
-#endif
-#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
-	{ _CS_XBS5_ILP32_OFF32_LINTFLAGS, "XBS5_ILP32_OFF32_LINTFLAGS" },
-#endif
-#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
-	{ _CS_XBS5_ILP32_OFFBIG_CFLAGS, "XBS5_ILP32_OFFBIG_CFLAGS" },
-#endif
-#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
-	{ _CS_XBS5_ILP32_OFFBIG_LDFLAGS, "XBS5_ILP32_OFFBIG_LDFLAGS" },
-#endif
-#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
-	{ _CS_XBS5_ILP32_OFFBIG_LIBS, "XBS5_ILP32_OFFBIG_LIBS" },
-#endif
-#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
-	{ _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, "XBS5_ILP32_OFFBIG_LINTFLAGS" },
-#endif
-#ifdef _CS_XBS5_LP64_OFF64_CFLAGS
-	{ _CS_XBS5_LP64_OFF64_CFLAGS, "XBS5_LP64_OFF64_CFLAGS" },
-#endif
-#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
-	{ _CS_XBS5_LP64_OFF64_LDFLAGS, "XBS5_LP64_OFF64_LDFLAGS" },
-#endif
-#ifdef _CS_XBS5_LP64_OFF64_LIBS
-	{ _CS_XBS5_LP64_OFF64_LIBS, "XBS5_LP64_OFF64_LIBS" },
-#endif
-#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
-	{ _CS_XBS5_LP64_OFF64_LINTFLAGS, "XBS5_LP64_OFF64_LINTFLAGS" },
-#endif
-#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
-	{ _CS_XBS5_LPBIG_OFFBIG_CFLAGS, "XBS5_LPBIG_OFFBIG_CFLAGS" },
-#endif
-#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
-	{ _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, "XBS5_LPBIG_OFFBIG_LDFLAGS" },
-#endif
-#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
-	{ _CS_XBS5_LPBIG_OFFBIG_LIBS, "XBS5_LPBIG_OFFBIG_LIBS" },
-#endif
-#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
-	{ _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, "XBS5_LPBIG_OFFBIG_LINTFLAGS" },
+	{ _CS_POSIX_V7_ILP32_OFF32_CFLAGS, "POSIX_V7_ILP32_OFF32_CFLAGS" },
+	{ _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, "POSIX_V7_ILP32_OFF32_LDFLAGS" },
+	{ _CS_POSIX_V7_ILP32_OFF32_LIBS, "POSIX_V7_ILP32_OFF32_LIBS" },
+	{ _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, "POSIX_V7_ILP32_OFFBIG_CFLAGS" },
+	{ _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, "POSIX_V7_ILP32_OFFBIG_LDFLAGS" },
+	{ _CS_POSIX_V7_ILP32_OFFBIG_LIBS, "POSIX_V7_ILP32_OFFBIG_LIBS" },
+	{ _CS_POSIX_V7_LP64_OFF64_CFLAGS, "POSIX_V7_LP64_OFF64_CFLAGS" },
+	{ _CS_POSIX_V7_LP64_OFF64_LDFLAGS, "POSIX_V7_LP64_OFF64_LDFLAGS" },
+	{ _CS_POSIX_V7_LP64_OFF64_LIBS, "POSIX_V7_LP64_OFF64_LIBS" },
+	{ _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, "POSIX_V7_LPBIG_OFFBIG_CFLAGS" },
+	{ _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, "POSIX_V7_LPBIG_OFFBIG_LDFLAGS" },
+	{ _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, "POSIX_V7_LPBIG_OFFBIG_LIBS" },
+#ifdef _CS_POSIX_V7_THREADS_CFLAGS
+	{ _CS_POSIX_V7_THREADS_CFLAGS, "POSIX_V7_THREADS_CFLAGS" },
+#endif
+#ifdef _CS_POSIX_V7_THREADS_LDFLAGS
+	{ _CS_POSIX_V7_THREADS_LDFLAGS, "POSIX_V7_THREADS_LDFLAGS" },
+#endif
+	{ _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS, "POSIX_V7_WIDTH_RESTRICTED_ENVS" },
+#ifdef _CS_V7_ENV
+	{ _CS_V7_ENV, "V7_ENV" },
 #endif
 };
 
-- 
2.35.3



More information about the ltp mailing list