Fold it into pidfd_prepare() and rename PIDFD_CLONE to PIDFD_STALE to indicate that the passed pid might not have task linkage and no explicit check for that should be performed.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -12,7 +12,7 @@ · 11 unmodified lines | |||
| 12 | #define PIDFD_THREAD O_EXCL | 12 | #define PIDFD_THREAD O_EXCL |
| 13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | #define PIDFD_CLONE CLONE_PIDFD | 15 | #define PIDFD_STALE CLONE_PIDFD |
| 16 | #endif | 16 | #endif |
| 17 | 17 | ||
| 18 | /* Flags for pidfd_send_signal(). */ | 18 | /* Flags for pidfd_send_signal(). */ |