diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2019-05-30 07:40:47 -0400 |
|---|---|---|
| committer | Christian Brauner <christian@brauner.io> | 2019-06-05 09:06:07 -0400 |
| commit | 7c33277b9a9ada187f805b41ffbebe6c51622fb6 (patch) | |
| tree | 8c34fbee42a6e803bc4d96f91ed20dbacf5229c7 | |
| parent | f2c7c76c5d0a443053e94adb9f0918fa2fb85c3a (diff) | |
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: 43c6afee48d4 ("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>
| -rw-r--r-- | samples/pidfd/pidfd-metadata.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/pidfd/pidfd-metadata.c b/samples/pidfd/pidfd-metadata.c index 640f5f757c57..14b454448429 100644 --- a/samples/pidfd/pidfd-metadata.c +++ b/samples/pidfd/pidfd-metadata.c | |||
| @@ -21,6 +21,10 @@ | |||
| 21 | #define CLONE_PIDFD 0x00001000 | 21 | #define CLONE_PIDFD 0x00001000 |
| 22 | #endif | 22 | #endif |
| 23 | 23 | ||
| 24 | #ifndef __NR_pidfd_send_signal | ||
| 25 | #define __NR_pidfd_send_signal -1 | ||
| 26 | #endif | ||
| 27 | |||
| 24 | static int do_child(void *args) | 28 | static int do_child(void *args) |
| 25 | { | 29 | { |
| 26 | printf("%d\n", getpid()); | 30 | printf("%d\n", getpid()); |
