selftests/vdso: Add linux/sched.h to fix CLONE_NEWTIME build error
Subsystems (2)
PATCH 1/1 selftests/vdso: Add linux/sched.h to fix CLONE_NEWTIME build error
Fix build error in vdso_test_getrandom.c due to missing CLONE_NEWTIME. Include linux/sched.h to define CLONE_NEWTIME.
Ensure successful compilation by resolving the missing header issue.
--- tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/vDSO/vdso_test_getrandom.c +1 -0
@@ -22,6 +22,7 @@#include <linux/random.h> #include <linux/compiler.h> #include <linux/ptrace.h> +#include <linux/sched.h> #include "../kselftest.h" #include "parse_vdso.h"
Signature · 1 line
2.34.1
Shuah Khan
maintainerQuoted 4 lines · On 10/2/24 09:28, SurajSonawane2415 wrote:
Fix build error in
vdso_test_getrandom.cdue to missingCLONE_NEWTIME. Includelinux/sched.hto defineCLONE_NEWTIME.
Ensure successful compilation by resolving the missing header issue.
Did you run "make headers" before building this test? It builds just fine for me on my system.
+ Adding Jason Donenfeld
Quoted 10 lines
Signed-off-by SurajSonawane2415 <[email protected]>--- tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/vDSO/vdso_test_getrandom.c +0
-0
tools/testing/selftests/vDSO/vdso_test_getrandom.c line 28
Quoted 7 lines
tools/testing/selftests/vDSO/vdso_test_getrandom.c +1
-0@@ -22,6 +22,7 @@#include <linux/random.h> #include <linux/compiler.h> #include <linux/ptrace.h> +#include <linux/sched.h> #include "../kselftest.h" #include "parse_vdso.h"
thanks,
-- Shuah
Wasn't this already submitted and commented on?
Shuah Khan
maintainerQuoted 3 lines · Jason A. Donenfeld
Wasn't this already submitted and commented on?
Thank you Jason. Yes we reviewed this - I asked Yu Liao to send me v2 since the define is coming in from pthread.h indirectly.
Suraj, Thank for finding and fixing the problem. However Yu Liao sent in patch for this before you did. We will take that patch.
thanks,
-- Shuah
Re: [PATCH] selftests: vDSO: fix compile error for vdso_test_getrandom
In reply to SurajSonawane2415Yes, I ran it but faced an issue. After reading comments on a similar patch shared by Jason A. Donenfeld, I realized that my environment is Ubuntu 22.04 (Linux 5.15 + glibc 2.35).
After upgrading to a newer version of glibc, the issue seems to be fixed.
I think including <sched.h> might not be needed. I would really appreciate your advice on how to handle this.