1.\" Copyright (c) 1991, 1993 2.\" The Regents of the University of California. 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.\" @(#)acct.5 8.1 (Berkeley) 6/5/93 33.\" 34.Dd June 5, 1993 35.Dt ACCT 5 36.Os 37.Sh NAME 38.Nm acct 39.Nd execution accounting file 40.Sh SYNOPSIS 41.Fd #include <sys/acct.h> 42.Sh DESCRIPTION 43The kernel maintains the following 44.Fa acct 45information structure for all 46processes. If a process terminates, and accounting is enabled, 47the kernel calls the 48.Xr acct 2 49function call to prepare and append the record 50to the accounting file. 51.Bd -literal 52/* 53 * Accounting structures; these use a comp_t type which is a 3 bits base 8 54 * exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ 55 * seconds. 56 */ 57typedef u_short comp_t; 58 59#define AC_COMM_LEN 16 60struct acct { 61 char ac_comm[AC_COMM_LEN]; /* command name */ 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; /* average memory usage */ 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.Ed 85.Pp 86If a terminated process was created by an 87.Xr execve 2 , 88the name of the executed file (at most ten characters of it) 89is saved in the field 90.Fa ac_comm 91and its status is saved by setting one of more of the following flags in 92.Fa ac_flag: 93.Dv AFORK , 94.Dv ASU , 95.Dv ACOMPAT , 96.Dv ACORE 97and 98.Dv ASIG . 99.Sh SEE ALSO 100.Xr acct 2 , 101.Xr execve 2 , 102.Xr sa 8 103.Sh HISTORY 104A 105.Nm 106file format appeared in 107.At v7 . 108