Deleted Added
full compact
kern_fork.c (173361) kern_fork.c (173601)
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>
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 173361 2007-11-05 11:36:16Z kib $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_fork.c 173601 2007-11-14 06:51:33Z julian $");
39
40#include "opt_ktrace.h"
41#include "opt_mac.h"
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/sysproto.h>
46#include <sys/eventhandler.h>

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

759 struct thread *td;
760 struct thread *dtd;
761
762 td = curthread;
763 p = td->td_proc;
764 KASSERT(p->p_state == PRS_NORMAL, ("executing process is still new"));
765
766 CTR4(KTR_PROC, "fork_exit: new thread %p (kse %p, pid %d, %s)",
39
40#include "opt_ktrace.h"
41#include "opt_mac.h"
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/sysproto.h>
46#include <sys/eventhandler.h>

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

759 struct thread *td;
760 struct thread *dtd;
761
762 td = curthread;
763 p = td->td_proc;
764 KASSERT(p->p_state == PRS_NORMAL, ("executing process is still new"));
765
766 CTR4(KTR_PROC, "fork_exit: new thread %p (kse %p, pid %d, %s)",
767 td, td->td_sched, p->p_pid, p->p_comm);
767 td, td->td_sched, p->p_pid, td->td_name);
768
769 sched_fork_exit(td);
770 /*
771 * Processes normally resume in mi_switch() after being
772 * cpu_switch()'ed to, but when children start up they arrive here
773 * instead, so we must do much the same things as mi_switch() would.
774 */
775 if ((dtd = PCPU_GET(deadthread))) {

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

787 callout(arg, frame);
788
789 /*
790 * Check if a kernel thread misbehaved and returned from its main
791 * function.
792 */
793 if (p->p_flag & P_KTHREAD) {
794 printf("Kernel thread \"%s\" (pid %d) exited prematurely.\n",
768
769 sched_fork_exit(td);
770 /*
771 * Processes normally resume in mi_switch() after being
772 * cpu_switch()'ed to, but when children start up they arrive here
773 * instead, so we must do much the same things as mi_switch() would.
774 */
775 if ((dtd = PCPU_GET(deadthread))) {

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

787 callout(arg, frame);
788
789 /*
790 * Check if a kernel thread misbehaved and returned from its main
791 * function.
792 */
793 if (p->p_flag & P_KTHREAD) {
794 printf("Kernel thread \"%s\" (pid %d) exited prematurely.\n",
795 p->p_comm, p->p_pid);
795 td->td_name, p->p_pid);
796 kproc_exit(0);
797 }
798 mtx_assert(&Giant, MA_NOTOWNED);
799
800 EVENTHANDLER_INVOKE(schedtail, p);
801}
802
803/*

--- 18 unchanged lines hidden ---
796 kproc_exit(0);
797 }
798 mtx_assert(&Giant, MA_NOTOWNED);
799
800 EVENTHANDLER_INVOKE(schedtail, p);
801}
802
803/*

--- 18 unchanged lines hidden ---