Lines Matching refs:pid

1165  * This changes mm's executable file (shown as symlink /proc/[pid]/exe).
1699 init_task_pid(struct task_struct *task, enum pid_type type, struct pid *pid)
1702 task->thread_pid = pid;
1704 task->signal->pids[type] = pid;
1727 struct pid *pidfd_pid(const struct file *file)
1737 struct pid *pid = file->private_data;
1740 put_pid(pid);
1751 * This function will print the pid that a given pidfd refers to in the
1752 * pid namespace of the procfs instance.
1753 * If the pid namespace of the process is not a descendant of the pid
1754 * namespace of the procfs instance 0 will be shown as its pid. This is
1756 * its pid namespace.
1759 * If pid namespaces are supported then this function will also print
1760 * the pid of a given pidfd refers to for all descendant pid namespaces
1761 * starting from the current pid namespace of the instance, i.e. the
1763 * If the pid namespace of the process is not a descendant of the pid
1767 * /proc/<pid>/status where Pid and NSpid are always shown relative to
1768 * the pid namespace of the procfs instance. The difference becomes
1769 * obvious when sending around a pidfd between pid namespaces from a
1771 * present between the pid namespaces:
1772 * - create two new pid namespaces ns1 and ns2 in the initial pid
1774 * new pid namespace and mount procfs)
1782 struct pid *pid = f->private_data;
1786 if (likely(pid_has_task(pid, PIDTYPE_PID))) {
1788 nr = pid_nr_ns(pid, ns);
1798 /* If nr is non-zero it means that 'pid' is valid and that
1799 * ns, i.e. the pid namespace associated with the procfs
1800 * instance, is in the pid namespace hierarchy of pid.
1803 for (i = ns->level + 1; i <= pid->level; i++)
1804 seq_put_decimal_ll(m, "\t", pid->numbers[i].nr);
1816 struct pid *pid = file->private_data;
1819 poll_wait(file, &pid->wait_pidfd, pts);
1826 if (thread_group_exited(pid))
1883 struct pid *pid,
1931 * If the new process will be in a different pid or user namespace
2164 if (pid != &init_struct_pid) {
2165 pid = alloc_pid(p->nsproxy->pid_ns_for_children, args->set_tid,
2167 if (IS_ERR(pid)) {
2168 retval = PTR_ERR(pid);
2185 pidfile = anon_inode_getfile("[pidfd]", &pidfd_fops, pid,
2192 get_pid(pid); /* held by pidfile now */
2222 p->pid = pid_nr(pid);
2228 p->tgid = p->pid;
2287 /* Don't start children in a dying pid namespace */
2288 if (unlikely(!(ns_of_pid(pid)->pid_allocated & PIDNS_ADDING))) {
2308 if (likely(p->pid)) {
2311 init_task_pid(p, PIDTYPE_PID, pid);
2313 init_task_pid(p, PIDTYPE_TGID, pid);
2317 if (is_child_reaper(pid)) {
2318 ns_of_pid(pid)->child_reaper = p;
2380 if (pid != &init_struct_pid)
2381 free_pid(pid);
2493 struct pid *pid;
2542 pid = get_task_pid(p, PIDTYPE_PID);
2543 nr = pid_vnr(pid);
2559 ptrace_event_pid(trace, pid);
2563 ptrace_event_pid(PTRACE_EVENT_VFORK_DONE, pid);
2566 put_pid(pid);