Skip to contentSkip to conversation

Add close_range01, SAFE_DUP2 and SAFE_CLONE

PATCH Superseded Richard Palethorpe 3 participants 12 messages Feb 11, 2021 Library code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add close_range01, SAFE_DUP2 and SAFE_CLONE

Hi,

This series adds a test for the new system call close_range. The kernel selftests already added some tests, so I based this on those.

Also of note, is the addition of tst_clone and SAFE_CLONE which mirror the clone3 interface. This is not really necessary for this test as it is unlikely close_range is backported, but clone3 is not. OTOH I think it will be usefull for other tests especially as the libc clone wrapper seems to force the user to allocate the stack even though the kernel can handle this. Also the clone_args is growing rapidly.

The old API has ltp_clone* functions, but I think we will have an easier time tracking the clone3 interface, than what we were doing with the old API.

Richard Palethorpe (5):
close_range: Add syscall number
API: Add SAFE_DUP2
API: Fix clone.h
API: Add tst_clone
close_range: Add test

 include/lapi/clone.h                          |   5 +-
 include/lapi/syscalls/aarch64.in              |   1 +
 include/lapi/syscalls/arc.in                  |   1 +
 include/lapi/syscalls/arm.in                  |   1 +
 include/lapi/syscalls/hppa.in                 |   1 +
 include/lapi/syscalls/i386.in                 |   1 +
 include/lapi/syscalls/ia64.in                 |   1 +
 include/lapi/syscalls/mips_n32.in             |   1 +
 include/lapi/syscalls/mips_n64.in             |   1 +
 include/lapi/syscalls/mips_o32.in             |   1 +
 include/lapi/syscalls/powerpc.in              |   1 +
 include/lapi/syscalls/powerpc64.in            |   1 +
 include/lapi/syscalls/s390.in                 |   1 +
 include/lapi/syscalls/s390x.in                |   1 +
 include/lapi/syscalls/sh.in                   |   1 +
 include/lapi/syscalls/sparc.in                |   1 +
 include/lapi/syscalls/sparc64.in              |   1 +
 include/lapi/syscalls/x86_64.in               |   1 +
 include/tst_clone.h                           |  28 +++
 include/tst_safe_macros.h                     |   5 +
 include/tst_test.h                            |   2 +-
 lib/tst_clone.c                               |  46 ++++
 lib/tst_safe_macros.c                         |  18 ++
 lib/tst_test.c                                |  25 +++
 .../kernel/syscalls/close_range/.gitignore    |   1 +
 .../kernel/syscalls/close_range/Makefile      |  10 +
 .../syscalls/close_range/close_range01.c      | 208 ++++++++++++++++++
 27 files changed, 362 insertions(+), 3 deletions(-)
 create mode 100644 lib/tst_clone.c
 create mode 100644 testcases/kernel/syscalls/close_range/.gitignore
 create mode 100644 testcases/kernel/syscalls/close_range/Makefile
 create mode 100644 testcases/kernel/syscalls/close_range/close_range01.c
Signature · 1 line
2.30.0
#1 lore raw

PATCH 1/5 close_range: Add syscall number

---
 include/lapi/syscalls/aarch64.in   | 1 +
 include/lapi/syscalls/arc.in       | 1 +
 include/lapi/syscalls/arm.in       | 1 +
 include/lapi/syscalls/hppa.in      | 1 +
 include/lapi/syscalls/i386.in      | 1 +
 include/lapi/syscalls/ia64.in      | 1 +
 include/lapi/syscalls/mips_n32.in  | 1 +
 include/lapi/syscalls/mips_n64.in  | 1 +
 include/lapi/syscalls/mips_o32.in  | 1 +
 include/lapi/syscalls/powerpc.in   | 1 +
 include/lapi/syscalls/powerpc64.in | 1 +
 include/lapi/syscalls/s390.in      | 1 +
 include/lapi/syscalls/s390x.in     | 1 +
 include/lapi/syscalls/sh.in        | 1 +
 include/lapi/syscalls/sparc.in     | 1 +
 include/lapi/syscalls/sparc64.in   | 1 +
 include/lapi/syscalls/x86_64.in    | 1 +
 17 files changed, 17 insertions(+)
