Lines Matching defs:child
145 static int reap_child_locked(proc_t parent, proc_t child, int deadparent, int locked, int droplock);
202 * status and rusage for wait(). Check for child processes and orphan them.
526 panic("parent child linkage broken");
585 * Save exit status and final rusage info, adding in child rusage
716 * Add child resource usage to parent before giving
816 * proc_t child Process to reap
823 reap_child_locked(proc_t parent, proc_t child, int deadparent, int locked, int droplock)
828 * If we got the child via a ptrace 'attach',
833 if (child->p_oppid && (trace_parent = proc_find(child->p_oppid))) {
834 proc_lock(child);
835 child->p_oppid = 0;
836 proc_unlock(child);
840 * here as child is dead and is not reaped or
844 trace_parent->si_pid = child->p_pid;
845 trace_parent->si_status = child->p_xstat;
847 trace_parent->si_uid = child->p_ucred->cr_ruid;
850 proc_reparentlocked(child, trace_parent, 1, 0);
854 child->p_listflag &= ~P_LIST_WAITING;
855 wakeup(&child->p_stat);
863 proc_knote(child, NOTE_REAP);
865 child->p_xstat = 0;
866 if (child->p_ru) {
878 ruadd(&parent->p_stats->p_cru, child->p_ru);
880 FREE_ZONE(child->p_ru, sizeof *child->p_ru, M_ZOMBIE);
881 child->p_ru = NULL;
883 printf("Warning : lost p_ru for %s\n", child->p_comm);
892 (void)chgproccnt(child->p_ucred->cr_ruid, -1);
896 leavelctx(child);
903 if (IS_VALID_CRED(child->p_ucred)) {
904 kauth_cred_unref(&child->p_ucred);
913 leavepgrp(child);
916 LIST_REMOVE(child, p_list); /* off zombproc */
918 LIST_REMOVE(child, p_sibling);
922 child->p_listflag &= ~P_LIST_WAITING;
923 wakeup(&child->p_stat);
926 LIST_REMOVE(child, p_hash);
927 child->p_listflag &= ~P_LIST_INHASH;
928 proc_checkdeadrefs(child);
933 lck_mtx_destroy(&child->p_mlock, proc_lck_grp);
934 lck_mtx_destroy(&child->p_fdmlock, proc_lck_grp);
936 lck_mtx_destroy(&child->p_dtrace_sprlock, proc_lck_grp);
938 lck_spin_destroy(&child->p_slock, proc_lck_grp);
939 workqueue_destroy_lock(child);
941 FREE_ZONE(child, sizeof *child, M_PROC);
1142 * Description: Suspend the calling thread until one child of the process
1185 case P_PID: /* child with process ID equal to... */
1186 case P_PGID: /* child with process group ID equal to... */
1190 case P_ALL: /* any child */
1200 case P_PID: /* child with process ID equal to... */
1204 case P_PGID: /* child with process group ID equal to... */
1208 case P_ALL: /* any child */
1388 /* Not a process we are interested in; go on to next child */
1395 /* No child processes that could possibly satisfy the request? */
1419 * make process 'parent' the new parent of process 'child'.
1422 proc_reparentlocked(proc_t child, proc_t parent, int cansignal, int locked)
1426 if (child->p_pptr == parent)
1432 oldparent = child->p_pptr;
1435 panic("proc_reparent: process %x does not have a parent\n", (unsigned int)child);
1438 LIST_REMOVE(child, p_sibling);
1448 LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
1450 child->p_pptr = parent;
1451 child->p_ppid = parent->p_pid;
1455 if ((cansignal != 0) && (initproc == parent) && (child->p_stat == SZOMB))
1483 * out of our parent's child chain.
1502 * status and rusage for wait(). Check for child processes and orphan them.
1543 * parent of a vfork child has already called exit() and the
1704 panic("parent child linkage broken");
1764 * Save exit status and final rusage info, adding in child rusage