Commit | Line | Data |
---|---|---|
931b8415 CL |
1 | .\" Copyright (c) 1980, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
16bf0669 | 3 | .\" |
931b8415 | 4 | .\" %sccs.include.redist.man% |
16bf0669 | 5 | .\" |
931b8415 CL |
6 | .\" @(#)acct.2 6.5 (Berkeley) %G% |
7 | .\" | |
8 | .Dd | |
9 | .Dt ACCT 2 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm acct | |
13 | .Nd enable or disable process accounting | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <unistd.h> | |
16 | .Ft int | |
17 | .Fn acct "const char *file" | |
18 | .Sh DESCRIPTION | |
19 | The | |
20 | .Fn acct | |
21 | call enables or disables the collection of system accounting | |
22 | records. | |
23 | If the argument | |
24 | .Fa file | |
25 | is a nil pointer, accounting is disabled. | |
26 | If | |
27 | .Fa file | |
28 | is an | |
29 | .Em existing | |
30 | pathname (null-terminated), record collection is enabled and for | |
31 | every process initiated which terminates under normal | |
32 | conditions an accounting record is appended to | |
33 | .Fa file . | |
34 | Abnormal conditions of termination are reboots | |
35 | or other fatal system problems. | |
36 | Records for processes which never terminate can not be | |
37 | produced by | |
38 | .Fn acct . | |
39 | .Pp | |
40 | For more information on the record structure used by | |
41 | .Fn acct , | |
42 | see | |
43 | .Pa /usr/include/sys/acct.h | |
44 | and | |
45 | .Xr acct 5 . | |
46 | .Pp | |
79f85414 | 47 | This call is permitted only to the super-user. |
931b8415 | 48 | .Sh NOTES |
79f85414 KM |
49 | Accounting is automatically disabled when the file system the |
50 | accounting file resides on runs out of space; it is enabled when | |
51 | space once again becomes available. | |
931b8415 CL |
52 | .Sh RETURN VALUES |
53 | On error -1 is returned. | |
16bf0669 | 54 | The file must exist and the call may be exercised only by the super-user. |
931b8415 CL |
55 | .Sh ERRORS |
56 | .Fn Acct | |
79f85414 | 57 | will fail if one of the following is true: |
931b8415 CL |
58 | .Bl -tag -width Er |
59 | .It Bq Er EPERM | |
79f85414 | 60 | The caller is not the super-user. |
931b8415 | 61 | .It Bq Er ENOTDIR |
79f85414 | 62 | A component of the path prefix is not a directory. |
931b8415 | 63 | .It Bq Er EINVAL |
b5984ffe | 64 | The pathname contains a character with the high-order bit set. |
931b8415 | 65 | .It Bq Er ENAMETOOLONG |
b5984ffe KM |
66 | A component of a pathname exceeded 255 characters, |
67 | or an entire path name exceeded 1023 characters. | |
931b8415 | 68 | .It Bq Er ENOENT |
79f85414 | 69 | The named file does not exist. |
931b8415 | 70 | .It Bq Er EACCES |
b5984ffe KM |
71 | Search permission is denied for a component of the path prefix, |
72 | or the path name is not a regular file. | |
931b8415 | 73 | .It Bq Er ELOOP |
b5984ffe | 74 | Too many symbolic links were encountered in translating the pathname. |
931b8415 | 75 | .It Bq Er EROFS |
79f85414 | 76 | The named file resides on a read-only file system. |
931b8415 CL |
77 | .It Bq Er EFAULT |
78 | .Fa File | |
79f85414 | 79 | points outside the process's allocated address space. |
931b8415 | 80 | .It Bq Er EIO |
fd690c8b | 81 | An I/O error occurred while reading from or writing to the file system. |
931b8415 CL |
82 | .El |
83 | .Sh SEE ALSO | |
84 | .Xr acct 5 , | |
85 | .Xr sa 8 | |
86 | .Sh HISTORY | |
87 | An | |
88 | .Nm | |
89 | function call appeared in Version 7 AT&T UNIX. |