include/lapi/syscalls/aarch64.in +1 -0
index 07556933f..2def6ba3d 100644
@@ -310,6 +310,7 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
 _sysctl 1078
include/lapi/syscalls/arc.in +1 -0
index 0cadb150c..9bcd84706 100644
@@ -310,5 +310,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/arm.in +1 -0
index 395d53a68..98c840cb8 100644
@@ -388,5 +388,6 @@ fsmount (__NR_SYSCALL_BASE+432)
 fspick (__NR_SYSCALL_BASE+433)
 pidfd_open (__NR_SYSCALL_BASE+434)
 clone3 (__NR_SYSCALL_BASE+435)
+close_range (__NR_SYSCALL_BASE+436)
 openat2 (__NR_SYSCALL_BASE+437)
 pidfd_getfd (__NR_SYSCALL_BASE+438)
include/lapi/syscalls/hppa.in +1 -0
index 7f9b5e0a0..e1628c4b1 100644
@@ -39,3 +39,4 @@ fsconfig 431
 fsmount 432
 fspick 433
 pidfd_open 434
+close_range 436
\ No newline at end of file
include/lapi/syscalls/i386.in +1 -0
index d6773abcb..aaa02c7bf 100644
@@ -424,5 +424,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/ia64.in +1 -0
index 427b711b1..5467f80f2 100644
@@ -337,5 +337,6 @@ fsconfig 1455
 fsmount 1456
 fspick 1457
 pidfd_open 1458
+close_range 1460
 openat2 1461
 pidfd_getfd 1462
include/lapi/syscalls/mips_n32.in +1 -0
index eb6140ebc..a509ca5c6 100644
@@ -362,5 +362,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/mips_n64.in +1 -0
index 5480aa3c9..532c69dd8 100644
@@ -338,5 +338,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/mips_o32.in +1 -0
index feee8fbf3..c71a62a35 100644
@@ -408,5 +408,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/powerpc.in +1 -0
index cdbebc62d..2d287a606 100644
@@ -417,5 +417,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/powerpc64.in +1 -0
index cdbebc62d..2d287a606 100644
@@ -417,5 +417,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/s390.in +1 -0
index c3f249aed..c978b6660 100644
@@ -404,5 +404,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/s390x.in +1 -0
index 88cc9b86b..d123db6cb 100644
@@ -352,5 +352,6 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/sh.in +1 -0
index 06055ed10..22da7d6ff 100644
@@ -398,5 +398,6 @@ fsconfig 431
 fsmount 432
 fspick 433
 pidfd_open 434
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/sparc.in +1 -0
index 522e3c997..7324b4ac6 100644
@@ -403,5 +403,6 @@ fsconfig 431
 fsmount 432
 fspick 433
 pidfd_open 434
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/sparc64.in +1 -0
index 6f884a7bf..862d806fa 100644
@@ -368,5 +368,6 @@ fsconfig 431
 fsmount 432
 fspick 433
 pidfd_open 434
+close_range 436
 openat2 437
 pidfd_getfd 438
include/lapi/syscalls/x86_64.in +1 -0
index c76328c93..1345002f5 100644
@@ -345,6 +345,7 @@ fsmount 432
 fspick 433
 pidfd_open 434
 clone3 435
+close_range 436
 openat2 437
 pidfd_getfd 438
 rt_sigaction 512
Signature · 1 line
2.30.0
#2 lore raw

PATCH 2/5 API: Add SAFE_DUP2

In reply to Richard Palethorpe
---
 include/tst_safe_macros.h |  5 +++++
 lib/tst_safe_macros.c     | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+)
