closes the descriptor being used to write to the system logger.
The use of
opens a connection to the system logger for a program.
The string pointed to by
is prepended to every message, and is typically set to the program name.
argument specifies flags which control the operation of
and subsequent calls to
argument establishes a default to be used if
none is specified in subsequent calls to
are given below.
The use of
is optional; it will automatically be called by
if necessary, in which case
will default to NULL.
generates a log message, which will be distributed by
argument is formed by ORing the
values (explained below).
The remaining arguments
and any arguments required by the
except that the two character sequence
will be replaced by
the error message string
A trailing newline may be added if needed.
performs the same task as
with the difference that it takes a set of arguments which have
been obtained using the
variable argument list macros.
The subsections below list the parameters used to set the values of
option, facility, and priority.
is an OR of any of these:
Write directly to system console if there is an error while sending to
Open the connection immediately (normally, the connection is opened when
the first message is logged).
Don't wait for child processes that may have been created while logging
(The GNU C library does not create a child process, so this
option has no effect on Linux.)
The converse of
opening of the connection is delayed until
(This is the default, and need not be specified.)
(Not in POSIX.1-2001.)
Print to stderr as well.
Include PID with each message.
argument is used to specify what type of program is logging the message.
This lets the configuration file specify that messages from different
facilities will be handled differently.
security/authorization messages (DEPRECATED Use
security/authorization messages (private)
(cron and at)
system daemons without separate facility value
kernel messages (these can't be generated from user processes)
This determines the importance of the message.
The levels are, in order of decreasing importance:
system is unusable
action must be taken immediately
normal, but significant, condition
can be used to restrict logging to specified levels only.
are specified in SUSv2 and POSIX.1-2001.
POSIX.1-2001 specifies only the
However, with the exception of
values appear on most Unix systems.
is not specified by POSIX.1-2001, but is available
in most versions of Unix.
in the call of
is probably stored as-is.
Thus, if the string it points to
may start prepending the changed string, and if the string
it points to ceases to exist, the results are undefined.
Most portable is to use a string constant.
Never pass a string with user-supplied data as a format,
use the following instead: