1strlog(9F) Kernel Functions for Drivers strlog(9F)
2
3
4
6 strlog - submit messages to the log driver
7
9 #include <sys/stream.h>
10 #include <sys/strlog.h>
11 #include <sys/log.h>
12
13
14
15 int strlog(short mid, short sid, char level,
16 unsigned short flags, char *fmt, ...);
17
18
20 Architecture independent level 1 (DDI/DKI).
21
23 mid Identification number of the module or driver submitting the
24 message (in the case of a module, its mi_idnum value from mod‐
25 ule_info(9S)).
26
27
28 sid Identification number for a particular minor device.
29
30
31 level Tracing level for selective screening of low priority mes‐
32 sages. Larger values imply less important information.
33
34
35 flags Valid flag values are:
36
37 SL_ERROR Message is for error logger.
38
39
40 SL_TRACE Message is for trace.
41
42
43 SL_NOTIFY Mail copy of message to system administrator.
44
45
46 SL_CONSOLE Log message to console.
47
48
49 SL_FATAL Error is fatal.
50
51
52 SL_WARN Error is a warning.
53
54
55 SL_NOTE Error is a notice.
56
57
58
59 fmt printf(3C) style format string. %e, %g, and %G formats are not
60 allowed but %s is supported.
61
62
64 The strlog() function expands the printf(3C) style format string passed
65 to it, that is, the conversion specifiers are replaced by the actual
66 argument values in the format string. The 32-bit representations of the
67 arguments (up to NLORGARGS) follow the string starting at the next
68 32-bit boundary following the string. Note that the 64-bit argument
69 will be truncated to 32-bits here but will be fully represented in the
70 string.
71
72
73 The messages can be retrieved with the getmsg(2) system call. The flags
74 argument specifies the type of the message and where it is to be sent.
75 strace(1M) receives messages from the log driver and sends them to the
76 standard output. strerr(1M) receives error messages from the log driver
77 and appends them to a file called /var/adm/streams/error.mm-dd, where
78 mm-dd identifies the date of the error message.
79
81 The strlog() function returns 0 if it fails to submit the message to
82 the log(7D) driver and 1 otherwise.
83
85 The strlog() function can be called from user, interrupt, or kernel
86 context.
87
89 /var/adm/streams/error.mm-dd
90
91 Error messages dated mm-dd appended by strerr(1M) from the log
92 driver
93
94
96 strace(1M), strerr(1M), getmsg(2), log(7D), module_info(9S)
97
98
99 Writing Device Drivers
100
101
102 STREAMS Programming Guide
103
104
105
106SunOS 5.11 16 Jan 2006 strlog(9F)