Skip to content

Commit 8661bb9

Browse files
oleg-nesterovbrauner
authored andcommitted
selftests/pidfd: fixes syscall number defines
I had to spend some (a lot;) time to understand why pidfd_info_test (and more) fails with my patch under qemu on my machine ;) Until I applied the patch below. I think it is a bad idea to do the things like #ifndef __NR_clone3 #define __NR_clone3 -1 #endif because this can hide a problem. My working laptop runs Fedora-23 which doesn't have __NR_clone3/etc in /usr/include/. So "make" happily succeeds, but everything fails and it is not clear why. Link: https://lore.kernel.org/r/20250323174518.GB834@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 0b7747a commit 8661bb9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tools/testing/selftests/clone3/clone3_selftests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define ptr_to_u64(ptr) ((__u64)((uintptr_t)(ptr)))
1717

1818
#ifndef __NR_clone3
19-
#define __NR_clone3 -1
19+
#define __NR_clone3 435
2020
#endif
2121

2222
struct __clone_args {

tools/testing/selftests/pidfd/pidfd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@
3232
#endif
3333

3434
#ifndef __NR_pidfd_open
35-
#define __NR_pidfd_open -1
35+
#define __NR_pidfd_open 434
3636
#endif
3737

3838
#ifndef __NR_pidfd_send_signal
39-
#define __NR_pidfd_send_signal -1
39+
#define __NR_pidfd_send_signal 424
4040
#endif
4141

4242
#ifndef __NR_clone3
43-
#define __NR_clone3 -1
43+
#define __NR_clone3 435
4444
#endif
4545

4646
#ifndef __NR_pidfd_getfd
47-
#define __NR_pidfd_getfd -1
47+
#define __NR_pidfd_getfd 438
4848
#endif
4949

5050
#ifndef PIDFD_NONBLOCK

0 commit comments

Comments
 (0)