[linux-yocto] [PATCH] samples: fix pidfd-metadata compilation

He Zhe zhe.he at windriver.com
Mon Jun 10 22:00:15 PDT 2019


Please ignore.

On 6/11/19 11:38 AM, zhe.he at windriver.com wrote:
> From: Guenter Roeck <linux at roeck-us.net>
>
> 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 at arndb.de>
> Reported-by: Guenter Roeck <linux at roeck-us.net>
> Cc: Christian Brauner <christian at brauner.io>
> Signed-off-by: Guenter Roeck <linux at roeck-us.net>
> [christian at brauner.io: tweak commit message]
> Signed-off-by: Christian Brauner <christian at brauner.io>
> ---
>  samples/pidfd/pidfd-metadata.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/samples/pidfd/pidfd-metadata.c b/samples/pidfd/pidfd-metadata.c
> index 640f5f7..14b4544 100644
> --- a/samples/pidfd/pidfd-metadata.c
> +++ b/samples/pidfd/pidfd-metadata.c
> @@ -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());



More information about the linux-yocto mailing list