RTEMS Logo

RTEMS 4.6.0 On-Line Library


Event Logging Manager log_write_any - Write to the any log file

PREV UP NEXT Bookshelf New Chapters

1.4.2: log_write_any - Write to the any log file

CALLING SEQUENCE:

#include <evlog.h>

int log_write_any(
  const logd_t          logdes,
  const log_facility_t  facility,
  const int             event_id,
  const log_severity_t  severity,
  const void           *buf,
  const size_t          len
);

STATUS CODES:

A successful call to log_write_any() 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 descriptor.
EINVAL
The facility argument is not a valid log facility.
EINVAL
The severity argument exceeds LOG_SEVERITY_MAX.
EINVAL
The len argument exceeds LOG_MAXIMUM_BUFFER_SIZE.
EINVAL
The len argument was non-zero and buf is NULL.
ENOSPC
The device which contains the log file has run out of space.
EIO
An I/O error occurred in writing to the log file.

DESCRIPTION:

The log_write_any() function writes an event record to the log file specified by logdes. 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:

log_recid
This is set to a monotonically increasing log record id maintained by the system for this individual log file.
log_size
This is set to the value of the len argument.
log_event_id
This is set to the value of the event_id argument.
log_facility
This is set to the value of the facility argument.
log_severity
This is set to the value of the severity argument.
log_uid
This is set to the value returned by geteuid().
log_gid
This is set to the value returned by getegid().
log_pid
This is set to the value returned by getpid().
log_pgrp
This is set to the value returned by getpgrp().
log_time
This is set to the value returned by clock_gettime() for the CLOCK_REALTIME clock source.

NOTES:

The _POSIX_LOGGING feature flag is defined to indicate this service is available.

This implementation can not return the EPERM error.

This function is not defined in the POSIX specification. It is an extension provided by this implementation.


PREV UP NEXT Bookshelf New Chapters

Copyright © 1988-2004 OAR Corporation