acct_wpar Subroutine

Purpose

Enables and disables process accounting.

Syntax

int acct_wpar(PathName, flag)
char * PathName;
int flag;  

Description

The acct_wpar subroutine enables the accounting routine when the PathName parameter specifies the path name of the file to which an accounting record is written for each process that terminates. When the PathName parameter is a 0 or null value, the acct_wpar subroutines disables the accounting routine.

The flag parameter can be used to indicate whether to include workload partition accounting records into the global workload partition's accounting file.

If Network File System (NFS) is installed on your system, the accounting file can reside on another node.

Note: To ensure accurate accounting, each node must have its own accounting file. Although no two nodes should share accounting files, a node's accounting file can be located on any node in the network.

The calling process must have root user authority to use the acct_wpar subroutine.

Parameters

Item Description
PathName Specifies a pointer to the path name of the file or a null pointer. If the PathName parameter refers to a symbolic link, the acct_wpar subroutine causes records to be written to the file pointed to by the symbolic link.
flag Specifies whether to include workload partition accounting records into the global accounting records file. Valid flags are the following:
ACCT_INC_GLOBAL
Include the global workload partition's accounting records.
ACCT_INC_ALL_WPARS
Include all workload partition's accounting records.

Return Values

Item Description
0 The command completed successfully.
-1 The command did not complete successfully. The global variable errno is set to indicate the error.

Error Codes

Item Description
EINVAL Invalid flag argument.
EACCES Write permission is denied for the named accounting file.
EACCES The file named by the PathName parameter is not an ordinary file.
EBUSY An attempt is made to enable accounting when it is already enabled.
ENOENT The file named by the PathName parameter does not exist.
EPERM The calling process does not have root user authority.
EROFS The named file resides on a read-only file system.

If NFS is installed on the system, the acct_wpar subroutine is unsuccessful if the following is true:

Item Description
ETIMEDOUT The connection timed out.