All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 2/3] confstr01: Update to X/Open 7 (POSIX 2008)
@ 2022-04-19  6:47 Petr Vorel
  2022-04-19 13:10 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2022-04-19  6:47 UTC (permalink / raw)
  To: ltp

_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 &ndash; POSIX 1995.
+ * Test confstr(3) 700 (X/Open 7) functionality &ndash; 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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH v2 2/3] confstr01: Update to X/Open 7 (POSIX 2008)
  2022-04-19  6:47 [LTP] [PATCH v2 2/3] confstr01: Update to X/Open 7 (POSIX 2008) Petr Vorel
@ 2022-04-19 13:10 ` Cyril Hrubis
  2022-04-19 13:10   ` pvorel
  0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2022-04-19 13:10 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
>  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

This looks fine and as long as it compiles on supported distros and
compilers:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

Btw, we can simplify the code a bit with macro like:

#define PAIR(name) {_CS_ ## name, #name}

>  };
>  
> -- 
> 2.35.3
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH v2 2/3] confstr01: Update to X/Open 7 (POSIX 2008)
  2022-04-19 13:10 ` Cyril Hrubis
@ 2022-04-19 13:10   ` pvorel
  0 siblings, 0 replies; 3+ messages in thread
From: pvorel @ 2022-04-19 13:10 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

> This looks fine and as long as it compiles on supported distros and
> compilers:
Yes, I've tested it on CI.

> 
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
> 
> Btw, we can simplify the code a bit with macro like:
> 
> #define PAIR(name) {_CS_ ## name, #name}
Thanks, I'll use it in this commit.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-19 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19  6:47 [LTP] [PATCH v2 2/3] confstr01: Update to X/Open 7 (POSIX 2008) Petr Vorel
2022-04-19 13:10 ` Cyril Hrubis
2022-04-19 13:10   ` pvorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.