upid
__u8 upid;
struct upid numbers[];
pid_t upid;
iw->upid = READ_ONCE(sqe->fd);
ret = kernel_waitid_prepare(&iwa->wo, iw->which, iw->upid, &iw->info,
int kernel_waitid_prepare(struct wait_opts *wo, int which, pid_t upid,
if (upid <= 0)
pid = find_get_pid(upid);
if (upid < 0)
if (upid)
pid = find_get_pid(upid);
if (upid < 0)
pid = pidfd_get_pid(upid, &f_flags);
static long kernel_waitid(int which, pid_t upid, struct waitid_info *infop,
ret = kernel_waitid_prepare(&wo, which, upid, infop, options, ru);
SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
long err = kernel_waitid(which, upid, &info, options, ru ? &r : NULL);
long kernel_wait4(pid_t upid, int __user *stat_addr, int options,
if (upid == INT_MIN)
if (upid == -1)
else if (upid < 0) {
pid = find_get_pid(-upid);
} else if (upid == 0) {
pid = find_get_pid(upid);
SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr,
long err = kernel_wait4(upid, stat_addr, options, ru ? &r : NULL);
int kernel_waitid_prepare(struct wait_opts *wo, int which, pid_t upid,
struct upid *upid = pid->numbers + i;
struct pid_namespace *ns = upid->ns;
idr_remove(&ns->idr, upid->nr);
struct upid *upid;
for (upid = pid->numbers + ns->level; upid >= pid->numbers; --upid) {
idr_replace(&upid->ns->idr, pid, upid->nr);
upid->ns->pid_allocated++;
upid = pid->numbers + i;
idr_remove(&upid->ns->idr, upid->nr);
struct upid *upid;
upid = &pid->numbers[ns->level];
if (upid->ns == ns)
nr = upid->nr;
const pid_t upid = CPUCLOCK_PID(clock);
if (upid == 0)
pid = find_vpid(upid);