Lines Matching defs:child

156 static int reap_child_locked(proc_t parent, proc_t child, int deadparent, int reparentedtoinit, int locked, int droplock);
243 * status and rusage for wait(). Check for child processes and orphan them.
659 panic("parent child linkage broken");
683 * Take a reference on the child process to
732 * Save exit status and final rusage info, adding in child rusage
820 * Add child resource usage to parent before giving
927 * proc_t child Process to reap
934 reap_child_locked(proc_t parent, proc_t child, int deadparent, int reparentedtoinit, int locked, int droplock)
942 * If we got the child via a ptrace 'attach',
951 if (child->p_oppid) {
955 proc_lock(child);
956 oppid = child->p_oppid;
957 child->p_oppid = 0;
958 knote_hint = NOTE_EXIT | (child->p_xstat & 0xffff);
959 proc_unlock(child);
967 * here as child is dead and is not reaped or
971 trace_parent->si_pid = child->p_pid;
972 trace_parent->si_status = child->p_xstat;
974 trace_parent->si_uid = kauth_cred_getruid(child->p_ucred);
977 proc_reparentlocked(child, trace_parent, 1, 0);
980 proc_knote(child, knote_hint);
985 child->p_listflag &= ~P_LIST_WAITING;
986 wakeup(&child->p_stat);
995 * If we can't reparent (e.g. the original parent exited while child was being debugged, or
998 * the NOTE_EXIT would not have been broadcast during initial child termination.
1000 proc_knote(child, knote_hint);
1007 proc_knote(child, NOTE_REAP);
1008 proc_knote_drain(child);
1010 child->p_xstat = 0;
1011 if (child->p_ru) {
1023 ruadd(&parent->p_stats->p_cru, child->p_ru);
1025 FREE_ZONE(child->p_ru, sizeof *child->p_ru, M_ZOMBIE);
1026 child->p_ru = NULL;
1028 printf("Warning : lost p_ru for %s\n", child->p_comm);
1031 AUDIT_SESSION_PROCEXIT(child);
1039 (void)chgproccnt(kauth_cred_getruid(child->p_ucred), -1);
1043 leavelctx(child);
1050 if (IS_VALID_CRED(child->p_ucred)) {
1051 kauth_cred_unref(&child->p_ucred);
1060 leavepgrp(child);
1063 LIST_REMOVE(child, p_list); /* off zombproc */
1065 LIST_REMOVE(child, p_sibling);
1069 child->p_listflag &= ~P_LIST_WAITING;
1070 wakeup(&child->p_stat);
1073 LIST_REMOVE(child, p_hash);
1074 child->p_listflag &= ~P_LIST_INHASH;
1075 proc_checkdeadrefs(child);
1081 lck_mtx_destroy(&child->p_mlock, proc_mlock_grp);
1082 lck_mtx_destroy(&child->p_fdmlock, proc_fdmlock_grp);
1084 lck_mtx_destroy(&child->p_dtrace_sprlock, proc_lck_grp);
1086 lck_spin_destroy(&child->p_slock, proc_slock_grp);
1088 lck_mtx_destroy(&child->p_mlock, proc_lck_grp);
1089 lck_mtx_destroy(&child->p_fdmlock, proc_lck_grp);
1091 lck_mtx_destroy(&child->p_dtrace_sprlock, proc_lck_grp);
1093 lck_spin_destroy(&child->p_slock, proc_lck_grp);
1095 workqueue_destroy_lock(child);
1097 FREE_ZONE(child, sizeof *child, M_PROC);
1212 * of a child process is available and there are no other
1330 * Description: Suspend the calling thread until one child of the process
1364 case P_PID: /* child with process ID equal to... */
1365 case P_PGID: /* child with process group ID equal to... */
1369 case P_ALL: /* any child */
1380 case P_PID: /* child with process ID equal to... */
1384 case P_PGID: /* child with process group ID equal to... */
1388 case P_ALL: /* any child */
1510 /* Not a process we are interested in; go on to next child */
1517 /* No child processes that could possibly satisfy the request? */
1556 * make process 'parent' the new parent of process 'child'.
1559 proc_reparentlocked(proc_t child, proc_t parent, int cansignal, int locked)
1563 if (child->p_pptr == parent)
1569 oldparent = child->p_pptr;
1572 panic("proc_reparent: process %p does not have a parent\n", child);
1575 LIST_REMOVE(child, p_sibling);
1585 LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
1587 child->p_pptr = parent;
1588 child->p_ppid = parent->p_pid;
1592 if ((cansignal != 0) && (initproc == parent) && (child->p_stat == SZOMB))
1601 * status and rusage for wait(). Check for child processes and orphan them.
1642 * parent of a vfork child has already called exit() and the
1797 panic("parent child linkage broken");
1860 * Save exit status and final rusage info, adding in child rusage