[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

errlog_open Subroutine


Opens an error log and returns a handle for use with other liberrlog.a functions.


library liberrlog.a

#include <fcntl.h>
#include <sys/errlog.h>

int errlog_open(path, mode, magic, handle)
char            *path;
int              mode;
unsigned int     magic;
errlog_handle_t *handle;


The error log specified by the path argument will be opened using mode. The handle pointed to by the handle parameter must be used with subsequent operations.


The path parameter specifies the path to the log file to be opened. If path is NULL, the default errlog file will be opened. The valid values for mode are the same as they are for the open system subroutine. They can be found in the fcntl.h files.

The magic argument takes the LE_MAGIC value, indicating which version of the errlog_entry_t structure this application was compiled with.

Return Values

Upon successful completion, the errlog_open subroutine returns a 0 and sets the memory pointed to by handle to a handle used by subsequent liberrlog operations.

Upon error, the errlog_open subroutine returns one of the following:

LE_ERR_INVARG A parameter error was detected.
LE_ERR_NOFILE The log file does not exist.
LE_ERR_NOMEM Memory could not be allocated.
LE_ERR_IO An i/o error occurred.
LE_ERR_INVFILE The file is not a valid error log.

Related Information

The errlog_close, errlog_find_first, errlog_find_next, errlog_find_sequence, errlog_set_direction, errlog_write, and errlog subroutines.

The /usr/include/fcntl.h include files found in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]