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_exit.c 8.7 (Berkeley) 2/12/94 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/kern/kern_exit.c 159054 2006-05-29 21:28:56Z tegge $"); |
39 40#include "opt_compat.h" 41#include "opt_ktrace.h" 42#include "opt_mac.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/sysproto.h> --- 61 unchanged lines hidden (view full) --- 108 * status and rusage for wait(). Check for child processes and orphan them. 109 */ 110void 111exit1(struct thread *td, int rv) 112{ 113 struct proc *p, *nq, *q; 114 struct tty *tp; 115 struct vnode *ttyvp; |
116 struct vnode *vtmp; 117#ifdef KTRACE 118 struct vnode *tracevp; 119 struct ucred *tracecred; 120#endif 121 struct plimit *plim; |
122 int locked; |
123 124 /* 125 * Drop Giant if caller has it. Eventually we should warn about 126 * being called with Giant held. 127 */ 128 while (mtx_owned(&Giant)) 129 mtx_unlock(&Giant); 130 --- 163 unchanged lines hidden (view full) --- 294 q = p->p_leader; 295 while (q->p_peers != p) 296 q = q->p_peers; 297 q->p_peers = p->p_peers; 298 wakeup(p->p_leader); 299 } 300 mtx_unlock(&ppeers_lock); 301 |
302 vmspace_exit(td); |
303 304 sx_xlock(&proctree_lock); 305 if (SESS_LEADER(p)) { 306 struct session *sp; 307 308 sp = p->p_session; 309 if (sp->s_ttyvp) { 310 locked = VFS_LOCK_GIANT(sp->s_ttyvp->v_mount); --- 593 unchanged lines hidden --- |