pidfd fixes for v5.2-rc4

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE7btrcuORLb1XUhEwjrBW1T7ssS0FAlz3v20ACgkQjrBW1T7s
 sS1rbw//clR7YbczqO1Og5W3Bpg2JdPPQjXyfomO9gqPsOuOaRFQ4vmhvrCnavN1
 4SdXm3QzXZ30fnhgtoPzrNgPrZBU4DzGq7V8G6NCWxu0wsWJrYOy++FK6WpW3ngB
 AFRRWCwuI9u3xEu/0xXgd2UtM2Wy9rmu5PNa/BDkIYx33F56Lz0aIQrzrYKX3a+W
 DroRiPpNTrrThFyFUH1pPs0rZHWDY9l90drq7QxZB5+7irktHHKiywL71N4gy7Wj
 Hje7P5pc3Zkj2qNKT1im/ccSWdApOrTlzDrIx5GLJpZCycVlCwcGRF8F1+l6g/Pg
 AV3ABMo2k5SLQ+q/3PzlCFhmIvPL/ucly+l7KbYrwwb0Zn+QKuwc+Z8vFJt3daeQ
 BZPrxWse3Iwjg2S/b4tyrbxowS6SmPGQ7Dmk62q7nffgsb161uypz1/p/dLmgL9b
 W1bY12bZHB/nr0smTewQk1N15dvxnsViFa1oyAdJjtngbA448nCQnZklFIaEl4Mo
 NngcgKSQrp4B7G+htcPCi5Jda1GE4blhed/fwDN9G4mbCBgnhG+GB8ABx46/tlpV
 A+dt0Bm88lNZETqNBQHFqE0nOaNzzdCGteHCx+61ZhX1eaFNRb3AaLsrGs9PR4zY
 PVrvwmMksnTZ5Wc3YYeSHbC7IlkMdB8tbi+HFbZapPucu+33VFA=
 =KySr
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2019-06-05 13:03:36 -07:00
commit db309f2aed
3 changed files with 13 additions and 6 deletions

View File

@ -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 * sys_pidfd_send_signal - Signal a process through a pidfd
* descriptor * @pidfd: file descriptor of the process
* @pidfd: the file descriptor of the process * @sig: signal to send
* @sig: signal to be sent * @info: signal info
* @info: the signal info * @flags: future flags
* @flags: future flags to be passed
* *
* The syscall currently only signals via PIDTYPE_PID which covers * The syscall currently only signals via PIDTYPE_PID which covers
* kill(<positive-pid>, <signal>. It does not signal threads or process * kill(<positive-pid>, <signal>. It does not signal threads or process

View File

@ -21,6 +21,10 @@
#define CLONE_PIDFD 0x00001000 #define CLONE_PIDFD 0x00001000
#endif #endif
#ifndef __NR_pidfd_send_signal
#define __NR_pidfd_send_signal -1
#endif
static int do_child(void *args) static int do_child(void *args)
{ {
printf("%d\n", getpid()); printf("%d\n", getpid());

View File

@ -16,6 +16,10 @@
#include "../kselftest.h" #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, static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
unsigned int flags) unsigned int flags)
{ {