1.\" Copyright 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" from: @(#)acct.5 6.3 (Berkeley) 4/29/91 33.\" $Id: acct.5,v 1.2 1993/08/01 07:35:35 mycroft Exp $ 34.\" 35.Dd April 29, 1991 36.Dt ACCT 5 37.Os 38.Sh NAME 39.Nm acct 40.Nd execution accounting file 41.Sh SYNOPSIS 42.Fd #include <sys/acct.h> 43.Sh DESCRIPTION 44The kernel maintains the following 45.Fa acct 46information structure for all 47processes. If a process terminates, and accounting is enabled, 48the kernel calls the 49.Xr acct 2 50function call to prepare and append the record 51to the accounting file. 52.Bd -literal 53/* 54 * Accounting structures; these use a comp_t type which is a 3 bits base 8 55 * exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ 56 * seconds. 57 */ 58typedef u_short comp_t; 59 60struct acct { 61 char ac_comm[10]; /* name of command */ 62 comp_t ac_utime; /* user time */ 63 comp_t ac_stime; /* system time */ 64 comp_t ac_etime; /* elapsed time */ 65 time_t ac_btime; /* starting time */ 66 uid_t ac_uid; /* user id */ 67 gid_t ac_gid; /* group id */ 68 short ac_mem; /* memory usage average */ 69 comp_t ac_io; /* count of IO blocks */ 70 dev_t ac_tty; /* controlling tty */ 71#define AFORK 0x01 /* forked but not execed */ 72#define ASU 0x02 /* used super-user permissions */ 73#define ACOMPAT 0x04 /* used compatibility mode */ 74#define ACORE 0x08 /* dumped core */ 75#define AXSIG 0x10 /* killed by a signal */ 76 char ac_flag; /* accounting flags */ 77}; 78 79/* 80 * 1/AHZ is the granularity of the data encoded in the comp_t fields. 81 * This is not necessarily equal to hz. 82 */ 83#define AHZ 64 84 85#ifdef KERNEL 86struct vnode *acctp; 87#endif 88.Ed 89.Pp 90If a terminated process was created by an 91.Xr execve 2 , 92the name of the executed file (at most ten characters of it) 93is saved in the field 94.Fa ac_comm 95and its status is saved by setting one of more of the following flags in 96.Fa ac_flag: 97.Dv AFORK , 98.Dv ASU , 99.Dv ACOMPAT , 100.Dv ACORE 101and 102.Dv ASIG . 103.Sh SEE ALSO 104.Xr acct 2 , 105.Xr execve 2 , 106.Xr sa 8 107.Sh HISTORY 108A 109.Nm 110file format appeared in 111.At v7 . 112