RTEMS Logo

RTEMS 4.6.2 On-Line Library


Event Logging Manager log_read - Read from a log file

PREV UP NEXT Bookshelf New Chapters

1.4.5: log_read - Read from a log file

CALLING SEQUENCE:

#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
);

STATUS CODES:

A successful call to log_read() returns a value of zero and an unsuccessful call returns the errno.

E2BIG
This error indicates an inconsistency in the implementation. Report this as a bug.
EBADF
The logdes argument is not a valid log file descriptor.
EFAULT
The entry argument is not a valid pointer to a log entry structure.
EFAULT
The log_sizeread argument is not a valid pointer to a size_t.
EBUSY
No data available. There are no unread event records remaining in this log file.
EINTR
A signal interrupted the call to log_read().
EIO
An I/O error occurred in reading from the event log.
EINVAL
The matching event record has data associated with it and log_buf was not a valid pointer.
EINVAL
The matching event record has data associated with it which is longer than log_len.

DESCRIPTION:

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.

NOTES:

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.


PREV UP NEXT Bookshelf New Chapters

Copyright © 1988-2004 OAR Corporation