acct(2)
NAME
acct − turn accounting on or off
SYNTAX
int acct(file)
char *file;
DESCRIPTION
The acct system call prepares the system to write a record for each process as it terminates in an accounting file. With a null-terminated string naming an existing file specified, the acct call turns on accounting. Records for each terminating process are appended to file. With an argument of 0 specified, the acct call turns off accounting.
The accounting file format is given in acct(5).
No accounting is produced for programs running when a crash occurs. In particular nonterminating programs are never accounted for.
RESTRICTIONS
The file must exist, and the call may be exercised only by the superuser. It is erroneous to try to turn on accounting when it is already on.
RETURN VALUE
If successful, returns an non-negative integer. If unsuccessful, returns a −1, and the global variable errno indicates the error code.
DIAGNOSTICS
The acct call will fail if:
[EACCES] The named file is not a regular file.
[EBUSY] An attempt is made to turn on accounting when it is already on.
[EFAULT] The named file points outside the process’s allocated address space.
[ENOENT] The named file does not exist.
[ENOTDIR] A component of the path prefix is not a directory.
[EACCES] A component of the path prefix denies search permission.
[EACCES] The mode permission is denied for the named accounting file.
[EISDIR] The named file is a directory.
[EPERM] The caller is not the superuser.
[EROFS] The named file resides on a read-only file system.
ASSEMBLER
(acct = 51.)
sys acct; file