acct.h revision 1542
1272343Sngie/*-
2272343Sngie * Copyright (c) 1990, 1993
3272343Sngie *	The Regents of the University of California.  All rights reserved.
4272343Sngie * (c) UNIX System Laboratories, Inc.
5272343Sngie * All or some portions of this file are derived from material licensed
6272343Sngie * to the University of California by American Telephone and Telegraph
7272343Sngie * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8272343Sngie * the permission of UNIX System Laboratories, Inc.
9272343Sngie *
10272343Sngie * Redistribution and use in source and binary forms, with or without
11272343Sngie * modification, are permitted provided that the following conditions
12272343Sngie * are met:
13272343Sngie * 1. Redistributions of source code must retain the above copyright
14272343Sngie *    notice, this list of conditions and the following disclaimer.
15272343Sngie * 2. Redistributions in binary form must reproduce the above copyright
16272343Sngie *    notice, this list of conditions and the following disclaimer in the
17272343Sngie *    documentation and/or other materials provided with the distribution.
18272343Sngie * 3. All advertising materials mentioning features or use of this software
19272343Sngie *    must display the following acknowledgement:
20272343Sngie *	This product includes software developed by the University of
21272343Sngie *	California, Berkeley and its contributors.
22272343Sngie * 4. Neither the name of the University nor the names of its contributors
23272343Sngie *    may be used to endorse or promote products derived from this software
24272343Sngie *    without specific prior written permission.
25272343Sngie *
26272343Sngie * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27272343Sngie * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28272343Sngie * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29272343Sngie * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30272343Sngie * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31272343Sngie * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32272343Sngie * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33272343Sngie * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34272343Sngie * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35272343Sngie * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36272343Sngie * SUCH DAMAGE.
37272343Sngie *
38272343Sngie *	@(#)acct.h	8.2 (Berkeley) 1/21/94
39272343Sngie */
40272343Sngie
41272343Sngie/*
42272343Sngie * Accounting structures; these use a comp_t type which is a 3 bits base 8
43272343Sngie * exponent, 13 bit fraction ``floating point'' number.  Units are 1/AHZ
44272343Sngie * seconds.
45 */
46typedef u_short comp_t;
47
48struct acct {
49	char	ac_comm[10];	/* command name */
50	comp_t	ac_utime;	/* user time */
51	comp_t	ac_stime;	/* system time */
52	comp_t	ac_etime;	/* elapsed time */
53	time_t	ac_btime;	/* starting time */
54	uid_t	ac_uid;		/* user id */
55	gid_t	ac_gid;		/* group id */
56	short	ac_mem;		/* average memory usage */
57	comp_t	ac_io;		/* count of IO blocks */
58	dev_t	ac_tty;		/* controlling tty */
59#define	AFORK	0x01			/* forked but not execed */
60#define	ASU	0x02			/* used super-user permissions */
61#define	ACOMPAT	0x04			/* used compatibility mode */
62#define	ACORE	0x08			/* dumped core */
63#define	AXSIG	0x10			/* killed by a signal */
64	char	ac_flag;	/* accounting flags */
65};
66
67/*
68 * 1/AHZ is the granularity of the data encoded in the comp_t fields.
69 * This is not necessarily equal to hz.
70 */
71#define	AHZ	64
72
73#ifdef KERNEL
74struct vnode	*acctp;
75#endif
76