1*61608Sbostic.\" Copyright (c) 1991, 1993 2*61608Sbostic.\" The Regents of the University of California. All rights reserved. 320773Smckusick.\" 448832Scael.\" %sccs.include.redist.roff% 548832Scael.\" 6*61608Sbostic.\" @(#)acct.5 8.1 (Berkeley) 06/05/93 748832Scael.\" 848832Scael.Dd 948832Scael.Dt ACCT 5 1048832Scael.Os 1148832Scael.Sh NAME 1248832Scael.Nm acct 1348832Scael.Nd execution accounting file 1448832Scael.Sh SYNOPSIS 1548832Scael.Fd #include <sys/acct.h> 1648832Scael.Sh DESCRIPTION 1748832ScaelThe kernel maintains the following 1848832Scael.Fa acct 1948832Scaelinformation structure for all 2048832Scaelprocesses. If a process terminates, and accounting is enabled, 2148832Scaelthe kernel calls the 2248832Scael.Xr acct 2 2348832Scaelfunction call to prepare and append the record 2448832Scaelto the accounting file. 2548832Scael.Bd -literal 2648832Scael/* 2748832Scael * Accounting structures; these use a comp_t type which is a 3 bits base 8 2848832Scael * exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ 2948832Scael * seconds. 3048832Scael */ 3148832Scaeltypedef u_short comp_t; 3248832Scael 3348832Scaelstruct acct { 3448832Scael char ac_comm[10]; /* name of command */ 3548832Scael comp_t ac_utime; /* user time */ 3648832Scael comp_t ac_stime; /* system time */ 3748832Scael comp_t ac_etime; /* elapsed time */ 3848832Scael time_t ac_btime; /* starting time */ 3948832Scael uid_t ac_uid; /* user id */ 4048832Scael gid_t ac_gid; /* group id */ 4148832Scael short ac_mem; /* memory usage average */ 4248832Scael comp_t ac_io; /* count of IO blocks */ 4348832Scael dev_t ac_tty; /* controlling tty */ 4448832Scael#define AFORK 0x01 /* forked but not execed */ 4548832Scael#define ASU 0x02 /* used super-user permissions */ 4648832Scael#define ACOMPAT 0x04 /* used compatibility mode */ 4748832Scael#define ACORE 0x08 /* dumped core */ 4848832Scael#define AXSIG 0x10 /* killed by a signal */ 4948832Scael char ac_flag; /* accounting flags */ 5048832Scael}; 5148832Scael 5248832Scael/* 5348832Scael * 1/AHZ is the granularity of the data encoded in the comp_t fields. 5448832Scael * This is not necessarily equal to hz. 5548832Scael */ 5648832Scael#define AHZ 64 5748832Scael 5848832Scael#ifdef KERNEL 5948832Scaelstruct vnode *acctp; 6048832Scael#endif 6148832Scael.Ed 6248832Scael.Pp 6348832ScaelIf a terminated process was created by an 6448832Scael.Xr execve 2 , 6548832Scaelthe name of the executed file (at most ten characters of it) 6648832Scaelis saved in the field 6748832Scael.Fa ac_comm 6848832Scaeland its status is saved by setting one of more of the following flags in 6948832Scael.Fa ac_flag: 7048832Scael.Dv AFORK , 7148832Scael.Dv ASU , 7248832Scael.Dv ACOMPAT , 7348832Scael.Dv ACORE 7448832Scaeland 7548832Scael.Dv ASIG . 7648832Scael.Sh SEE ALSO 7748832Scael.Xr acct 2 , 7848832Scael.Xr execve 2 , 7948832Scael.Xr sa 8 8048832Scael.Sh HISTORY 8148832ScaelA 8248832Scael.Nm 8348832Scaelfile format appeared in 8448832Scael.At v7 . 85