Deleted Added
full compact
kern_proc.c (41038) kern_proc.c (41086)
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.37 1998/07/11 07:45:40 bde Exp $
34 * $Id: kern_proc.c,v 1.38 1998/11/09 15:07:41 truckman 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>
43#include <sys/tty.h>
44#include <sys/signalvar.h>
45#include <vm/vm.h>
46#include <sys/lock.h>
47#include <vm/pmap.h>
48#include <vm/vm_map.h>
49#include <sys/user.h>
50#include <vm/vm_zone.h>
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>
43#include <sys/tty.h>
44#include <sys/signalvar.h>
45#include <vm/vm.h>
46#include <sys/lock.h>
47#include <vm/pmap.h>
48#include <vm/vm_map.h>
49#include <sys/user.h>
50#include <vm/vm_zone.h>
51#include <sys/filedesc.h>
51
52static MALLOC_DEFINE(M_PGRP, "pgrp", "process group header");
53MALLOC_DEFINE(M_SESSION, "session", "session header");
54static MALLOC_DEFINE(M_PROC, "proc", "Proc structures");
55MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures");
56
57struct prochd qs[NQS]; /* as good a place as any... */
58struct prochd rtqs[NQS]; /* Space for REALTIME queues too */

--- 179 unchanged lines hidden (view full) ---

238 } else {
239 pgrp->pg_session = p->p_session;
240 pgrp->pg_session->s_count++;
241 }
242 pgrp->pg_id = pgid;
243 LIST_INIT(&pgrp->pg_members);
244 LIST_INSERT_HEAD(PGRPHASH(pgid), pgrp, pg_hash);
245 pgrp->pg_jobc = 0;
52
53static MALLOC_DEFINE(M_PGRP, "pgrp", "process group header");
54MALLOC_DEFINE(M_SESSION, "session", "session header");
55static MALLOC_DEFINE(M_PROC, "proc", "Proc structures");
56MALLOC_DEFINE(M_SUBPROC, "subproc", "Proc sub-structures");
57
58struct prochd qs[NQS]; /* as good a place as any... */
59struct prochd rtqs[NQS]; /* Space for REALTIME queues too */

--- 179 unchanged lines hidden (view full) ---

239 } else {
240 pgrp->pg_session = p->p_session;
241 pgrp->pg_session->s_count++;
242 }
243 pgrp->pg_id = pgid;
244 LIST_INIT(&pgrp->pg_members);
245 LIST_INSERT_HEAD(PGRPHASH(pgid), pgrp, pg_hash);
246 pgrp->pg_jobc = 0;
247 SLIST_INIT(&pgrp->pg_sigiolst);
246 } else if (pgrp == p->p_pgrp)
247 return (0);
248
249 /*
250 * Adjust eligibility of affected pgrps to participate in job control.
251 * Increment eligibility counts before decrementing, otherwise we
252 * could reach 0 spuriously during the first call.
253 */

--- 26 unchanged lines hidden (view full) ---

280/*
281 * delete a process group
282 */
283static void
284pgdelete(pgrp)
285 register struct pgrp *pgrp;
286{
287
248 } else if (pgrp == p->p_pgrp)
249 return (0);
250
251 /*
252 * Adjust eligibility of affected pgrps to participate in job control.
253 * Increment eligibility counts before decrementing, otherwise we
254 * could reach 0 spuriously during the first call.
255 */

--- 26 unchanged lines hidden (view full) ---

282/*
283 * delete a process group
284 */
285static void
286pgdelete(pgrp)
287 register struct pgrp *pgrp;
288{
289
290 /*
291 * Reset any sigio structures pointing to us as a result of
292 * F_SETOWN with our pgid.
293 */
294 funsetownlst(&pgrp->pg_sigiolst);
295
288 if (pgrp->pg_session->s_ttyp != NULL &&
289 pgrp->pg_session->s_ttyp->t_pgrp == pgrp)
290 pgrp->pg_session->s_ttyp->t_pgrp = NULL;
291 LIST_REMOVE(pgrp, pg_hash);
292 if (--pgrp->pg_session->s_count == 0)
293 FREE(pgrp->pg_session, M_SESSION);
294 FREE(pgrp, M_PGRP);
295}

--- 305 unchanged lines hidden ---
296 if (pgrp->pg_session->s_ttyp != NULL &&
297 pgrp->pg_session->s_ttyp->t_pgrp == pgrp)
298 pgrp->pg_session->s_ttyp->t_pgrp = NULL;
299 LIST_REMOVE(pgrp, pg_hash);
300 if (--pgrp->pg_session->s_count == 0)
301 FREE(pgrp->pg_session, M_SESSION);
302 FREE(pgrp, M_PGRP);
303}

--- 305 unchanged lines hidden ---