acct
Purpose
Enables and disables process accounting.
Syntax
int acct (path)
char *path;
Description
The acct system call enables the accounting routine when
the path parameter specifies the path name of the file to
which an accounting record is written for each process
that terminates. (For information about the accounting
file, see "acct.") When the path parameter is 0 or NULL,
the acct system call disables the accounting routine.
If Distributed Services is installed on your system, the
accounting file can reside on another node.
Warning: To ensure accurate accounting, each node must
have its own accounting file, which can be located on any
node in the network.
The effective user ID of the calling process must be
superuser to use the acct system call.
Return Value
Upon successful completion, acct returns a value of 0.
If acct fails, a value of -1 is returned and errno is set
to indicate the error.
Diagnostics
The acct system call fails if one or more of the fol-
lowing are true:
EPERM The effective user ID of the calling process
is not superuser.
EBUSY An attempt is made to enable accounting when
it is already enabled.
ENOTDIR A component of the path parameter is not a
directory.
ENOENT Any component of the accounting file's path
name does not exist.
EACCES Any component of the path parameter denies
search permission.
EACCES The file named by the path parameter is not an
ordinary file.
EACCES Mode permission is denied for the named
accounting file.
EISDIR The named file is a directory.
EROFS The named file resides on a read-only file
system.
EFAULT The path parameter &pointsout..
ESTALE The process's root or current directory is
located in a virtual file system that has been
unmounted.
If Distributed Services is installed on your system, acct
can also fail if one or more of the following are true:
EDIST The server has blocked new inbound
requests.
EDIST Outbound requests are currently blocked.
EDIST The server has a release level of Distrib-
uted Services that cannot communicate with
this node.
EAGAIN The server is too busy to accept the
request.
ESTALE The file descriptor for a remote file has
become obsolete.
EPERM The translate tables of the server did not
contain any entry for either the effective
user ID or effective group ID of the
calling process.
ENODEV The named file is a remote file located on
a device that has been unmounted at the
server.
ENOMEM Either this node or the server does not
have enough memory available to service the
request.
ENOCONNECT An attempt to establish a new network con-
nection with a remote node failed.
EBADCONNECT An attempt to use an existing network con-
nection with a remote node failed.
Related Information
In this book: "exit, _exit," "signal," and "acct."
The discussion of acct in Managing the AIX Operating
System.