STRLOG(9F) | Kernel Functions for Drivers | STRLOG(9F) |
strlog - submit messages to the log driver
#include <sys/stream.h> #include <sys/strlog.h> #include <sys/log.h> int strlog(short mid, short sid, char level,
unsigned short flags, char *fmt, ...);
Architecture independent level 1 (DDI/DKI).
mid
sid
level
flags
SL_ERROR
SL_TRACE
SL_NOTIFY
SL_CONSOLE
SL_FATAL
SL_WARN
SL_NOTE
fmt
The strlog() function expands the printf(3C) style format string passed to it, that is, the conversion specifiers are replaced by the actual argument values in the format string. The 32-bit representations of the arguments (up to NLORGARGS) follow the string starting at the next 32-bit boundary following the string. Note that the 64-bit argument will be truncated to 32-bits here but will be fully represented in the string.
The messages can be retrieved with the getmsg(2) system call. The flags argument specifies the type of the message and where it is to be sent. strace(8) receives messages from the log driver and sends them to the standard output. strerr(8) receives error messages from the log driver and appends them to a file called /var/adm/streams/error.mm-dd, where mm-dd identifies the date of the error message.
The strlog() function returns 0 if it fails to submit the message to the log(4D) driver and 1 otherwise.
The strlog() function can be called from user, interrupt, or kernel context.
/var/adm/streams/error.mm-dd
getmsg(2), log(4D), strace(8), strerr(8), module_info(9S)
Writing Device Drivers
STREAMS Programming Guide
January 16, 2006 | OmniOS |