Deleted Added
full compact
kern_fork.c (108522) kern_fork.c (109623)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
1/*
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
39 * $FreeBSD: head/sys/kern/kern_fork.c 108522 2003-01-01 01:19:31Z alfred $
39 * $FreeBSD: head/sys/kern/kern_fork.c 109623 2003-01-21 08:56:16Z alfred $
40 */
41
42#include "opt_ktrace.h"
43#include "opt_mac.h"
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/sysproto.h>

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

301 /*
302 * All other activity in this process
303 * is now suspended at the user boundary,
304 * (or other safe places if we think of any).
305 */
306 }
307
308 /* Allocate new proc. */
40 */
41
42#include "opt_ktrace.h"
43#include "opt_mac.h"
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/sysproto.h>

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

301 /*
302 * All other activity in this process
303 * is now suspended at the user boundary,
304 * (or other safe places if we think of any).
305 */
306 }
307
308 /* Allocate new proc. */
309 newproc = uma_zalloc(proc_zone, M_WAITOK);
309 newproc = uma_zalloc(proc_zone, 0);
310#ifdef MAC
311 mac_init_proc(newproc);
312#endif
313
314 /*
315 * Although process entries are dynamically created, we still keep
316 * a global limit on the maximum number we will create. Don't allow
317 * a nonprivileged user to use the last ten processes; don't let root

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

426 LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash);
427 sx_xunlock(&allproc_lock);
428
429 /*
430 * Malloc things while we don't hold any locks.
431 */
432 if (flags & RFSIGSHARE) {
433 MALLOC(newsigacts, struct sigacts *,
310#ifdef MAC
311 mac_init_proc(newproc);
312#endif
313
314 /*
315 * Although process entries are dynamically created, we still keep
316 * a global limit on the maximum number we will create. Don't allow
317 * a nonprivileged user to use the last ten processes; don't let root

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

426 LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash);
427 sx_xunlock(&allproc_lock);
428
429 /*
430 * Malloc things while we don't hold any locks.
431 */
432 if (flags & RFSIGSHARE) {
433 MALLOC(newsigacts, struct sigacts *,
434 sizeof(struct sigacts), M_SUBPROC, M_WAITOK);
434 sizeof(struct sigacts), M_SUBPROC, 0);
435 newprocsig = NULL;
436 } else {
437 newsigacts = NULL;
438 MALLOC(newprocsig, struct procsig *, sizeof(struct procsig),
435 newprocsig = NULL;
436 } else {
437 newsigacts = NULL;
438 MALLOC(newprocsig, struct procsig *, sizeof(struct procsig),
439 M_SUBPROC, M_WAITOK);
439 M_SUBPROC, 0);
440 }
441
442 /*
443 * Copy filedesc.
444 * XXX: This is busted. fd*() need to not take proc
445 * arguments or something.
446 */
447 if (flags & RFCFDG)

--- 465 unchanged lines hidden ---
440 }
441
442 /*
443 * Copy filedesc.
444 * XXX: This is busted. fd*() need to not take proc
445 * arguments or something.
446 */
447 if (flags & RFCFDG)

--- 465 unchanged lines hidden ---