Lines Matching refs:pid

1396  * This changes mm's executable file (shown as symlink /proc/[pid]/exe).
1437 * This changes mm's executable file (shown as symlink /proc/[pid]/exe).
1962 init_task_pid(struct task_struct *task, enum pid_type type, struct pid *pid)
1965 task->thread_pid = pid;
1967 task->signal->pids[type] = pid;
1994 * @pid: the struct pid for which to create a pidfd
1998 * Allocate a new file that stashes @pid and reserve a new pidfd number in the
2001 * The helper doesn't perform checks on @pid which makes it useful for pidfds
2002 * created via CLONE_PIDFD where @pid has no task attached when the pidfd and
2020 static int __pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret)
2029 pidfd_file = pidfs_alloc_file(pid, flags | O_RDWR);
2045 * @pid: the struct pid for which to create a pidfd
2049 * Allocate a new file that stashes @pid and reserve a new pidfd number in the
2052 * The helper verifies that @pid is still in use, without PIDFD_THREAD the
2053 * task identified by @pid must be a thread-group leader.
2070 int pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret)
2074 if (!pid || !pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID))
2077 return __pidfd_prepare(pid, flags, ret);
2135 struct pid *pid,
2183 * If the new process will be in a different pid or user namespace
2405 if (pid != &init_struct_pid) {
2406 pid = alloc_pid(p->nsproxy->pid_ns_for_children, args->set_tid,
2408 if (IS_ERR(pid)) {
2409 retval = PTR_ERR(pid);
2422 /* Note that no task has been attached to @pid yet. */
2423 retval = __pidfd_prepare(pid, flags, &pidfile);
2456 p->pid = pid_nr(pid);
2462 p->tgid = p->pid;
2542 /* Don't start children in a dying pid namespace */
2543 if (unlikely(!(ns_of_pid(pid)->pid_allocated & PIDNS_ADDING))) {
2563 if (likely(p->pid)) {
2566 init_task_pid(p, PIDTYPE_PID, pid);
2568 init_task_pid(p, PIDTYPE_TGID, pid);
2572 if (is_child_reaper(pid)) {
2573 ns_of_pid(pid)->child_reaper = p;
2636 if (pid != &init_struct_pid)
2637 free_pid(pid);
2760 struct pid *pid;
2809 pid = get_task_pid(p, PIDTYPE_PID);
2810 nr = pid_vnr(pid);
2832 ptrace_event_pid(trace, pid);
2836 ptrace_event_pid(PTRACE_EVENT_VFORK_DONE, pid);
2839 put_pid(pid);