getfilehdr Subroutine
Purpose
Retrieves the header details of the advanced accounting data file.
Library
The libaacct.a library.
Syntax
#define <sys/aacct.h>
getfilehdr(filename, hdrinfo)
char *filename;
struct aacct_file_header *hdrinfo;
Description
The getfilehdr subroutine retrieves the advanced accounting data file header information in a structure of type aacct_file_header and returns it to the caller through the structure pointer passed to it. The data file header contains the system details such as the name of the host, the partition number, and the system model.
Parameters
Item | Description |
---|---|
filename | Name of the advanced accounting data file. |
hdrinfo | Pointer to the aacct_file_header structure in which the header information is returned. |
Security
No restrictions. Any user can call this function.
Return Values
Item | Description |
---|---|
0 | The call to the subroutine was successful. |
-1 | The call to the subroutine failed. |
Error Codes
Item | Description |
---|---|
EINVAL | The passed pointer is NULL. |
ENOENT | Specified data file does not exist. |
EPERM | Permission denied. Unable to read the data file. |