acct(2) acct(2)NAME acct - enable or disable process accounting SYNOPSIS int acct(path) char *path; DESCRIPTION acct is used to enable or disable the system process ac- counting routine. If the routine is enabled, an accounting record will be written on an accounting file for each pro- cess that terminates. Termination can be caused by one of two things: an exit call or a signal; see exit(2) and sig- nal(3). The effective user ID of the calling process must be superuser to use this call. path points to a path name naming the accounting file. The accounting file format is given in acct(4). The accounting routine is enabled if path is nonzero and no errors occur during the system call. It is disabled if path is zero and no errors occur during the system call. RETURN VALUE Upon successful completion, a value of 0 is returned. Oth- erwise, a value of -1 is returned and errno is set to indi- cate the error. ERRORS acct will fail if one or more of the following are true: [EPERM] A pathname contains a character with the high-order bit set. [EPERM] The effective user ID of the calling process is not superuser. [ENAMETOOLONG] A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX. [ELOOP] Too many symbolic links were encountered in translating a pathname. [EBUSY] An attempt is being made to enable accounting when it is already enabled. [ENOTDIR] A component of the path prefix is not a direc- tory. [ENOENT] One or more components of the accounting file April, 1990 1
acct(2) acct(2)path name do not exist. [EACCES] A component of the path prefix denies search permission. [EACCES] The file named by path is not an ordinary file. [EACCES] mode permission is denied for the named ac- counting file. [EROFS] The named file resides on a read-only file system. [EFAULT] path points to an illegal address. SEE ALSO acct(1M), exit(2), signal(3), acct(4). 2 April, 1990