Logs an application error to the system error log.
Run-Time Services Library (librts.a)
#include <sys/errids.h>
int errlog ( ErrorStructure, Length)
void *ErrorStructure;
unsigned int Length;
The errlog subroutine writes an error log entry to the /dev/error file. The errlog subroutine is used by application programs.
The transfer from the err_rec structure to the error log is by a write subroutine to the /dev/error special file.
The errdemon process reads from the /dev/error file and writes the error log entry to the system error log. The timestamp, machine ID, node ID, and Software Vital Product Data associated with the resource name (if any) are added to the entry before going to the log.
ErrorStructure | Points to an error record structure containing an error record. Valid
error record structures are typed in the /usr/include/sys/err_rec.h file. The two error record structures available are err_rec and err_rec0. The err_rec structure is used when the detail_data field
is required. When the detail_data field is not
required, the err_rec0 structure is used. struct err_rec0 { unsigned int error_id; char resource_name[ERR_NAMESIZE]; }; struct err_rec { unsigned int error_id; char resource_name[ERR_NAMESIZE]; char detail_data[1]; }; The fields of the structures err_rec and err_rec0 are:
|
Length | Specifies the length in bytes of the err_rec structure, which is equal to the size of the error_id and resource_name fields plus the length in bytes of the detail_data field. |
0 | The entry was logged successfully. |
-1 | The entry was not logged. |
The errclear, errdead, errinstall, errlogger, errmsg, errpt, errstop, and errupdate commands.
The errlog_open, errlog_close, errlog_find_first, errlog_find_next, errlog_find_sequence, errlog_set_direction, and errlog_write subroutines.
The /dev/error special file.
The errdemon daemon.
The errsave kernel service.
Error Logging Overview in Messages Guide and Reference.