#include <evlog.h> int log_write( const log_facility_t facility, const int event_id, const log_severity_t severity, const void *buf, const size_t len );
A successful call to log_write()
returns a value of zero
and an unsuccessful call returns the errno
.
facility
argument is not a valid log facility.
severity
argument exceeds LOG_SEVERITY_MAX
.
len
argument exceeds LOG_MAXIUM_BUFFER_SIZE
.
len
argument was non-zero and buf
is NULL
.
The log_write
function writes an event record to the
system log file. The event record written consists of the
event attributes specified by the facility
, event_id
,
and severity
arguments as well as the data identified by the
buf
and len
arguments. The fields of the event record
structure to be written are filled in as follows:
len
argument.
event_id
argument.
facility
argument.
severity
argument.
geteuid()
.
getegid()
.
getpid()
.
getpgrp()
.
clock_gettime()
for the
CLOCK_REALTIME clock
source.
The _POSIX_LOGGING
feature flag is defined to indicate
this service is available.
This implementation can not return the EPERM
error.
Copyright © 1988-2004 OAR Corporation