Skip to content

Commit 7c33277

Browse files
groeckbrauner
authored andcommitted
samples: fix pidfd-metadata compilation
Define __NR_pidfd_send_signal if it isn't to prevent a compilation error. To make pidfd-metadata compile on all arches, irrespective of whether or not syscall numbers are assigned, define the syscall number to -1. If it isn't defined this will cause the kernel to return -ENOSYS. Fixes: 43c6afe ("samples: show race-free pidfd metadata access") Reported-by: Arnd Bergmann <arnd@arndb.de> Reported-by: Guenter Roeck <linux@roeck-us.net> Cc: Christian Brauner <christian@brauner.io> Signed-off-by: Guenter Roeck <linux@roeck-us.net> [christian@brauner.io: tweak commit message] Signed-off-by: Christian Brauner <christian@brauner.io>
1 parent f2c7c76 commit 7c33277

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎samples/pidfd/pidfd-metadata.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
#define CLONE_PIDFD 0x00001000
2222
#endif
2323

24+
#ifndef __NR_pidfd_send_signal
25+
#define __NR_pidfd_send_signal -1
26+
#endif
27+
2428
static int do_child(void *args)
2529
{
2630
printf("%d\n", getpid());

0 commit comments

Comments
 (0)