include/tst_safe_macros.h +5 -0
index ee3df4142..2a2b0088a 100644
@@ -50,6 +50,11 @@ int safe_dup(const char *file, const int lineno, int oldfd);
 #define SAFE_DUP(oldfd) \
 	safe_dup(__FILE__, __LINE__, (oldfd))
 
+int safe_dup2(const char *file, const int lineno, int oldfd, int newfd);
+
+#define SAFE_DUP2(oldfd, newfd)			\
+	safe_dup2(__FILE__, __LINE__, (oldfd), (newfd))
+
 #define SAFE_GETCWD(buf, size) \
 	safe_getcwd(__FILE__, __LINE__, NULL, (buf), (size))
 
lib/tst_safe_macros.c +18 -0
index aa03a6d5c..182b690bb 100644
@@ -415,6 +415,24 @@ int safe_dup(const char *file, const int lineno, int oldfd)
 	return rval;
 }
 
+int safe_dup2(const char *file, const int lineno, int oldfd, int newfd)
+{
+	int rval;
+
+	rval = dup2(oldfd, newfd);
+
+	if (rval == -1) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			 "dup2(%i, %i) failed", oldfd, newfd);
+	} else if (rval != newfd) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			 "Invalid dup2(%i, %i) return value %d",
+			 oldfd, newfd, rval);
+	}
+
+	return rval;
+}
+
 sighandler_t safe_signal(const char *file, const int lineno,
 	int signum, sighandler_t handler)
 {
Signature · 1 line
2.30.0
#3 lore raw

PATCH 3/5 API: Fix clone.h

In reply to Richard Palethorpe

Functions in headers should be static inline. Also add stdint.h because it results in confusing error messages if it is missing.

---
 include/lapi/clone.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/lapi/clone.h +3 -2
index 2b8cbdbe0..81db443c9 100644
@@ -10,6 +10,7 @@
 #include <sys/syscall.h>
 #include <linux/types.h>
 #include <sched.h>
+#include <stdint.h>
 
 #include "config.h"
 #include "lapi/syscalls.h"
@@ -26,7 +27,7 @@ struct clone_args {
 	uint64_t __attribute__((aligned(8))) tls;
 };
 
-int clone3(struct clone_args *args, size_t size)
+static inline int clone3(struct clone_args *args, size_t size)
 {
 	return tst_syscall(__NR_clone3, args, size);
 }
@@ -36,7 +37,7 @@ int clone3(struct clone_args *args, size_t size)
 #define CLONE_PIDFD	0x00001000	/* set if a pidfd should be placed in parent */
 #endif
 
-void clone3_supported_by_kernel(void)
+static inline void clone3_supported_by_kernel(void)
 {
 	if ((tst_kvercmp(5, 3, 0)) < 0) {
 		/* Check if the syscall is backported on an older kernel */
Signature · 1 line
2.30.0
#4 lore raw

PATCH 4/5 API: Add tst_clone

In reply to Richard Palethorpe

The raw clone system call and clone3 have relatively simple interfaces if the stack pointer is set to NULL. The libc wrapper complicates things hugely. So introduce an interface similar to clone3, but that falls back to clone.

Not all features of clone3 are implemented in clone, but we could either return TCONF or implement them in user land.

---
 include/tst_clone.h | 28 +++++++++++++++++++++++++++
 include/tst_test.h  |  2 +-
 lib/tst_clone.c     | 46 +++++++++++++++++++++++++++++++++++++++++++++
 lib/tst_test.c      | 25 ++++++++++++++++++++++++
 4 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 lib/tst_clone.c
include/tst_clone.h +28 -0
index 88188525d..9ffdc68d1 100644
@@ -5,6 +5,34 @@
 #ifndef TST_CLONE_H__
 #define TST_CLONE_H__
 
+#ifdef TST_TEST_H__
+
+/* The parts of clone3's clone_args we support */
+struct tst_clone_args {
+	uint64_t flags;
+	uint64_t exit_signal;
+};
+
+/* clone3 with fallbacks to clone when possible. Be aware that it
+ * returns -1 if clone3 fails (except ENOSYS), but -2 if clone fails.
+ *
+ * Without CLONE_VM this acts like fork so you may want to set
+ * tst_test.forks_child (safe_clone requires this).
+ *
+ * You should set exit_signal to SIGCHLD for
+ * tst_reap_children. Otherwise you must call wait with the
+ * appropriate parameters.
+ */
+pid_t tst_clone(const struct tst_clone_args *args);
+
+pid_t safe_clone(const char *file, const int lineno,
+		 const struct tst_clone_args *args);
+
+/* "Safe" version of tst_clone */
+#define SAFE_CLONE(args) safe_clone(__FILE__, __LINE__, args)
+
+#endif	/* TST_TEST_H__ */
+
 /* Functions from lib/cloner.c */
 int ltp_clone(unsigned long flags, int (*fn)(void *arg), void *arg,
 		size_t stack_size, void *stack);
include/tst_test.h +1 -1
index c87251870..7dab5f761 100644
@@ -29,7 +29,6 @@
 #include "tst_process_state.h"
 #include "tst_atomic.h"
 #include "tst_kvercmp.h"
-#include "tst_clone.h"
 #include "tst_kernel.h"
 #include "tst_minmax.h"
 #include "tst_get_bad_addr.h"
@@ -94,6 +93,7 @@ pid_t safe_fork(const char *filename, unsigned int lineno);
 #include "tst_safe_macros.h"
 #include "tst_safe_file_ops.h"
 #include "tst_safe_net.h"
+#include "tst_clone.h"
 
 /*
  * Wait for all children and exit with TBROK if
lib/tst_clone.c new file +46 -0

46 lines not on this page · raw message

lib/tst_test.c +25 -0
index 0714f0a0e..6bbee030b 100644
@@ -424,6 +424,31 @@ pid_t safe_fork(const char *filename, unsigned int lineno)
 	return pid;
 }
 
+pid_t safe_clone(const char *file, const int lineno,
+		 const struct tst_clone_args *args)
+{
+	pid_t pid;
+
+	if (!tst_test->forks_child)
+		tst_brk(TBROK, "test.forks_child must be set!");
+
+	pid = tst_clone(args);
+
+	switch (pid) {
+	case -1:
+		tst_brk_(file, lineno, TBROK | TERRNO, "clone3 failed");
+		break;
+	case -2:
+		tst_brk_(file, lineno, TBROK | TERRNO, "clone failed");
+		return -1;
+	}
+
+	if (!pid)
+		atexit(tst_free_all);
+
+	return pid;
+}
+
 static struct option {
 	char *optstr;
 	char *help;
Signature · 1 line
2.30.0
#5 lore raw

PATCH 4/5 API: Add tst_clone

Hi!

lib/tst_clone.c line 29

Quoted 11 lines
lib/tst_clone.c new file +11 -0
+	int flags;
+	pid_t pid = -1;
+
+	tst_flush();
+
+	errno = ENOSYS;
+	if (__NR_clone3 != __LTP__NR_INVALID_SYSCALL)
+		pid = syscall(__NR_clone3, &args, sizeof(args));
+
+	if (pid == -1 && errno != ENOSYS)
+		return -1;

As far as I can tell when kernel is too old we would get EINVAL because the syscall number is not allocated. ENOSYS happens mostly when syscall number is allocated and kernel does not implement the functionality, e.g. it's disabled in .config.

I wonder if it's even menaningful to handle ENOSYS here, I doubt that clone3() can be disabled, or do I miss something?

Quoted 58 lines
lib/tst_clone.c new file +16 -0
+	if (pid != -1)
+		return pid;
+
+	flags = args.exit_signal | args.flags;
+
+#ifdef __s390x__
+	pid = syscall(__NR_clone, NULL, flags);
+#else
+	pid = syscall(__NR_clone, flags, NULL);
+#endif
+
+	if (pid == -1)
+		return -2;
+
+	return pid;
+}
lib/tst_test.c +25 -0
index 0714f0a0e..6bbee030b 100644
@@ -424,6 +424,31 @@ pid_t safe_fork(const char *filename, unsigned int lineno)
 	return pid;
 }
 
+pid_t safe_clone(const char *file, const int lineno,
+		 const struct tst_clone_args *args)
+{
+	pid_t pid;
+
+	if (!tst_test->forks_child)
+		tst_brk(TBROK, "test.forks_child must be set!");
+
+	pid = tst_clone(args);
+
+	switch (pid) {
+	case -1:
+		tst_brk_(file, lineno, TBROK | TERRNO, "clone3 failed");
+		break;
+	case -2:
+		tst_brk_(file, lineno, TBROK | TERRNO, "clone failed");
+		return -1;
+	}
+
+	if (!pid)
+		atexit(tst_free_all);
+
+	return pid;
+}
+
 static struct option {
 	char *optstr;
 	char *help;
Signature · 5 lines
2.30.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 2 lines
Cyril Hrubis
[email protected]
#6 lore raw

PATCH 4/5 API: Add tst_clone

Hello,

Quoted 18 lines · Cyril Hrubis

Hi!

lib/tst_clone.c line 29

Quoted 11 lines
lib/tst_clone.c new file +11 -0
+	int flags;
+	pid_t pid = -1;
+
+	tst_flush();
+
+	errno = ENOSYS;
+	if (__NR_clone3 != __LTP__NR_INVALID_SYSCALL)
+		pid = syscall(__NR_clone3, &args, sizeof(args));
+
+	if (pid == -1 && errno != ENOSYS)
+		return -1;

As far as I can tell when kernel is too old we would get EINVAL because the syscall number is not allocated. ENOSYS happens mostly when syscall number is allocated and kernel does not implement the functionality, e.g. it's disabled in .config.

Quoted 2 lines

I wonder if it's even menaningful to handle ENOSYS here, I doubt that clone3() can be disabled, or do I miss something?

AFAICT it should return ENOSYS if the syscall number is greater than the current maximum. This is certainly true for riscv and also apears to be true for arm64 and x86. It is also written in a kernel book I have from 2010 :-p

Signature · 2 lines
Thank you,
Richard.
#7 lore raw

PATCH 4/5 API: Add tst_clone

Hi!

Quoted 17 lines
Quoted 17 lines

lib/tst_clone.c line 29

Quoted 11 lines
lib/tst_clone.c new file +11 -0
+	int flags;
+	pid_t pid = -1;
+
+	tst_flush();
+
+	errno = ENOSYS;
+	if (__NR_clone3 != __LTP__NR_INVALID_SYSCALL)
+		pid = syscall(__NR_clone3, &args, sizeof(args));
+
+	if (pid == -1 && errno != ENOSYS)
+		return -1;

As far as I can tell when kernel is too old we would get EINVAL because the syscall number is not allocated. ENOSYS happens mostly when syscall number is allocated and kernel does not implement the functionality, e.g. it's disabled in .config.

Quoted 7 lines
Quoted 2 lines

I wonder if it's even menaningful to handle ENOSYS here, I doubt that clone3() can be disabled, or do I miss something?

AFAICT it should return ENOSYS if the syscall number is greater than the current maximum. This is certainly true for riscv and also apears to be true for arm64 and x86. It is also written in a kernel book I have from 2010 :-p

Sounds sane, so we get EINVAL if the syscall number is out of the syscall table. So I guess that we have to handle both.

Signature · 2 lines
Cyril Hrubis
[email protected]
#8 lore raw

PATCH 4/5 API: Add tst_clone

Hello,

Quoted 21 lines · Cyril Hrubis

Hi!

Quoted 20 lines
Quoted 19 lines

lib/tst_clone.c line 29

Quoted 11 lines
lib/tst_clone.c new file +11 -0
+	int flags;
+	pid_t pid = -1;
+
+	tst_flush();
+
+	errno = ENOSYS;
+	if (__NR_clone3 != __LTP__NR_INVALID_SYSCALL)
+		pid = syscall(__NR_clone3, &args, sizeof(args));
+
+	if (pid == -1 && errno != ENOSYS)
+		return -1;

As far as I can tell when kernel is too old we would get EINVAL because the syscall number is not allocated. ENOSYS happens mostly when syscall number is allocated and kernel does not implement the functionality, e.g. it's disabled in .config.

I wonder if it's even menaningful to handle ENOSYS here, I doubt that clone3() can be disabled, or do I miss something?

Quoted 7 lines
Quoted 4 lines

AFAICT it should return ENOSYS if the syscall number is greater than the current maximum. This is certainly true for riscv and also apears to be true for arm64 and x86. It is also written in a kernel book I have from 2010 :-p

Sounds sane, so we get EINVAL if the syscall number is out of the syscall table. So I guess that we have to handle both.

I don't know where you are getting EINVAL from?

Try the following

#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>

int main(int argc, const char* argv[])

{
	syscall(~0ULL);

	return errno;
}

It returns ENOSYS and strace shows this is not due to any sanity checking by glibc.

I guess it would actually be a bug if it returned EINVAL although I am not sure this is specified anywhere.

Signature · 2 lines
Thank you,
Richard.
#9 lore raw

PATCH 4/5 API: Add tst_clone

Hi!

Quoted 15 lines

I don't know where you are getting EINVAL from?

Try the following

#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>

int main(int argc, const char* argv[])

{
	syscall(~0ULL);

	return errno;
}
Quoted 5 lines

It returns ENOSYS and strace shows this is not due to any sanity checking by glibc.

I guess it would actually be a bug if it returned EINVAL although I am not sure this is specified anywhere.

And I guess that I got confused again. You get EINVAL when you pass unsupported flags to a syscall, not unsupported syscall number.

Signature · 2 lines
Cyril Hrubis
[email protected]
#10 lore raw

PATCH 5/5 close_range: Add test

In reply to Richard Palethorpe
---
 .../kernel/syscalls/close_range/.gitignore    |   1 +
 .../kernel/syscalls/close_range/Makefile      |  10 +
 .../syscalls/close_range/close_range01.c      | 208 ++++++++++++++++++
 3 files changed, 219 insertions(+)
 create mode 100644 testcases/kernel/syscalls/close_range/.gitignore
 create mode 100644 testcases/kernel/syscalls/close_range/Makefile
 create mode 100644 testcases/kernel/syscalls/close_range/close_range01.c
testcases/kernel/syscalls/close_range/.gitignore new file +1 -0
new file mode 100644
index 000000000..291a0379c
@@ -0,0 +1 @@
+close_range01
\ No newline at end of file
testcases/kernel/syscalls/close_range/Makefile new file +10 -0
new file mode 100644
index 000000000..dc6413b10
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2019-2021 Linux Test Project
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+CFLAGS			+= -D_GNU_SOURCE
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/close_range/close_range01.c new file +208 -0

208 lines not on this page · raw message

Signature · 1 line
2.30.0
#11 lore raw

PATCH 5/5 close_range: Add test

Hi!

testcases/kernel/syscalls/close_range/close_range01.c line 42

Quoted 4 lines
testcases/kernel/syscalls/close_range/close_range01.c new file +4 -0
+static inline void do_close_range(unsigned int fd, unsigned int max_fd,
+				  unsigned int flags)
+{
+	int ret = tst_syscall(__NR_close_range, fd, max_fd, flags);

Can we please add configure test and fallback definition into lapi/ as we usually do instead of calling the raw syscall here?

Signature · 2 lines
Cyril Hrubis
[email protected]