int acct (path) char *path;
acct() is used to enable or disable the process accounting. If process accounting is enabled, an accounting record will be written on an accounting file for each process that terminates. Termination can be caused by one of two things: an exit() call or a signal; see exit (2V) and sigvec.2 The effective user ID of the calling process must be super-user to use this call.
path points to a path name naming the accounting file. The accounting file format is given in acct.5
The accounting routine is enabled if path is not a NULL pointer and no errors occur during the system call. It is disabled if path is a NULL pointer and no errors occur during the system call.
If accounting is already turned on, and a successful acct() call is made with a non-NULL path, all subsequent accounting records will be written to the new accounting file.
If accounting is already turned on, it is an error to call acct() with a non-NULL path.
acct() returns:
The file referred to by path is not a regular file.
A pathname component is longer than {NAME_MAX} (see sysconf.2v while {_POSIX_NO_TRUNC} is in effect (see pathconf.2v
No accounting records are produced for programs running when a crash occurs. In particular non-terminating programs are never accounted for.
Accounting is automatically disabled when free space on the file system the accounting file resides on drops below 2 percent; it is enabled when free space rises above 4 percent.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97