8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / man / man9f / strlog.9f
blob505c8f39b760dd71027922c31423a228f9979295
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc.
3 .\" All Rights Reserved.
4 .\" Copyright 2006 AT&T
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH STRLOG 9F "Jan 16, 2006"
9 .SH NAME
10 strlog \- submit messages to the log driver
11 .SH SYNOPSIS
12 .LP
13 .nf
14 #include <sys/stream.h>
15 #include <sys/strlog.h>
16 #include <sys/log.h>
20 \fBint\fR \fBstrlog\fR(\fBshort\fR \fImid\fR, \fBshort\fR \fIsid\fR, \fBchar\fR \fIlevel\fR,
21      \fBunsigned short\fR \fIflags\fR, \fBchar *\fR\fIfmt\fR, ...);
22 .fi
24 .SH INTERFACE LEVEL
25 .sp
26 .LP
27 Architecture independent level 1 (DDI/DKI).
28 .SH PARAMETERS
29 .sp
30 .ne 2
31 .na
32 \fB\fImid\fR\fR
33 .ad
34 .RS 9n
35 Identification number of the module or driver submitting the message (in the
36 case of a module, its \fBmi_idnum\fR value from \fBmodule_info\fR(9S)).
37 .RE
39 .sp
40 .ne 2
41 .na
42 \fB\fIsid\fR\fR
43 .ad
44 .RS 9n
45 Identification number for a particular minor device.
46 .RE
48 .sp
49 .ne 2
50 .na
51 \fB\fIlevel\fR\fR
52 .ad
53 .RS 9n
54 Tracing level for selective screening of low priority messages. Larger values
55 imply less important information.
56 .RE
58 .sp
59 .ne 2
60 .na
61 \fB\fIflags\fR\fR
62 .ad
63 .RS 9n
64 Valid flag values are:
65 .sp
66 .ne 2
67 .na
68 \fB\fBSL_ERROR\fR\fR
69 .ad
70 .RS 14n
71 Message is for error logger.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fBSL_TRACE\fR\fR
78 .ad
79 .RS 14n
80 Message is for trace.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fBSL_NOTIFY\fR\fR
87 .ad
88 .RS 14n
89 Mail copy of message to system administrator.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fBSL_CONSOLE\fR\fR
96 .ad
97 .RS 14n
98 Log message to console.
99 .RE
102 .ne 2
104 \fB\fBSL_FATAL\fR\fR
106 .RS 14n
107 Error is fatal.
111 .ne 2
113 \fB\fBSL_WARN\fR\fR
115 .RS 14n
116 Error is a warning.
120 .ne 2
122 \fB\fBSL_NOTE\fR\fR
124 .RS 14n
125 Error is a notice.
131 .ne 2
133 \fB\fIfmt\fR\fR
135 .RS 9n
136 \fBprintf\fR(3C) style format string. \fB%e\fR, \fB%g\fR, and \fB%G\fR formats
137 are not allowed but \fB%s\fR is supported.
140 .SH DESCRIPTION
143 The \fBstrlog()\fR function expands the \fBprintf\fR(3C) style format string
144 passed to it, that is, the conversion specifiers are replaced by the actual
145 argument values in the format string. The 32-bit representations of the
146 arguments (up to \fBNLORGARGS\fR) follow the string starting at the next 32-bit
147 boundary following the string. Note that the 64-bit argument will be truncated
148 to 32-bits here but will be fully represented in the string.
151 The messages can be retrieved with the \fBgetmsg\fR(2) system call. The
152 \fIflags\fR argument specifies the type of the message and where it is to be
153 sent. \fBstrace\fR(1M) receives messages from the \fBlog\fR driver and sends
154 them to the standard output. \fBstrerr\fR(1M) receives error messages from the
155 \fBlog\fR driver and appends them to a file called
156 \fB/var/adm/streams/error.\fR\fImm-dd\fR, where \fImm-dd\fR identifies the date
157 of the error message.
158 .SH RETURN VALUES
161 The \fBstrlog()\fR function returns \fB0\fR if it fails to submit the message
162 to the \fBlog\fR(7D) driver and \fB1\fR otherwise.
163 .SH CONTEXT
166 The \fBstrlog()\fR function can be called from user, interrupt, or kernel
167 context.
168 .SH FILES
170 .ne 2
172 \fB\fB/var/adm/streams/error.\fR\fImm-dd\fR\fR
174 .sp .6
175 .RS 4n
176 Error messages dated \fImm-dd\fR appended by \fBstrerr\fR(1M) from the
177 \fBlog\fR driver
180 .SH SEE ALSO
183 \fBstrace\fR(1M), \fBstrerr\fR(1M), \fBgetmsg\fR(2), \fBlog\fR(7D),
184 \fBmodule_info\fR(9S)
187 \fIWriting Device Drivers\fR
190 \fISTREAMS Programming Guide\fR