1
0
Fork 0

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>
hifive-unleashed-5.2
Guenter Roeck 2019-05-30 04:40:47 -07:00 committed by Christian Brauner
parent f2c7c76c5d
commit 7c33277b9a
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D
1 changed files with 4 additions and 0 deletions

View File

@ -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());