Lines Matching refs:pid
1956 init_task_pid(struct task_struct *task, enum pid_type type, struct pid *pid) in init_task_pid() argument
1959 task->thread_pid = pid; in init_task_pid()
1961 task->signal->pids[type] = pid; in init_task_pid()
1985 struct pid *pidfd_pid(const struct file *file) in pidfd_pid()
1995 struct pid *pid = file->private_data; in pidfd_release() local
1998 put_pid(pid); in pidfd_release()
2040 struct pid *pid = f->private_data; in pidfd_show_fdinfo() local
2044 if (likely(pid_has_task(pid, PIDTYPE_PID))) { in pidfd_show_fdinfo()
2046 nr = pid_nr_ns(pid, ns); in pidfd_show_fdinfo()
2061 for (i = ns->level + 1; i <= pid->level; i++) in pidfd_show_fdinfo()
2062 seq_put_decimal_ll(m, "\t", pid->numbers[i].nr); in pidfd_show_fdinfo()
2074 struct pid *pid = file->private_data; in pidfd_poll() local
2077 poll_wait(file, &pid->wait_pidfd, pts); in pidfd_poll()
2084 if (thread_group_exited(pid)) in pidfd_poll()
2126 static int __pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret) in __pidfd_prepare() argument
2138 pidfd_file = anon_inode_getfile("[pidfd]", &pidfd_fops, pid, in __pidfd_prepare()
2144 get_pid(pid); /* held by pidfd_file now */ in __pidfd_prepare()
2175 int pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret) in pidfd_prepare() argument
2177 if (!pid || !pid_has_task(pid, PIDTYPE_TGID)) in pidfd_prepare()
2180 return __pidfd_prepare(pid, flags, ret); in pidfd_prepare()
2238 struct pid *pid, in copy_process() argument
2513 if (pid != &init_struct_pid) { in copy_process()
2514 pid = alloc_pid(p->nsproxy->pid_ns_for_children, args->set_tid, in copy_process()
2516 if (IS_ERR(pid)) { in copy_process()
2517 retval = PTR_ERR(pid); in copy_process()
2529 retval = __pidfd_prepare(pid, O_RDWR | O_CLOEXEC, &pidfile); in copy_process()
2562 p->pid = pid_nr(pid); in copy_process()
2568 p->tgid = p->pid; in copy_process()
2650 if (unlikely(!(ns_of_pid(pid)->pid_allocated & PIDNS_ADDING))) { in copy_process()
2670 if (likely(p->pid)) { in copy_process()
2673 init_task_pid(p, PIDTYPE_PID, pid); in copy_process()
2675 init_task_pid(p, PIDTYPE_TGID, pid); in copy_process()
2679 if (is_child_reaper(pid)) { in copy_process()
2680 ns_of_pid(pid)->child_reaper = p; in copy_process()
2745 if (pid != &init_struct_pid) in copy_process()
2746 free_pid(pid); in copy_process()
2869 struct pid *pid; in kernel_clone() local
2918 pid = get_task_pid(p, PIDTYPE_PID); in kernel_clone()
2919 nr = pid_vnr(pid); in kernel_clone()
2941 ptrace_event_pid(trace, pid); in kernel_clone()
2945 ptrace_event_pid(PTRACE_EVENT_VFORK_DONE, pid); in kernel_clone()
2948 put_pid(pid); in kernel_clone()