klog - kernel error logging interface
Minor device 0 of the klog driver is the interface between a process and
the kernel's error logging mechanism. When this device is open, messages
printed by the kernel, which normally appear only in the system console
window, also are buffered by the klog driver. The data obtained by
reading from this driver are the text of the kernel messages. The driver
may be opened only for reading by a single process. Each read causes the
requested number of bytes to be retrieved; the request is truncated if
the read request is for more than the data currently available.
Normally, this device is opened and read by syslogd(1M), the system
This special device supports the following open(2) flags:
When set a read will not block if no data is present. If not
set, a read will block until information becomes available.
Each ioctl(2) call that this special device supports has the form:
ioctl(fd, cmd, arg)
where the format and meaning of arg vary with the specified cmd as
Returns the number of bytes currently available to read to the
area pointed to by arg, where arg is treated as a pointer to a
variable of type size_t.
Enables or disables non-blocking mode, according to the boolean
value supplied as arg. Enabling this mode has the same affect
as the O_NDELAY flag for open(2).
Enables or disables asynchronous mode, according to the boolean
value supplied as arg. When asynchronous mode is enabled, the
process group associated with the open of the special device
receives a SIGIO signal when data is available to be read.
Set the process group for use with asynchronous I/O (FIOASYNC).
For this command, arg should contain the process group id.
Returns the current process group to the area pointed to by
arg, where arg is treated as a pointer to a variable of type
/dev/klog special file
open(2), ioctl(2), syslogd(1M)
PPPPaaaaggggeeee 2222 [ Back ]