diff options
author | Linus Torvalds | 2019-06-05 13:03:36 -0700 |
---|---|---|
committer | Linus Torvalds | 2019-06-05 13:03:36 -0700 |
commit | db309f2aedb88a938e37a6eac02be7a7e0e850b1 (patch) | |
tree | 6940e53a08c84a7071084da3e3b7b71f2bc9c0fb | |
parent | 47358b647550d99d68b0d6c546355ea96e010efa (diff) | |
parent | 1fcd0eb356ad56c4e405f06e31dd9fde2109d5ab (diff) |
Merge tag 'pidfd-fixes-v5.2-rc4' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux
Pull pidfd fixes from Christian Brauner:
"The contains two small patches to the pidfd samples and test binaries
respectively.
They were lacking appropriate ifdefines for __NR_pidfd_send_signal and
could hence lead to compilation errors when that was not defined.
This was spotted on mips independently by Guenter Roeck (who was kind
enough to send a fix for the samples binary) and Arnd who spotted it
in linux-next.
Apart from these two patches, there's also a patch to update the
comments for the pidfd_send_signal() syscall which were slightly
wrong/inconsistenly worded"
* tag 'pidfd-fixes-v5.2-rc4' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux:
tests: fix pidfd-test compilation
signal: improve comments
samples: fix pidfd-metadata compilation
-rw-r--r-- | kernel/signal.c | 11 | ||||
-rw-r--r-- | samples/pidfd/pidfd-metadata.c | 4 | ||||
-rw-r--r-- | tools/testing/selftests/pidfd/pidfd_test.c | 4 |
3 files changed, 13 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 328a01e1a2f0..d622eac9d169 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3621,12 +3621,11 @@ static struct pid *pidfd_to_pid(const struct file *file) } /** - * sys_pidfd_send_signal - send a signal to a process through a task file - * descriptor - * @pidfd: the file descriptor of the process - * @sig: signal to be sent - * @info: the signal info - * @flags: future flags to be passed + * sys_pidfd_send_signal - Signal a process through a pidfd + * @pidfd: file descriptor of the process + * @sig: signal to send + * @info: signal info + * @flags: future flags * * The syscall currently only signals via PIDTYPE_PID which covers * kill(<positive-pid>, <signal>. It does not signal threads or process 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 @@ #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()); diff --git a/tools/testing/selftests/pidfd/pidfd_test.c b/tools/testing/selftests/pidfd/pidfd_test.c index 5bae1792e3d6..104c75a33882 100644 --- a/tools/testing/selftests/pidfd/pidfd_test.c +++ b/tools/testing/selftests/pidfd/pidfd_test.c @@ -16,6 +16,10 @@ #include "../kselftest.h" +#ifndef __NR_pidfd_send_signal +#define __NR_pidfd_send_signal -1 +#endif + static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info, unsigned int flags) { |