'\" te .\" Copyright (c) 2006, Sun Microsystems, Inc. .\" All Rights Reserved. .\" Copyright 2006 AT&T .\" 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. .\" 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. .\" 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] .TH strlog 9F "16 Jan 2006" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME strlog \- submit messages to the log driver .SH SYNOPSIS .LP .nf #include #include #include \fBint\fR \fBstrlog\fR(\fBshort\fR \fImid\fR, \fBshort\fR \fIsid\fR, \fBchar\fR \fIlevel\fR, \fBunsigned short\fR \fIflags\fR, \fBchar *\fR\fIfmt\fR, ...); .fi .SH INTERFACE LEVEL .sp .LP Architecture independent level 1 (DDI/DKI). .SH PARAMETERS .sp .ne 2 .mk .na \fB\fImid\fR\fR .ad .RS 9n .rt Identification number of the module or driver submitting the message (in the case of a module, its \fBmi_idnum\fR value from \fBmodule_info\fR(9S)). .RE .sp .ne 2 .mk .na \fB\fIsid\fR\fR .ad .RS 9n .rt Identification number for a particular minor device. .RE .sp .ne 2 .mk .na \fB\fIlevel\fR\fR .ad .RS 9n .rt Tracing level for selective screening of low priority messages. Larger values imply less important information. .RE .sp .ne 2 .mk .na \fB\fIflags\fR\fR .ad .RS 9n .rt Valid flag values are: .sp .ne 2 .mk .na \fB\fBSL_ERROR\fR\fR .ad .RS 14n .rt Message is for error logger. .RE .sp .ne 2 .mk .na \fB\fBSL_TRACE\fR\fR .ad .RS 14n .rt Message is for trace. .RE .sp .ne 2 .mk .na \fB\fBSL_NOTIFY\fR\fR .ad .RS 14n .rt Mail copy of message to system administrator. .RE .sp .ne 2 .mk .na \fB\fBSL_CONSOLE\fR\fR .ad .RS 14n .rt Log message to console. .RE .sp .ne 2 .mk .na \fB\fBSL_FATAL\fR\fR .ad .RS 14n .rt Error is fatal. .RE .sp .ne 2 .mk .na \fB\fBSL_WARN\fR\fR .ad .RS 14n .rt Error is a warning. .RE .sp .ne 2 .mk .na \fB\fBSL_NOTE\fR\fR .ad .RS 14n .rt Error is a notice. .RE .RE .sp .ne 2 .mk .na \fB\fIfmt\fR\fR .ad .RS 9n .rt \fBprintf\fR(3C) style format string. \fB%e\fR, \fB%g\fR, and \fB%G\fR formats are not allowed but \fB%s\fR is supported. .RE .SH DESCRIPTION .sp .LP The \fBstrlog()\fR function expands the \fBprintf\fR(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 \fBNLORGARGS\fR) 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. .sp .LP The messages can be retrieved with the \fBgetmsg\fR(2) system call. The \fIflags\fR argument specifies the type of the message and where it is to be sent. \fBstrace\fR(1M) receives messages from the \fBlog\fR driver and sends them to the standard output. \fBstrerr\fR(1M) receives error messages from the \fBlog\fR driver and appends them to a file called \fB/var/adm/streams/error.\fR\fImm-dd\fR, where \fImm-dd\fR identifies the date of the error message. .SH RETURN VALUES .sp .LP The \fBstrlog()\fR function returns \fB0\fR if it fails to submit the message to the \fBlog\fR(7D) driver and \fB1\fR otherwise. .SH CONTEXT .sp .LP The \fBstrlog()\fR function can be called from user, interrupt, or kernel context. .SH FILES .sp .ne 2 .mk .na \fB\fB/var/adm/streams/error.\fR\fImm-dd\fR\fR .ad .sp .6 .RS 4n Error messages dated \fImm-dd\fR appended by \fBstrerr\fR(1M) from the \fBlog\fR driver .RE .SH SEE ALSO .sp .LP \fBstrace\fR(1M), \fBstrerr\fR(1M), \fBgetmsg\fR(2), \fBlog\fR(7D), \fBmodule_info\fR(9S) .sp .LP \fIWriting Device Drivers\fR .sp .LP \fISTREAMS Programming Guide\fR