ACCT(5) — UNIX Programmer’s Manual
NAME
acct − execution accounting file
SYNOPSIS
#include <sys/acct.h>
DESCRIPTION
The acct(2) system call arranges for entries to be made in an accounting file for each process that terminates. The accounting file is a sequence of entries whose layout, as defined by the include file is:
/∗
∗ $Header: /smsa/bsd:include/sys/acct.h:bsd 1.6 $
∗ $Source: /smsa/bsd:include/sys/acct.h: $
∗
∗ Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
∗
∗/
/∗@(#)acct.h2.1 88/05/18 4.0NFSSRC SMI; from UCB 7.1 6/4/86 ∗/
/∗
∗ Copyright (c) 1982, 1986 Regents of the University of California.
∗ All rights reserved. The Berkeley software License Agreement
∗ specifies the terms and conditions for redistribution.
∗/
#ifndef__sys_acct_h
#define__sys_acct_h
#ifndef__sys_types_h
#include "types.h"
#endif
/∗
∗ Accounting structures;
∗ these use a comp_t type which is a 3 bits base 8
∗ exponent, 13 bit fraction “floating point” number.
∗ Units are 1/AHZ seconds.
∗/
typedefu_short comp_t;
structacct
{
charac_comm[10];/∗ Accounting command name ∗/
comp_tac_utime;/∗ Accounting user time ∗/
comp_tac_stime;/∗ Accounting system time ∗/
comp_tac_etime;/∗ Accounting elapsed time ∗/
time_tac_btime;/∗ Beginning time ∗/
uid_tac_uid;/∗ Accounting user ID ∗/
gid_tac_gid;/∗ Accounting group ID ∗/
shortac_mem;/∗ average memory usage ∗/
comp_tac_io;/∗ number of disk IO blocks ∗/
dev_tac_tty;/∗ control typewriter ∗/
charac_flag;/∗ Accounting flag ∗/
};
#defineAFORK0001 /∗ has executed fork, but no exec ∗/
#defineASU0002/∗ used super-user privileges ∗/
#defineACOMPAT0004/∗ used compatibility mode ∗/
#defineACORE0010/∗ dumped core ∗/
#defineAXSIG0020/∗ killed by a signal ∗/
/∗
∗ 1/AHZ is the granularity of the data encoded in the various
∗ comp_t fields. This is not necessarily equal to hz.
∗/
#define AHZ 64
#ifdef_KERNEL
#ifdefSYSACCT
structacctacctbuf;
structvnode ∗acctp;
#else
#defineacct()
#endifSYSACCT
#endif_KERNEL
#endif/∗__sys_acct_h∗/
/∗ EOF acct.h ∗/
If the process was created by an execve(2), the first 10 characters of the filename appear in ac_comm. The accounting flag contains bits indicating whether execve(2) was ever accomplished, and whether the process ever had super-user privileges.
SEE ALSO
7th Edition — Revision 1.2 of 19/10/88