1 .\" Copyright (c) 1993 Michael Haardt
2 .\" (michael@moria.de),
3 .\" Fri Apr 2 11:32:09 MET DST 1993
5 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
6 .\" This is free documentation; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License as
8 .\" published by the Free Software Foundation; either version 2 of
9 .\" the License, or (at your option) any later version.
11 .\" The GNU General Public License's references to "object code"
12 .\" and "executables" are to be interpreted as the output of any
13 .\" document formatting or typesetting system, including
14 .\" intermediate and printed output.
16 .\" This manual is distributed in the hope that it will be useful,
17 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
18 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 .\" GNU General Public License for more details.
21 .\" You should have received a copy of the GNU General Public
22 .\" License along with this manual; if not, see
23 .\" <http://www.gnu.org/licenses/>.
26 .\" Modified 1993-07-22 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1993-08-10 by Alan Cox <iiitac@pyramid.swansea.ac.uk>
28 .\" Modified 1998-11-04 by Tigran Aivazian <tigran@sco.com>
29 .\" Modified 2004-05-27, 2004-06-17, 2004-06-23 by Michael Kerrisk
31 .TH ACCT 2 2016-03-15 "Linux" "Linux Programmer's Manual"
33 acct \- switch process accounting on or off
37 .B #include <unistd.h>
39 .BI "int acct(const char *" filename );
44 Feature Test Macro Requirements for glibc (see
45 .BR feature_test_macros (7)):
51 .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8
53 In glibc 2.19 and 2.20:
54 _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
55 Up to and including glibc 2.19:
56 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
61 system call enables or disables process accounting.
62 If called with the name of an existing file as its argument,
63 accounting is turned on,
64 and records for each terminating process are appended to
67 An argument of NULL causes accounting to be turned off.
69 On success, zero is returned.
70 On error, \-1 is returned, and
76 Write permission is denied for the specified file,
77 or search permission is denied for one of the directories
81 .BR path_resolution (7)),
84 is not a regular file.
88 points outside your accessible address space.
91 Error writing to the file
99 Too many symbolic links were encountered in resolving
107 The system-wide limit on the total number of open files has been reached.
110 The specified file does not exist.
116 BSD process accounting has not been enabled when the operating system
118 The kernel configuration parameter controlling this feature is
119 .BR CONFIG_BSD_PROCESS_ACCT .
122 A component used as a directory in
124 is not in fact a directory.
127 The calling process has insufficient privilege to enable process accounting.
130 capability is required.
134 refers to a file on a read-only filesystem.
137 There are no more free file structures or we ran out of memory.
139 SVr4, 4.3BSD (but not POSIX).
140 .\" SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS.
141 .\" Also AIX and HP-UX document EBUSY (attempt is made
142 .\" to enable accounting when it is already enabled), as does Solaris
143 .\" (attempt is made to enable accounting using the same file that is
144 .\" currently being used).
146 No accounting is produced for programs running when a system crash occurs.
147 In particular, nonterminating processes are never accounted for.
149 The structure of the records written to the accounting file is described in