acct.h revision 2165
11541Srgrimes/*-
21541Srgrimes * Copyright (c) 1990, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes * (c) UNIX System Laboratories, Inc.
51541Srgrimes * All or some portions of this file are derived from material licensed
61541Srgrimes * to the University of California by American Telephone and Telegraph
71541Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with
81541Srgrimes * the permission of UNIX System Laboratories, Inc.
91541Srgrimes *
101541Srgrimes * Redistribution and use in source and binary forms, with or without
111541Srgrimes * modification, are permitted provided that the following conditions
121541Srgrimes * are met:
131541Srgrimes * 1. Redistributions of source code must retain the above copyright
141541Srgrimes *    notice, this list of conditions and the following disclaimer.
151541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
161541Srgrimes *    notice, this list of conditions and the following disclaimer in the
171541Srgrimes *    documentation and/or other materials provided with the distribution.
181541Srgrimes * 3. All advertising materials mentioning features or use of this software
191541Srgrimes *    must display the following acknowledgement:
201541Srgrimes *	This product includes software developed by the University of
211541Srgrimes *	California, Berkeley and its contributors.
221541Srgrimes * 4. Neither the name of the University nor the names of its contributors
231541Srgrimes *    may be used to endorse or promote products derived from this software
241541Srgrimes *    without specific prior written permission.
251541Srgrimes *
261541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
291541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
301541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
321541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
331541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361541Srgrimes * SUCH DAMAGE.
371541Srgrimes *
381541Srgrimes *	@(#)acct.h	8.2 (Berkeley) 1/21/94
392165Spaul * $Id: acct.h,v 1.2 1994/08/02 07:52:38 davidg Exp $
401541Srgrimes */
411541Srgrimes
422165Spaul#ifndef _SYS_ACCT_H_
432165Spaul#define _SYS_ACCT_H_
442165Spaul
451541Srgrimes/*
461541Srgrimes * Accounting structures; these use a comp_t type which is a 3 bits base 8
471541Srgrimes * exponent, 13 bit fraction ``floating point'' number.  Units are 1/AHZ
481541Srgrimes * seconds.
491541Srgrimes */
501541Srgrimestypedef u_short comp_t;
511541Srgrimes
521541Srgrimesstruct acct {
531541Srgrimes	char	ac_comm[10];	/* command name */
541541Srgrimes	comp_t	ac_utime;	/* user time */
551541Srgrimes	comp_t	ac_stime;	/* system time */
561541Srgrimes	comp_t	ac_etime;	/* elapsed time */
571541Srgrimes	time_t	ac_btime;	/* starting time */
581541Srgrimes	uid_t	ac_uid;		/* user id */
591541Srgrimes	gid_t	ac_gid;		/* group id */
601541Srgrimes	short	ac_mem;		/* average memory usage */
611541Srgrimes	comp_t	ac_io;		/* count of IO blocks */
621541Srgrimes	dev_t	ac_tty;		/* controlling tty */
631541Srgrimes#define	AFORK	0x01			/* forked but not execed */
641541Srgrimes#define	ASU	0x02			/* used super-user permissions */
651541Srgrimes#define	ACOMPAT	0x04			/* used compatibility mode */
661541Srgrimes#define	ACORE	0x08			/* dumped core */
671541Srgrimes#define	AXSIG	0x10			/* killed by a signal */
681541Srgrimes	char	ac_flag;	/* accounting flags */
691541Srgrimes};
701541Srgrimes
711541Srgrimes/*
721541Srgrimes * 1/AHZ is the granularity of the data encoded in the comp_t fields.
731541Srgrimes * This is not necessarily equal to hz.
741541Srgrimes */
751541Srgrimes#define	AHZ	64
761541Srgrimes
771541Srgrimes#ifdef KERNEL
781541Srgrimesstruct vnode	*acctp;
791541Srgrimes#endif
802165Spaul
812165Spaul#endif
82