acct

Name

acct -- switch process accounting on or off

Synopsis

#include <dirent.h>

int acct(const char * filename);

Description

When filename is the name of an existing file, acct() turns accounting on and appends a record to filename for each terminating process. When filename is NULL, acct() turns accounting off.

Return Value

On success, 0 is returned.On error, -1 is returned and the global variable errno is set appropriately.

Errors

[ENOSYS] 

BSD process accounting has not been enabled when the operating system kernel was compiled. The kernel configuration parameter controlling this feature is CONFIG_BSD_PROCESS_ACCT.

[ENOMEM] 

Out of memory.

[EPERM] 

The calling process has no permission to enable process accounting.

[EACCES] 

filename is not a regular file.

[EIO] 

Error writing to the filename.

[EUSERS] 

There are no more free file structures or we run out of memory.