diff mbox series

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

Message ID 20250226-parse_vdso-nolibc-v2-15-28e14e031ed8@linutronix.de (mailing list archive)
State New
Headers show
Series selftests: vDSO: parse_vdso: Make compatible with nolibc | expand

Commit Message

Thomas Weißschuh Feb. 26, 2025, 11:44 a.m. UTC
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(+)

Comments

Vincenzo Frascino Feb. 28, 2025, 12:30 p.m. UTC | #1
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"
>
diff mbox series

Patch

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"