]>
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 | .\" | |
e4a74ca8 | 5 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
6 | .\" |
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 | |
11 | .\" | |
4c1c5274 | 12 | .TH acct 2 (date) "Linux man-pages (unreleased)" |
fea681da MK |
13 | .SH NAME |
14 | acct \- switch process accounting on or off | |
76b1f262 AC |
15 | .SH LIBRARY |
16 | Standard C library | |
8fc3b2cf | 17 | .RI ( libc ", " \-lc ) |
fea681da | 18 | .SH SYNOPSIS |
fea681da MK |
19 | .nf |
20 | .B #include <unistd.h> | |
c6d039a3 | 21 | .P |
302e02c5 | 22 | .BI "int acct(const char *_Nullable " filename ); |
fea681da | 23 | .fi |
c6d039a3 | 24 | .P |
d39ad78f | 25 | .RS -4 |
cc4615cc MK |
26 | Feature Test Macro Requirements for glibc (see |
27 | .BR feature_test_macros (7)): | |
d39ad78f | 28 | .RE |
c6d039a3 | 29 | .P |
cc4615cc | 30 | .BR acct (): |
d0544534 MK |
31 | .nf |
32 | Since glibc 2.21: | |
33 | .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 | |
34 | _DEFAULT_SOURCE | |
35 | In glibc 2.19 and 2.20: | |
5c10d2c5 | 36 | _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) |
d0544534 | 37 | Up to and including glibc 2.19: |
5c10d2c5 | 38 | _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) |
d0544534 | 39 | .fi |
fea681da | 40 | .SH DESCRIPTION |
3cde6db5 | 41 | The |
61792fc6 | 42 | .BR acct () |
3cde6db5 MK |
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 | |
c6fa0841 MK |
47 | .I filename |
48 | as it terminates. | |
c13182ef | 49 | An argument of NULL causes accounting to be turned off. |
47297adb | 50 | .SH RETURN VALUE |
c13182ef MK |
51 | On success, zero is returned. |
52 | On error, \-1 is returned, and | |
fea681da | 53 | .I errno |
f6a4078b | 54 | is set to indicate the error. |
fea681da MK |
55 | .SH ERRORS |
56 | .TP | |
57 | .B EACCES | |
58 | Write permission is denied for the specified file, | |
59 | or search permission is denied for one of the directories | |
60 | in the path prefix of | |
61 | .I filename | |
62 | (see also | |
ad7cc990 | 63 | .BR path_resolution (7)), |
fea681da MK |
64 | or |
65 | .I filename | |
66 | is not a regular file. | |
67 | .TP | |
68 | .B EFAULT | |
69 | .I filename | |
70 | points outside your accessible address space. | |
71 | .TP | |
72 | .B EIO | |
73 | Error writing to the file | |
74 | .IR filename . | |
75 | .TP | |
76 | .B EISDIR | |
c13182ef | 77 | .I filename |
fea681da MK |
78 | is a directory. |
79 | .TP | |
80 | .B ELOOP | |
c13182ef | 81 | Too many symbolic links were encountered in resolving |
fea681da MK |
82 | .IR filename . |
83 | .TP | |
84 | .B ENAMETOOLONG | |
85 | .I filename | |
86 | was too long. | |
87 | .TP | |
88 | .B ENFILE | |
e258766b | 89 | The system-wide limit on the total number of open files has been reached. |
fea681da MK |
90 | .TP |
91 | .B ENOENT | |
e82c4748 | 92 | The specified file does not exist. |
fea681da MK |
93 | .TP |
94 | .B ENOMEM | |
95 | Out of memory. | |
96 | .TP | |
97 | .B ENOSYS | |
98 | BSD process accounting has not been enabled when the operating system | |
99 | kernel was compiled. | |
100 | The kernel configuration parameter controlling this feature is | |
682edefb | 101 | .BR CONFIG_BSD_PROCESS_ACCT . |
fea681da MK |
102 | .TP |
103 | .B ENOTDIR | |
c13182ef MK |
104 | A component used as a directory in |
105 | .I filename | |
fea681da MK |
106 | is not in fact a directory. |
107 | .TP | |
108 | .B EPERM | |
109 | The calling process has insufficient privilege to enable process accounting. | |
329ad271 | 110 | On Linux, the |
fea681da MK |
111 | .B CAP_SYS_PACCT |
112 | capability is required. | |
113 | .TP | |
114 | .B EROFS | |
c13182ef | 115 | .I filename |
9ee4a2b6 | 116 | refers to a file on a read-only filesystem. |
fea681da MK |
117 | .TP |
118 | .B EUSERS | |
119 | There are no more free file structures or we ran out of memory. | |
3113c7f3 | 120 | .SH STANDARDS |
4131356c AC |
121 | None. |
122 | .SH HISTORY | |
123 | SVr4, 4.3BSD. | |
c13182ef | 124 | .\" SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS. |
97c1eac8 MK |
125 | .\" Also AIX and HP-UX document EBUSY (attempt is made |
126 | .\" to enable accounting when it is already enabled), as does Solaris | |
127 | .\" (attempt is made to enable accounting using the same file that is | |
128 | .\" currently being used). | |
fea681da | 129 | .SH NOTES |
3cde6db5 | 130 | No accounting is produced for programs running when a system crash occurs. |
24b74457 | 131 | In particular, nonterminating processes are never accounted for. |
c6d039a3 | 132 | .P |
3cde6db5 MK |
133 | The structure of the records written to the accounting file is described in |
134 | .BR acct (5). | |
47297adb | 135 | .SH SEE ALSO |
cbc2a267 | 136 | .BR acct (5) |