diff mbox series

[v2] selftests: vDSO: Explicitly include sched.h

Message ID 20241008023332.19902-1-liaoyu15@huawei.com (mailing list archive)
State Accepted
Commit 34d5b600172b846161e507bdce132c98d9cc9701
Headers show
Series [v2] selftests: vDSO: Explicitly include sched.h | expand

Commit Message

Yu Liao Oct. 8, 2024, 2:33 a.m. UTC
The previous commit introduced the use of CLONE_NEWTIME without including
<sched.h> which contains its definition.

Add an explicit include of <sched.h> to ensure that CLONE_NEWTIME
is correctly defined before it is used.

Fixes: 2aec90036dcd ("selftests: vDSO: ensure vgetrandom works in a time namespace")
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
---
Changes in v2:
- Include <sched.h> instead of <linux/sched.h>

v1: https://lore.kernel.org/all/20240919111841.20226-1-liaoyu15@huawei.com/

 tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Shuah Khan Oct. 8, 2024, 9:50 p.m. UTC | #1
On 10/7/24 20:33, Yu Liao wrote:
> The previous commit introduced the use of CLONE_NEWTIME without including
> <sched.h> which contains its definition.
> 
> Add an explicit include of <sched.h> to ensure that CLONE_NEWTIME
> is correctly defined before it is used.
> 
> Fixes: 2aec90036dcd ("selftests: vDSO: ensure vgetrandom works in a time namespace")
> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
> ---
> Changes in v2:
> - Include <sched.h> instead of <linux/sched.h>
> 
> v1: https://lore.kernel.org/all/20240919111841.20226-1-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..ddf37e3ab18b 100644
> --- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
> +++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
> @@ -11,6 +11,7 @@
>   #include <string.h>
>   #include <time.h>
>   #include <unistd.h>
> +#include <sched.h>
>   #include <signal.h>
>   #include <sys/auxv.h>
>   #include <sys/mman.h>

Thank you. Applied to linux-kselftest fixes for next rc.

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
index 72a1d9b43a84..ddf37e3ab18b 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
@@ -11,6 +11,7 @@ 
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
+#include <sched.h>
 #include <signal.h>
 #include <sys/auxv.h>
 #include <sys/mman.h>