[PATCH v2 15/16] selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc

Thomas Weißschuh posted 16 patches 9 months, 3 weeks ago
[PATCH v2 15/16] selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc
Posted by Thomas Weißschuh 9 months, 3 weeks ago
nolibc does not provide sys/time.h and sys/auxv.h,
instead their definitions are available unconditionally.

Guard the includes so they are not attempted on nolibc.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
index 636a56ccf8e4e7943ca446fe3fad6897598ca77f..9ce795b806f0992b83cef78c7e16fac0e54750da 100644
--- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
+++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
@@ -11,8 +11,10 @@
  */
 
 #include <stdio.h>
+#ifndef NOLIBC
 #include <sys/auxv.h>
 #include <sys/time.h>
+#endif
 
 #include "../kselftest.h"
 #include "parse_vdso.h"

-- 
2.48.1

Re: [PATCH v2 15/16] selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc
Posted by Vincenzo Frascino 9 months, 3 weeks ago

On 26/02/2025 11:44, Thomas Weißschuh wrote:
> nolibc does not provide sys/time.h and sys/auxv.h,
> instead their definitions are available unconditionally.
> 
> Guard the includes so they are not attempted on nolibc.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> ---
>  tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
> index 636a56ccf8e4e7943ca446fe3fad6897598ca77f..9ce795b806f0992b83cef78c7e16fac0e54750da 100644
> --- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
> +++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
> @@ -11,8 +11,10 @@
>   */
>  
>  #include <stdio.h>
> +#ifndef NOLIBC
>  #include <sys/auxv.h>
>  #include <sys/time.h>
> +#endif
>  
>  #include "../kselftest.h"
>  #include "parse_vdso.h"
> 

-- 
Regards,
Vincenzo

[tip: timers/vdso] selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc
Posted by tip-bot2 for Thomas Weißschuh 9 months, 2 weeks ago
The following commit has been merged into the timers/vdso branch of tip:

Commit-ID:     4f65df6a58b3de5132f978305c5f807ec3803943
Gitweb:        https://git.kernel.org/tip/4f65df6a58b3de5132f978305c5f807ec3803943
Author:        Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate:    Wed, 26 Feb 2025 12:44:54 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 03 Mar 2025 20:00:13 +01:00

selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc

nolibc does not provide sys/time.h and sys/auxv.h,
instead their definitions are available unconditionally.

Guard the includes so they are not attempted on nolibc.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/all/20250226-parse_vdso-nolibc-v2-15-28e14e031ed8@linutronix.de
---
 tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
index 636a56c..9ce795b 100644
--- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
+++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
@@ -11,8 +11,10 @@
  */
 
 #include <stdio.h>
+#ifndef NOLIBC
 #include <sys/auxv.h>
 #include <sys/time.h>
+#endif
 
 #include "../kselftest.h"
 #include "parse_vdso.h"