1ACCT(2) Linux Programmer's Manual ACCT(2)
2
3
4
6 acct - switch process accounting on or off
7
9 #include <unistd.h>
10
11 int acct(const char *filename);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 acct(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
16
18 The acct() system call enables or disables process accounting. If
19 called with the name of an existing file as its argument, accounting is
20 turned on, and records for each terminating process are appended to
21 filename as it terminates. An argument of NULL causes accounting to be
22 turned off.
23
25 On success, zero is returned. On error, -1 is returned, and errno is
26 set appropriately.
27
29 EACCES Write permission is denied for the specified file, or search
30 permission is denied for one of the directories in the path pre‐
31 fix of filename (see also path_resolution(7)), or filename is
32 not a regular file.
33
34 EFAULT filename points outside your accessible address space.
35
36 EIO Error writing to the file filename.
37
38 EISDIR filename is a directory.
39
40 ELOOP Too many symbolic links were encountered in resolving filename.
41
42 ENAMETOOLONG
43 filename was too long.
44
45 ENFILE The system limit on the total number of open files has been
46 reached.
47
48 ENOENT The specified filename does not exist.
49
50 ENOMEM Out of memory.
51
52 ENOSYS BSD process accounting has not been enabled when the operating
53 system kernel was compiled. The kernel configuration parameter
54 controlling this feature is CONFIG_BSD_PROCESS_ACCT.
55
56 ENOTDIR
57 A component used as a directory in filename is not in fact a
58 directory.
59
60 EPERM The calling process has insufficient privilege to enable process
61 accounting. On Linux the CAP_SYS_PACCT capability is required.
62
63 EROFS filename refers to a file on a read-only file system.
64
65 EUSERS There are no more free file structures or we ran out of memory.
66
68 SVr4, 4.3BSD (but not POSIX).
69
71 No accounting is produced for programs running when a system crash
72 occurs. In particular, non-terminating processes are never accounted
73 for.
74
75 The structure of the records written to the accounting file is
76 described in acct(5).
77
79 acct(5)
80
82 This page is part of release 3.22 of the Linux man-pages project. A
83 description of the project, and information about reporting bugs, can
84 be found at http://www.kernel.org/doc/man-pages/.
85
86
87
88Linux 2008-06-16 ACCT(2)