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: 43c6afee48
("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>
This commit is contained in:
parent
f2c7c76c5d
commit
7c33277b9a
|
@ -21,6 +21,10 @@
|
|||
#define CLONE_PIDFD 0x00001000
|
||||
#endif
|
||||
|
||||
#ifndef __NR_pidfd_send_signal
|
||||
#define __NR_pidfd_send_signal -1
|
||||
#endif
|
||||
|
||||
static int do_child(void *args)
|
||||
{
|
||||
printf("%d\n", getpid());
|
||||
|
|
Loading…
Reference in a new issue