#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).
Identification number of the module or driver submitting the message (in the case of a module, its mi_idnum value from module_info(9S)).
Identification number for a particular minor device.
Tracing level for selective screening of low priority messages. Larger values imply less important information.
Message is for error logger.
Message is for trace.
Mail copy of message to system administrator.
Log message to console.
Error is fatal.
Error is a warning.
Error is a notice.
printf(3C) style format string. %e, %g, and %G formats are not allowed but %s is supported.
strlog() 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(1M) receives messages from the log driver and sends them to the standard output. strerr(1M) 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.
strlog() returns 0 if it fails to submit the message to the log(7D) driver and 1 otherwise.
strlog() can be called from user or interrupt context.
Error messages dated mm-dd appended by strerr(1M) from the log driver