2 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved Copyright 1989 AT&T
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ACCT 2 "Jan 20, 2003"
8 acct \- enable or disable process accounting
14 \fBint\fR \fBacct\fR(\fBconst char *\fR\fIpath\fR);
20 The \fBacct()\fR function enables or disables the system process accounting
21 routine. If the routine is enabled, an accounting record will be written in an
22 accounting file for each process that terminates. The termination of a process
23 can be caused by either an \fBexit\fR(2) call or a \fBsignal\fR(3C)). The
24 effective user \fBID\fR of the process calling \fBacct()\fR must have the
25 appropriate privileges.
28 The \fIpath\fR argument points to the pathname of the accounting file, whose
29 file format is described on the \fBacct.h\fR(3HEAD) manual page.
32 The accounting routine is enabled if \fIpath\fR is non-zero and no errors occur
33 during the function. It is disabled if \fIpath\fR is \fBNULL\fR and
34 no errors occur during the function.
38 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
39 returned and \fBerrno\fR is set to indicate the error.
43 The \fBacct()\fR function will fail if:
50 The file named by \fIpath\fR is not an ordinary file.
59 An attempt is being made to enable accounting using the same file that is
69 The \fIpath\fR argument points to an illegal address.
78 Too many symbolic links were encountered in translating \fIpath\fR.
84 \fB\fBENAMETOOLONG\fR\fR
87 The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR}, or the length
88 of a \fIpath\fR argument exceeds {\fBNAME_MAX\fR} while \fB_POSIX_NO_TRUNC\fR
98 One or more components of the accounting file pathname do not exist.
107 A component of the path prefix is not a directory.
116 The {\fBPRIV_SYS_ACCT\fR} privilege is not asserted in the effective set of the
126 The named file resides on a read-only file system.
132 \fBexit\fR(2), \fBacct.h\fR(3HEAD), \fBsignal\fR(3C), \fBprivileges\fR(5)