kern_proc.c (46381) | kern_proc.c (46568) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 |
34 * $Id: kern_proc.c,v 1.47 1999/04/28 11:36:57 phk Exp $ | 34 * $Id: kern_proc.c,v 1.48 1999/05/03 23:57:21 billf Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> 40#include <sys/sysctl.h> 41#include <sys/proc.h> 42#include <sys/malloc.h> --- 273 unchanged lines hidden (view full) --- 316 register struct pgrp *hispgrp; 317 register struct session *mysession = pgrp->pg_session; 318 319 /* 320 * Check p's parent to see whether p qualifies its own process 321 * group; if so, adjust count for p's process group. 322 */ 323 if ((hispgrp = p->p_pptr->p_pgrp) != pgrp && | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> 40#include <sys/sysctl.h> 41#include <sys/proc.h> 42#include <sys/malloc.h> --- 273 unchanged lines hidden (view full) --- 316 register struct pgrp *hispgrp; 317 register struct session *mysession = pgrp->pg_session; 318 319 /* 320 * Check p's parent to see whether p qualifies its own process 321 * group; if so, adjust count for p's process group. 322 */ 323 if ((hispgrp = p->p_pptr->p_pgrp) != pgrp && |
324 hispgrp->pg_session == mysession) | 324 hispgrp->pg_session == mysession) { |
325 if (entering) 326 pgrp->pg_jobc++; 327 else if (--pgrp->pg_jobc == 0) 328 orphanpg(pgrp); | 325 if (entering) 326 pgrp->pg_jobc++; 327 else if (--pgrp->pg_jobc == 0) 328 orphanpg(pgrp); |
329 } |
|
329 330 /* 331 * Check this process' children to see whether they qualify 332 * their process groups; if so, adjust counts for children's 333 * process groups. 334 */ 335 for (p = p->p_children.lh_first; p != 0; p = p->p_sibling.le_next) 336 if ((hispgrp = p->p_pgrp) != pgrp && 337 hispgrp->pg_session == mysession && | 330 331 /* 332 * Check this process' children to see whether they qualify 333 * their process groups; if so, adjust counts for children's 334 * process groups. 335 */ 336 for (p = p->p_children.lh_first; p != 0; p = p->p_sibling.le_next) 337 if ((hispgrp = p->p_pgrp) != pgrp && 338 hispgrp->pg_session == mysession && |
338 p->p_stat != SZOMB) | 339 p->p_stat != SZOMB) { |
339 if (entering) 340 hispgrp->pg_jobc++; 341 else if (--hispgrp->pg_jobc == 0) 342 orphanpg(hispgrp); | 340 if (entering) 341 hispgrp->pg_jobc++; 342 else if (--hispgrp->pg_jobc == 0) 343 orphanpg(hispgrp); |
344 } |
|
343} 344 345/* 346 * A process group has become orphaned; 347 * if there are any stopped processes in the group, 348 * hang-up all process in that group. 349 */ 350static void --- 246 unchanged lines hidden --- | 345} 346 347/* 348 * A process group has become orphaned; 349 * if there are any stopped processes in the group, 350 * hang-up all process in that group. 351 */ 352static void --- 246 unchanged lines hidden --- |