1 .\" Copyright (c) 1993 Michael Haardt
2 .\" (michael@moria.de),
3 .\" Fri Apr 2 11:32:09 MET DST 1993
5 .\" SPDX-License-Identifier: GPL-2.0-or-later
7 .\" Modified 1993-07-22 by Rik Faith <faith@cs.unc.edu>
8 .\" Modified 1993-08-10 by Alan Cox <iiitac@pyramid.swansea.ac.uk>
9 .\" Modified 1998-11-04 by Tigran Aivazian <tigran@sco.com>
10 .\" Modified 2004-05-27, 2004-06-17, 2004-06-23 by Michael Kerrisk
12 .TH ACCT 2 2022-09-09 "Linux man-pages (unreleased)"
14 acct \- switch process accounting on or off
17 .RI ( libc ", " \-lc )
20 .B #include <unistd.h>
22 .BI "int acct(const char *" filename );
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
33 .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8
35 In glibc 2.19 and 2.20:
36 _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
37 Up to and including glibc 2.19:
38 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
43 system call enables or disables process accounting.
44 If called with the name of an existing file as its argument,
45 accounting is turned on,
46 and records for each terminating process are appended to
49 An argument of NULL causes accounting to be turned off.
51 On success, zero is returned.
52 On error, \-1 is returned, and
54 is set to indicate the error.
58 Write permission is denied for the specified file,
59 or search permission is denied for one of the directories
63 .BR path_resolution (7)),
66 is not a regular file.
70 points outside your accessible address space.
73 Error writing to the file
81 Too many symbolic links were encountered in resolving
89 The system-wide limit on the total number of open files has been reached.
92 The specified file does not exist.
98 BSD process accounting has not been enabled when the operating system
100 The kernel configuration parameter controlling this feature is
101 .BR CONFIG_BSD_PROCESS_ACCT .
104 A component used as a directory in
106 is not in fact a directory.
109 The calling process has insufficient privilege to enable process accounting.
112 capability is required.
116 refers to a file on a read-only filesystem.
119 There are no more free file structures or we ran out of memory.
121 SVr4, 4.3BSD (but not POSIX).
122 .\" SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS.
123 .\" Also AIX and HP-UX document EBUSY (attempt is made
124 .\" to enable accounting when it is already enabled), as does Solaris
125 .\" (attempt is made to enable accounting using the same file that is
126 .\" currently being used).
128 No accounting is produced for programs running when a system crash occurs.
129 In particular, nonterminating processes are never accounted for.
131 The structure of the records written to the accounting file is described in