BSD 4_3_Tahoe release
[unix-history] / usr / src / man / man2 / acct.2
CommitLineData
16bf0669
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
95f51977 5.\" @(#)acct.2 6.4 (Berkeley) 5/22/86
16bf0669 6.\"
95f51977 7.TH ACCT 2 "May 22, 1986"
16bf0669
KM
8.UC 4
9.SH NAME
10acct \- turn accounting on or off
11.SH SYNOPSIS
12.nf
79f85414
KM
13.ft B
14acct(file)
15char *file;
16.ft R
16bf0669
KM
17.fi
18.SH DESCRIPTION
19The system is prepared to write a record
20in an accounting
21.I file
22for each process as it terminates.
23This
24call, with a null-terminated string naming an existing file
25as argument, turns on accounting;
26records for each terminating process are appended to
27.IR file .
28An argument of 0 causes accounting to be turned off.
29.PP
30The accounting file format is given in
31.IR acct (5).
79f85414
KM
32.PP
33This call is permitted only to the super-user.
34.SH NOTES
35Accounting is automatically disabled when the file system the
36accounting file resides on runs out of space; it is enabled when
37space once again becomes available.
38.SH "RETURN VALUE
16bf0669
KM
39On error \-1 is returned.
40The file must exist and the call may be exercised only by the super-user.
41It is erroneous to try to turn on accounting when it is already on.
79f85414
KM
42.SH ERRORS
43.I Acct
44will fail if one of the following is true:
45.TP 15
46[EPERM]
47The caller is not the super-user.
48.TP 15
79f85414
KM
49[ENOTDIR]
50A component of the path prefix is not a directory.
51.TP 15
b5984ffe
KM
52[EINVAL]
53The pathname contains a character with the high-order bit set.
54.TP 15
55[ENAMETOOLONG]
56A component of a pathname exceeded 255 characters,
57or an entire path name exceeded 1023 characters.
58.TP 15
79f85414
KM
59[ENOENT]
60The named file does not exist.
61.TP 15
b5984ffe
KM
62[EACCES]
63Search permission is denied for a component of the path prefix,
64or the path name is not a regular file.
65.TP 15
66[ELOOP]
67Too many symbolic links were encountered in translating the pathname.
79f85414
KM
68.TP 15
69[EROFS]
70The named file resides on a read-only file system.
71.TP 15
72[EFAULT]
73.I File
74points outside the process's allocated address space.
fd690c8b
KM
75.TP 15
76[EIO]
77An I/O error occurred while reading from or writing to the file system.
79f85414
KM
78.SH "SEE ALSO"
79acct(5), sa(8)
16bf0669
KM
80.SH BUGS
81No accounting is produced for programs running
82when a crash occurs.
e9d005d5 83In particular non-terminating programs are never
16bf0669 84accounted for.