diff mbox series

selftests/core: Fix build issue with CLOSE_RANGE_UNSHARE

Message ID 20240111034747.39746-1-hu.yadi@h3c.com (mailing list archive)
State Handled Elsewhere
Headers show
Series selftests/core: Fix build issue with CLOSE_RANGE_UNSHARE | expand

Commit Message

Hu Yadi Jan. 11, 2024, 3:47 a.m. UTC
From: "Hu.Yadi" <hu.yadi@h3c.com>

Add head file to fix cpmpile error:

gcc -g -isystem /home/linux/usr/include     close_range_test.c  -o /home/linux/tools/testing/selftests/core/close_range_test
close_range_test.c: In function ‘close_range_unshare’:
close_range_test.c:111:11: error: ‘CLOSE_RANGE_UNSHARE’ undeclared (first use in this function); did you mean ‘CLONE_NEWUSER’?
           CLOSE_RANGE_UNSHARE);
           ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Hu.Yadi <hu.yadi@h3c.com>
Suggested-by: Jiao <jiaoxupo@h3c.com>
Reviewed-by: Berlin <berlin@h3c.com>
---
 tools/testing/selftests/core/close_range_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hu Yadi Jan. 12, 2024, 5:24 a.m. UTC | #1
Any comments will be appreciated

>From: "Hu.Yadi" <hu.yadi@h3c.com>
>
>Add head file to fix cpmpile error:
>
>gcc -g -isystem /home/linux/usr/include     close_range_test.c  -o /home/linux/tools/testing/selftests/core/close_range_test
>close_range_test.c: In function ‘close_range_unshare’:
>close_range_test.c:111:11: error: ‘CLOSE_RANGE_UNSHARE’ undeclared (first use in this function); did you mean ‘CLONE_NEWUSER’?
>           CLOSE_RANGE_UNSHARE);
>           ^~~~~~~~~~~~~~~~~~~
>

>Signed-off-by: Hu.Yadi <hu.yadi@h3c.com>
>Suggested-by: Jiao <jiaoxupo@h3c.com>
>Reviewed-by: Berlin <berlin@h3c.com>
>---
> tools/testing/selftests/core/close_range_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/tools/testing/selftests/core/close_range_test.c b/tools/testing/selftests/core/close_range_test.c
>index 534576f06df1..563bc1e55937 100644
>--- a/tools/testing/selftests/core/close_range_test.c
>+++ b/tools/testing/selftests/core/close_range_test.c
>@@ -12,7 +12,7 @@
> #include <syscall.h>
> #include <unistd.h>
> #include <sys/resource.h>
>-
>+#include <linux/close_range.h>
> #include "../kselftest_harness.h"
> #include "../clone3/clone3_selftests.h"
> 
>-- 
>2.23.0
diff mbox series

Patch

diff --git a/tools/testing/selftests/core/close_range_test.c b/tools/testing/selftests/core/close_range_test.c
index 534576f06df1..563bc1e55937 100644
--- a/tools/testing/selftests/core/close_range_test.c
+++ b/tools/testing/selftests/core/close_range_test.c
@@ -12,7 +12,7 @@ 
 #include <syscall.h>
 #include <unistd.h>
 #include <sys/resource.h>
-
+#include <linux/close_range.h>
 #include "../kselftest_harness.h"
 #include "../clone3/clone3_selftests.h"