1/*- 2 * Copyright (c) 1994 Christopher G. Demetriou 3 * Copyright (c) 1982, 1986, 1989, 1993 4 * The Regents of the University of California. All rights reserved. 5 * (c) UNIX System Laboratories, Inc. 6 * All or some portions of this file are derived from material licensed 7 * to the University of California by American Telephone and Telegraph 8 * Co. or Unix System Laboratories, Inc. and are reproduced herein with --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 40 */ 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/sys/kern/kern_acct.c 130640 2004-06-17 17:16:53Z phk $"); |
44 45#include "opt_mac.h" 46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/lock.h> 50#include <sys/mutex.h> 51#include <sys/sysproto.h> --- 228 unchanged lines hidden (view full) --- 280 acct.ac_uid = p->p_ucred->cr_ruid; 281 acct.ac_gid = p->p_ucred->cr_rgid; 282 283 /* (7) The terminal from which the process was started */ 284 SESS_LOCK(p->p_session); 285 if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp) 286 acct.ac_tty = dev2udev(p->p_pgrp->pg_session->s_ttyp->t_dev); 287 else |
288 acct.ac_tty = NODEV; |
289 SESS_UNLOCK(p->p_session); 290 291 /* (8) The boolean flags that tell how the process terminated, etc. */ 292 acct.ac_flag = p->p_acflag; 293 PROC_UNLOCK(p); 294 295 /* 296 * Finish doing things that require acct_mtx, and release acct_mtx. --- 131 unchanged lines hidden --- |