Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests: vDSO: fix compile error for vdso_test_getrandom
@ 2024-09-19 11:18 Yu Liao
  2024-09-19 16:51 ` Shuah Khan
  0 siblings, 1 reply; 10+ messages in thread
From: Yu Liao @ 2024-09-19 11:18 UTC (permalink / raw)
  To: shuah; +Cc: liaoyu15, liwei391, Jason, christophe.leroy, broonie,
	linux-kselftest

When building selftests/vDSO:
$ make -C tools/testing/selftests TARGETS=vDSO
I hit the following compilation error:

  vdso_test_getrandom.c:260:17: error: 'CLONE_NEWTIME' undeclared
  (first use in this function); did you mean 'CLONE_NEWIPC'?
    260 |  assert(unshare(CLONE_NEWTIME) == 0);
        |                 ^~~~~~~~~~~~~

CLONE_NEWTIME is defined in linux/sched.h, so fix this by including
<linux/sched.h>.

Fixes: 2aec90036dcd ("selftests: vDSO: ensure vgetrandom works in a time namespace")
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
---
 tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
index 72a1d9b43a84..84f2bbb2d5e0 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
@@ -19,6 +19,7 @@
 #include <sys/ptrace.h>
 #include <sys/wait.h>
 #include <sys/types.h>
+#include <linux/sched.h>
 #include <linux/random.h>
 #include <linux/compiler.h>
 #include <linux/ptrace.h>
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] selftests/vdso: Add linux/sched.h to fix CLONE_NEWTIME build error
@ 2024-10-02 15:28 SurajSonawane2415
  2024-10-03 11:52 ` [PATCH] selftests: vDSO: fix compile error for vdso_test_getrandom SurajSonawane2415
  0 siblings, 1 reply; 10+ messages in thread
From: SurajSonawane2415 @ 2024-10-02 15:28 UTC (permalink / raw)
  To: shuah, linux-kselftest, linux-kernel; +Cc: SurajSonawane2415

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.

Signed-off-by: SurajSonawane2415 <surajsonawane0215@gmail.com>
---
 tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
index 72a1d9b43..3f2a4dbf8 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
@@ -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"
-- 
2.34.1


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

end of thread, other threads:[~2024-10-08  2:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-19 11:18 [PATCH] selftests: vDSO: fix compile error for vdso_test_getrandom Yu Liao
2024-09-19 16:51 ` Shuah Khan
2024-09-20  1:54   ` Yu Liao
2024-09-20  9:33     ` Christophe Leroy
2024-09-20 15:31       ` Jason A. Donenfeld
2024-09-23 15:30         ` Shuah Khan
2024-09-24  2:57           ` Yu Liao
2024-10-03 22:21             ` Shuah Khan
2024-10-08  2:50               ` Yu Liao
  -- strict thread matches above, loose matches on Subject: below --
2024-10-02 15:28 [PATCH] selftests/vdso: Add linux/sched.h to fix CLONE_NEWTIME build error SurajSonawane2415
2024-10-03 11:52 ` [PATCH] selftests: vDSO: fix compile error for vdso_test_getrandom SurajSonawane2415

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox