#include <evlog.h> int log_read( const logd_t logdes, struct log_entry *entry, void *log_buf, const size_t log_len, const size_t *log_sizeread );
A successful call to log_read()
returns a value of zero
and an unsuccessful call returns the errno
.
logdes
argument is not a valid log file descriptor.
entry
argument is not a valid pointer to a log entry structure.
log_sizeread
argument is not a valid pointer to a size_t.
log_read()
.
log_buf
was not a valid pointer.
log_len
.
The log_read()
function reads the log_entry
structure and up to log_len
bytes of data from the next
event record of the log file associated with the open log file
descriptor logdes
. The event record read is placed
into the log_entry
structure pointed to by
entry
and any data into the buffer pointed to by log_buf
.
The log record ID of the returned event record is be stored in the
log_recid
member of the log_entry
structure for the event
record.
If the query attribute of the open log file description associated with
the logdes
is set, the event record read will match that query.
If the log_read()
is successful the call stores the actual length
of the data associated with the event record into the location specified by
log_sizeread
. This number will be less than or equal to
log_len
.
The _POSIX_LOGGING
feature flag is defined to indicate
this service is available.
When EINVAL
is returned, then no data is returned although the
event record is returned. This is an extension to the POSIX specification.
The POSIX specification specifically allows log_read()
to write
greater than log_len
bytes into log_buf
. This is highly
undesirable and this implementation will NOT do this.
Copyright © 1988-2004 OAR Corporation