send a message to syslogd
() function is used to transmit a
direct to syslogd(8)
requiring the allocation of a socket. The msg
is not NUL terminated and its len
to 8192 bytes. If
is specified in
is not accepting
messages, the message will be sent to the console. This is used internally by
, so that messages
can be sent during difficult situations. If sending to
messages are counted. When
works again, a
warning with the counter and error number is logged.
To receive messages from the kernel,
has to create a
datagram socket pair and register one end. This registration is done by
opening the /dev/klog
device and passing one file
descriptor of the socket pair as argument to
invoked on the klog file
descriptor. After that the messages can be be read from the other end of the
socket pair. By utilizing /dev/klog
the access to
log messages is limited to processes that may open this device.
Upon successful completion, the value 0 is returned; otherwise the
value -1 is returned and the global variable
is set to indicate the error.
() can fail if:
- An invalid user space address was specified for a
- The socket requires that message be sent atomically, and
the size of the message to be sent made this impossible.
- The system was unable to allocate an internal buffer. The
operation may succeed when buffers become available.
- The message cannot be sent, likely because
syslogd(8) is not
() function call appeared in
argument was added in