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