]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 1993 Michael Haardt |
2 | .\" (michael@moria.de), | |
3 | .\" Fri Apr 2 11:32:09 MET DST 1993 | |
4 | .\" | |
1dd72f9c | 5 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
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. | |
10 | .\" | |
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. | |
15 | .\" | |
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. | |
20 | .\" | |
21 | .\" You should have received a copy of the GNU General Public | |
c715f741 MK |
22 | .\" License along with this manual; if not, see |
23 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 24 | .\" %%%LICENSE_END |
fea681da MK |
25 | .\" |
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 | |
30 | .\" | |
97986708 | 31 | .TH ACCT 2 2016-03-15 "Linux" "Linux Programmer's Manual" |
fea681da MK |
32 | .SH NAME |
33 | acct \- switch process accounting on or off | |
34 | .SH SYNOPSIS | |
35 | .ad l | |
36 | .nf | |
37 | .B #include <unistd.h> | |
38 | .sp | |
39 | .BI "int acct(const char *" filename ); | |
40 | .fi | |
41 | .ad b | |
cc4615cc MK |
42 | .sp |
43 | .in -4n | |
44 | Feature Test Macro Requirements for glibc (see | |
45 | .BR feature_test_macros (7)): | |
46 | .in | |
47 | .sp | |
48 | .BR acct (): | |
d0544534 MK |
49 | .nf |
50 | Since glibc 2.21: | |
51 | .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 | |
52 | _DEFAULT_SOURCE | |
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) | |
57 | .fi | |
fea681da | 58 | .SH DESCRIPTION |
3cde6db5 | 59 | The |
61792fc6 | 60 | .BR acct () |
3cde6db5 MK |
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 | |
c6fa0841 MK |
65 | .I filename |
66 | as it terminates. | |
c13182ef | 67 | An argument of NULL causes accounting to be turned off. |
47297adb | 68 | .SH RETURN VALUE |
c13182ef MK |
69 | On success, zero is returned. |
70 | On error, \-1 is returned, and | |
fea681da MK |
71 | .I errno |
72 | is set appropriately. | |
73 | .SH ERRORS | |
74 | .TP | |
75 | .B EACCES | |
76 | Write permission is denied for the specified file, | |
77 | or search permission is denied for one of the directories | |
78 | in the path prefix of | |
79 | .I filename | |
80 | (see also | |
ad7cc990 | 81 | .BR path_resolution (7)), |
fea681da MK |
82 | or |
83 | .I filename | |
84 | is not a regular file. | |
85 | .TP | |
86 | .B EFAULT | |
87 | .I filename | |
88 | points outside your accessible address space. | |
89 | .TP | |
90 | .B EIO | |
91 | Error writing to the file | |
92 | .IR filename . | |
93 | .TP | |
94 | .B EISDIR | |
c13182ef | 95 | .I filename |
fea681da MK |
96 | is a directory. |
97 | .TP | |
98 | .B ELOOP | |
c13182ef | 99 | Too many symbolic links were encountered in resolving |
fea681da MK |
100 | .IR filename . |
101 | .TP | |
102 | .B ENAMETOOLONG | |
103 | .I filename | |
104 | was too long. | |
105 | .TP | |
106 | .B ENFILE | |
e258766b | 107 | The system-wide limit on the total number of open files has been reached. |
fea681da MK |
108 | .TP |
109 | .B ENOENT | |
110 | The specified filename does not exist. | |
111 | .TP | |
112 | .B ENOMEM | |
113 | Out of memory. | |
114 | .TP | |
115 | .B ENOSYS | |
116 | BSD process accounting has not been enabled when the operating system | |
117 | kernel was compiled. | |
118 | The kernel configuration parameter controlling this feature is | |
682edefb | 119 | .BR CONFIG_BSD_PROCESS_ACCT . |
fea681da MK |
120 | .TP |
121 | .B ENOTDIR | |
c13182ef MK |
122 | A component used as a directory in |
123 | .I filename | |
fea681da MK |
124 | is not in fact a directory. |
125 | .TP | |
126 | .B EPERM | |
127 | The calling process has insufficient privilege to enable process accounting. | |
329ad271 | 128 | On Linux, the |
fea681da MK |
129 | .B CAP_SYS_PACCT |
130 | capability is required. | |
131 | .TP | |
132 | .B EROFS | |
c13182ef | 133 | .I filename |
9ee4a2b6 | 134 | refers to a file on a read-only filesystem. |
fea681da MK |
135 | .TP |
136 | .B EUSERS | |
137 | There are no more free file structures or we ran out of memory. | |
47297adb | 138 | .SH CONFORMING TO |
c13182ef MK |
139 | SVr4, 4.3BSD (but not POSIX). |
140 | .\" SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS. | |
97c1eac8 MK |
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). | |
fea681da | 145 | .SH NOTES |
3cde6db5 | 146 | No accounting is produced for programs running when a system crash occurs. |
24b74457 | 147 | In particular, nonterminating processes are never accounted for. |
3cde6db5 MK |
148 | |
149 | The structure of the records written to the accounting file is described in | |
150 | .BR acct (5). | |
47297adb | 151 | .SH SEE ALSO |
cbc2a267 | 152 | .BR acct (5) |