xref: /csrg-svn/lib/libc/sys/acct.2 (revision 61181)
1*61181Sbostic.\" Copyright (c) 1980, 1991, 1993
2*61181Sbostic.\"	The Regents of the University of California.  All rights reserved.
320059Smckusick.\"
447208Scael.\" %sccs.include.redist.man%
520059Smckusick.\"
6*61181Sbostic.\"     @(#)acct.2	8.1 (Berkeley) 06/04/93
747208Scael.\"
847208Scael.Dd
947208Scael.Dt ACCT 2
1047208Scael.Os BSD 4
1147208Scael.Sh NAME
1247208Scael.Nm acct
1347208Scael.Nd enable or disable process accounting
1447208Scael.Sh SYNOPSIS
1547208Scael.Fd #include <unistd.h>
1647208Scael.Ft int
1747208Scael.Fn acct "const char *file"
1847208Scael.Sh DESCRIPTION
1947208ScaelThe
2047208Scael.Fn acct
2147208Scaelcall enables or disables the collection of system accounting
2247208Scaelrecords.
2347208ScaelIf the argument
2447208Scael.Fa file
2547208Scaelis a nil pointer, accounting is disabled.
2647208ScaelIf
2747208Scael.Fa file
2847208Scaelis an
2947208Scael.Em existing
3047208Scaelpathname (null-terminated), record collection is enabled and for
3147208Scaelevery process initiated which terminates under normal
3247208Scaelconditions an accounting record is appended to
3347208Scael.Fa file .
3447208ScaelAbnormal conditions of termination are reboots
3547208Scaelor other fatal system problems.
3647208ScaelRecords for processes which never terminate can not be
3747208Scaelproduced by
3847208Scael.Fn acct .
3947208Scael.Pp
4047208ScaelFor more information on the record structure used by
4147208Scael.Fn acct ,
4247208Scaelsee
4347208Scael.Pa /usr/include/sys/acct.h
4447208Scaeland
4547208Scael.Xr acct 5 .
4647208Scael.Pp
4720060SmckusickThis call is permitted only to the super-user.
4847208Scael.Sh NOTES
4920060SmckusickAccounting is automatically disabled when the file system the
5020060Smckusickaccounting file resides on runs out of space; it is enabled when
5120060Smckusickspace once again becomes available.
5247208Scael.Sh RETURN VALUES
5347208ScaelOn error -1 is returned.
5420059SmckusickThe file must exist and the call may be exercised only by the super-user.
5547208Scael.Sh ERRORS
5647208Scael.Fn Acct
5720060Smckusickwill fail if one of the following is true:
5847208Scael.Bl -tag -width Er
5947208Scael.It Bq Er EPERM
6020060SmckusickThe caller is not the super-user.
6147208Scael.It Bq Er ENOTDIR
6220060SmckusickA component of the path prefix is not a directory.
6347208Scael.It Bq Er EINVAL
6421003SmckusickThe pathname contains a character with the high-order bit set.
6547208Scael.It Bq Er ENAMETOOLONG
6621003SmckusickA component of a pathname exceeded 255 characters,
6721003Smckusickor an entire path name exceeded 1023 characters.
6847208Scael.It Bq Er ENOENT
6920060SmckusickThe named file does not exist.
7047208Scael.It Bq Er EACCES
7121003SmckusickSearch permission is denied for a component of the path prefix,
7221003Smckusickor the path name is not a regular file.
7347208Scael.It Bq Er ELOOP
7421003SmckusickToo many symbolic links were encountered in translating the pathname.
7547208Scael.It Bq Er EROFS
7620060SmckusickThe named file resides on a read-only file system.
7747208Scael.It Bq Er EFAULT
7847208Scael.Fa File
7920060Smckusickpoints outside the process's allocated address space.
8047208Scael.It Bq Er EIO
8124439SmckusickAn I/O error occurred while reading from or writing to the file system.
8247208Scael.El
8347208Scael.Sh SEE ALSO
8447208Scael.Xr acct 5 ,
8547208Scael.Xr sa 8
8647208Scael.Sh HISTORY
8747208ScaelAn
8847208Scael.Nm
8947208Scaelfunction call appeared in Version 7 AT&T UNIX.
90