'\" te .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved Copyright 1989 AT&T .TH acct 2 "20 Jan 2003" "SunOS 5.11" "System Calls" .SH NAME acct \- enable or disable process accounting .SH SYNOPSIS .LP .nf #include \fBint\fR \fBacct\fR(\fBconst char *\fR\fIpath\fR); .fi .SH DESCRIPTION .sp .LP The \fBacct()\fR function enables or disables the system process accounting routine. If the routine is enabled, an accounting record will be written in an accounting file for each process that terminates. The termination of a process can be caused by either an \fBexit\fR(2) call or a \fBsignal\fR(3C)). The effective user \fBID\fR of the process calling \fBacct()\fR must have the appropriate privileges. .sp .LP The \fIpath\fR argument points to the pathname of the accounting file, whose file format is described on the \fBacct.h\fR(3HEAD) manual page. .sp .LP The accounting routine is enabled if \fIpath\fR is non-zero and no errors occur during the function. It is disabled if \fIpath\fR is \fB(char *)NULL\fR and no errors occur during the function. .SH RETURN VALUES .sp .LP Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error. .SH ERRORS .sp .LP The \fBacct()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEACCES\fR\fR .ad .RS 16n .rt The file named by \fIpath\fR is not an ordinary file. .RE .sp .ne 2 .mk .na \fB\fBEBUSY\fR\fR .ad .RS 16n .rt An attempt is being made to enable accounting using the same file that is currently being used. .RE .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 16n .rt The \fIpath\fR argument points to an illegal address. .RE .sp .ne 2 .mk .na \fB\fBELOOP\fR\fR .ad .RS 16n .rt Too many symbolic links were encountered in translating \fIpath\fR. .RE .sp .ne 2 .mk .na \fB\fBENAMETOOLONG\fR\fR .ad .RS 16n .rt The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR}, or the length of a \fIpath\fR argument exceeds {\fBNAME_MAX\fR} while \fB_POSIX_NO_TRUNC\fR is in effect. .RE .sp .ne 2 .mk .na \fB\fBENOENT\fR\fR .ad .RS 16n .rt One or more components of the accounting file pathname do not exist. .RE .sp .ne 2 .mk .na \fB\fBENOTDIR\fR\fR .ad .RS 16n .rt A component of the path prefix is not a directory. .RE .sp .ne 2 .mk .na \fB\fBEPERM\fR\fR .ad .RS 16n .rt The {\fBPRIV_SYS_ACCT\fR} privilege is not asserted in the effective set of the calling process. .RE .sp .ne 2 .mk .na \fB\fBEROFS\fR\fR .ad .RS 16n .rt The named file resides on a read-only file system. .RE .SH SEE ALSO .sp .LP \fBexit\fR(2), \fBacct.h\fR(3HEAD), \fBsignal\fR(3C), \fBprivileges\fR(5)