Commit 7c33277b authored by Guenter Roeck's avatar Guenter Roeck Committed by Christian Brauner

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: 43c6afee ("samples: show race-free pidfd metadata access")
Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
Cc: Christian Brauner <christian@brauner.io>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
[christian@brauner.io: tweak commit message]
Signed-off-by: default avatarChristian Brauner <christian@brauner.io>
parent f2c7c76c
......@@ -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());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment