COHERENT manpages

This page displays the COHERENT manpage for acct() [Enable/disable process accounting].

List of available manpages
Index


acct() -- System Call (libc)

Enable/disable process accounting
#include <acct.h>
acct(file)
char *file;

Process accounting  records who initiates each system  process and how long
each process  takes to execute.  These data can  be analyzed, to administer
the system most efficiently.

The system call acct() enables  or disables process accounting.  If file is
not NULL,  then accounting  is turned  on; if file  is NULL,  however, then
process accounting is turned off.

It  is usual,  but not  necessary, that file  be /usr/adm/acct.   file must
exist.  When  enabled, the system  appends a raw accounting  data record in
the format described by acct.h to file as each process terminates.

acct() is restricted to the superuser.

See Also

ac,
acct.h,
accton,
exit(),
libc,
sa,
times(),

Diagnostics

Successful  calls  return zero.   acct()  returns -1  for  errors, such  as
nonexistent file or invocation by a user other than the superuser.

Notes

The system  writes accounting records  for a process only  when the process
exits.  Processes that never terminate and processes running at the time of
a system crash do not produce accounting information.