#include <evlog.h> int log_open( logd_t *logdes, const char *path, const log_query_t *query );
A successful call to log_open()
returns a value of zero
and an unsuccessful call returns the errno
.
path
prefix,
or the log file exists and read permission is denied.
log_open()
.
LOG_SEVERITY_MAX
.
path
argument referred to a file that was not a log file.
PATH_MAX
, or a pathname
component is longer than NAME_MAX
while _POSIX_NO_TRUNC
is
in effect.
path
argument does not exist.
path
prefix is not a directory.
The log_open()
function establishes the connection between a
log file and a log file descriptor. It creates an open log file
descriptor that refers to this query stream on the specified log file
The log file descriptor is used by the other log functions to refer
to that log query stream. The path
argument points to a
pathname for a log file. A path
argument of NULL
specifies
the current system log file.
The query
argument is not NULL
, then it points to a log query
specification that is used to filter the records in the log file on
subsequent log_read()
operations. This restricts the set of
event records read using the returned log file descriptor to those
which match the query. A query match occurs for a given record when
that record's facility is a member of the query's facility set and
the record's severity is greater than or equal to the severity specified
in the query.
If the value of the query
argument is NULL
, no query filter
shall be applied.
The _POSIX_LOGGING
feature flag is defined to indicate
this service is available.
POSIX specifies that EINVAL
will be returned if the
log_facilities
field of the query
argument is not
a valid facility set. In this implementation, this condition
can never occur.
Many error codes that POSIX specifies to be returned by log_open()
should actually be detected by open()
and passed back by the
log_open()
implementation. In this implementation, EACCESS
,
EMFILE
, ENAMETOOLONG
, ENFILE
, ENOENT
,
and ENOTDIR
are detected in this manner.
Copyright © 1988-2004 OAR Corporation