Deleted Added
sdiff udiff text old ( 211616 ) new ( 212357 )
full compact
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.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_fork.c 211616 2010-08-22 11:18:57Z rpaulo $");
39
40#include "opt_kdtrace.h"
41#include "opt_ktrace.h"
42#include "opt_kstack_pages.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>

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

666 * If PF_FORK is set, the child process inherits the
667 * procfs ioctl flags from its parent.
668 */
669 if (p1->p_pfsflags & PF_FORK) {
670 p2->p_stops = p1->p_stops;
671 p2->p_pfsflags = p1->p_pfsflags;
672 }
673
674#ifdef KDTRACE_HOOKS
675 /*
676 * Tell the DTrace fasttrap provider about the new process
677 * if it has registered an interest.
678 */
679 if (dtrace_fasttrap_fork)
680 dtrace_fasttrap_fork(p1, p2);
681#endif
682
683 /*
684 * This begins the section where we must prevent the parent
685 * from being swapped.
686 */
687 _PHOLD(p1);
688 PROC_UNLOCK(p1);
689
690 /*
691 * Attach the new process to its parent.

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

739
740 /*
741 * Set the child start time and mark the process as being complete.
742 */
743 microuptime(&p2->p_stats->p_start);
744 PROC_SLOCK(p2);
745 p2->p_state = PRS_NORMAL;
746 PROC_SUNLOCK(p2);
747
748 /*
749 * If RFSTOPPED not requested, make child runnable and add to
750 * run queue.
751 */
752 if ((flags & RFSTOPPED) == 0) {
753 thread_lock(td2);
754 TD_SET_CAN_RUN(td2);

--- 123 unchanged lines hidden ---