1ACCT(2)                    Linux Programmer's Manual                   ACCT(2)
2
3
4

NAME

6       acct - switch process accounting on or off
7

SYNOPSIS

9       #include <unistd.h>
10
11       int acct(const char *filename);
12

DESCRIPTION

14       When  called  with the name of an existing file as argument, accounting
15       is turned on, records for each  terminating  process  are  appended  to
16       filename as it terminates.  An argument of NULL causes accounting to be
17       turned off.
18

RETURN VALUE

20       On success, zero is returned.  On error, -1 is returned, and  errno  is
21       set appropriately.
22

ERRORS

24       EACCES Write  permission  is  denied  for the specified file, or search
25              permission is denied for one of the directories in the path pre‐
26              fix  of  filename  (see also path_resolution(2)), or filename is
27              not a regular file.
28
29       EFAULT filename points outside your accessible address space.
30
31       EIO    Error writing to the file filename.
32
33       EISDIR filename is a directory.
34
35       ELOOP  Too many symbolic links were encountered in resolving filename.
36
37       ENAMETOOLONG
38              filename was too long.
39
40       ENFILE The system limit on the total number  of  open  files  has  been
41              reached.
42
43       ENOENT The specified filename does not exist.
44
45       ENOMEM Out of memory.
46
47       ENOSYS BSD  process  accounting has not been enabled when the operating
48              system kernel was compiled.  The kernel configuration  parameter
49              controlling this feature is CONFIG_BSD_PROCESS_ACCT.
50
51       ENOTDIR
52              A  component  used  as  a directory in filename is not in fact a
53              directory.
54
55       EPERM  The calling process has insufficient privilege to enable process
56              accounting.  On Linux the CAP_SYS_PACCT capability is required.
57
58       EROFS  filename refers to a file on a read-only file system.
59
60       EUSERS There are no more free file structures or we ran out of memory.
61

CONFORMING TO

63       SVr4, 4.3BSD (but not POSIX).
64

NOTES

66       No accounting is produced for programs running when a crash occurs.  In
67       particular, nonterminating processes are never accounted for.
68

SEE ALSO

70       acct(5).
71
72
73
74Linux 2.6.7                       2004-06-23                           ACCT(2)
Impressum