Lines Matching defs:parent
133 void thread_set_parent(thread_t parent, int pid);
142 thread_t procdup(proc_t parent, proc_t child);
157 * !0 pid of child (to parent process)
164 * Note: After a successful call to this function, the parent process
173 * changes in the parent state, and, if inheritable, the child
180 vfork(proc_t parent, __unused struct vfork_args *uap, register_t *retval)
216 (rlim_t)count > parent->p_rlimit[RLIMIT_NPROC].rlim_cur) {
223 printf("vfork called recursively by %s\n", parent->p_comm);
233 err = mac_proc_check_fork(parent);
240 proc_lock(parent);
241 parent->p_lflag |= P_LVFORK;
242 parent->p_vforkcnt++;
243 proc_unlock(parent);
246 if ((child = forkproc(parent,1)) == NULL) {
254 proc_lock(parent);
255 parent->p_lflag &= ~P_LVFORK;
256 parent->p_vforkcnt--;
257 proc_unlock(parent);
263 /* that we referenced from the parent ... with the child */
272 child->task = parent->task;
275 pinsertchild(parent, child);
320 * Description: "Return" to parent vfork thread() following execve/_exit;
321 * this is done by reassociating the parent process structure
326 * rval Return value to present to parent
330 * Note: The caller resumes or exits the parent, as appropriate, after
336 proc_t parent = child->p_pptr;
345 proc_lock(parent);
346 parent->p_vforkcnt--;
347 if (parent->p_vforkcnt <0)
349 if (parent->p_vforkcnt <=0)
350 parent->p_lflag &= ~P_LVFORK;
351 proc_unlock(parent);
368 retval[1] = 0; /* mark parent */
381 * Parameters: parent_task parent task
396 * process 'child'. If the parent process address space is to
427 /* Propagate CPU limit timer from parent */
443 /* Set child scheduler priority if nice value inherited from parent */
464 * Description: Givben a parent process, provide a duplicate task and thread
465 * for a child process of that parent.
467 * Parameters: parent Parent process to use as the template
485 * In that specific case, we will *not* pass a parent task, since
486 * there is *not* parent task present to pass.
494 procdup(proc_t parent, proc_t child)
499 if (parent->task == kernel_task)
502 child_thread = fork_create_child(parent->task, child, TRUE, (parent->p_flag & P_LP64));
506 if (parent->p_flag & P_LP64) {
533 * Parameters: parent Parent process to fork
541 fork(proc_t parent, __unused struct fork_args *uap, register_t *retval)
577 (rlim_t)count > parent->p_rlimit[RLIMIT_NPROC].rlim_cur) {
587 err = mac_proc_check_fork(parent);
595 if ((newth = cloneproc(parent, 1)) == NULL) {
629 * lock. A full sprlock would task_suspend the parent.
631 lck_mtx_lock(&parent->p_dtrace_sprlock);
638 if (parent->p_dtrace_count > 0) {
639 dtrace_fasttrap_fork(parent, child);
642 lck_mtx_unlock(&parent->p_dtrace_sprlock);
646 * holding the parent sprlock! Lock ordering is dtrace_dof_mode_lock,
654 dtrace_lazy_dofs_duplicate(parent, child);
665 if (parent->p_dtrace_helpers != NULL && dtrace_helpers_fork) {
666 (*dtrace_helpers_fork)(parent, child);
684 proc_knote(parent, NOTE_FORK | child->p_pid);
687 retval[1] = 0; /* flag parent */
699 * Parameters: parent The parent process of the process to
720 cloneproc(proc_t parent, int lock)
725 if ((child = forkproc(parent,lock)) == NULL) {
730 if ((th = procdup(parent, child)) == NULL) {
740 pinsertchild(parent, child);
835 * Description: Create a new process structure, given a parent process
838 * Parameters: parent The parent process
850 forkproc(proc_t parent, int lock)
951 * to hash. Copy the section that is to be copied directly from the parent.
953 bcopy(&parent->p_startcopy, &child->p_startcopy,
957 * Some flags are inherited from the parent.
962 child->p_flag = (parent->p_flag & (P_LP64 | P_TRANSLATED | P_AFFINITY));
963 if (parent->p_flag & P_PROFIL)
991 child->p_fd = fdcopy(parent, uth_parent->uu_cdir);
994 if (parent->vm_shm) {
996 (void)shmfork(parent,child);
1002 proc_limitfork(parent, child);
1015 if (parent->p_sigacts != NULL)
1017 parent->p_sigacts, sizeof *child->p_sigacts);
1021 sessp = proc_session(parent);
1022 if (sessp->s_ttyvp != NULL && parent->p_flag & P_CONTROLT)
1035 /* Inherit the parent flags for code sign */
1036 child->p_csflags = parent->p_csflags;
1037 child->p_wqthread = parent->p_wqthread;
1038 child->p_threadstart = parent->p_threadstart;
1039 child->p_pthsize = parent->p_pthsize;
1045 if (parent->p_lctx != NULL) {
1046 LCTX_LOCK(parent->p_lctx);
1047 enterlctx(child, parent->p_lctx, 0);
1139 * XXX of parent thread, so a direct reference to the parent