ACCT(2) — System Interface Manual — System Calls
NAME
acct − turn accounting on or off
SYNOPSIS
acct(path)
char ∗path;
DESCRIPTION
The system is prepared to write a record in an accounting file named by path for each process as it terminates. This call, with a null-terminated string naming an existing file as argument, turns on accounting; records for each terminating process are appended to file. An argument of 0 turns accounting off.
The accounting file format is given in acct(5).
NOTES
Accounting is automatically turned off when the file system the accounting file resides on runs out of space; it is not, however turned back on when space becomes available.
DIAGNOSTICS
On error −1 is returned. The file must exist and the call may be exercised only by the super-user. It is erroneous to try to turn on accounting when it is already on.
ERRORS
[ENOTDIR] A component of the path prefix is not a directory.
[ENOENT] The argument pathname was too long.
[ENOENT] The named file does not exist.
[EPERM] The path argument contains a byte with the high-order bit set.
[ELOOP] Too many symbolic links were encountered while translating the pathname.
[EROFS] The path is to a read-only file system.
[ETXTBSY] The path names an executable file that is being executed.
[EFAULT] Path points outside the process’s valid address space.
SEE ALSO
BUGS
No accounting is produced for programs running when a crash occurs. In particular nonterminating programs are never accounted for.
Sun System Release 0.3 — 25 April 1983