diff options
Diffstat (limited to 'usr/src/man/man9f/cmn_err.9f')
-rw-r--r-- | usr/src/man/man9f/cmn_err.9f | 102 |
1 files changed, 34 insertions, 68 deletions
diff --git a/usr/src/man/man9f/cmn_err.9f b/usr/src/man/man9f/cmn_err.9f index 6b19ae958d..b58a537ebe 100644 --- a/usr/src/man/man9f/cmn_err.9f +++ b/usr/src/man/man9f/cmn_err.9f @@ -4,7 +4,7 @@ .\" 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 cmn_err 9F "16 Jan 2006" "SunOS 5.11" "Kernel Functions for Drivers" +.TH CMN_ERR 9F "Jan 16, 2006" .SH NAME cmn_err, vcmn_err, zcmn_err \- display an error message or panic the system .SH SYNOPSIS @@ -45,23 +45,19 @@ Architecture independent level 1 (DDI/DKI). .SS "cmn_err(\|)" .sp .ne 2 -.mk .na \fB\fIlevel\fR\fR .ad .RS 10n -.rt A constant indicating the severity of the error condition. .RE .sp .ne 2 -.mk .na \fB\fIformat\fR\fR .ad .RS 10n -.rt Message to be displayed. .RE @@ -72,12 +68,10 @@ The \fBvcmn_err()\fR function takes \fIlevel\fR and \fIformat\fR as described for \fBcmn_err()\fR, but its third argument is different: .sp .ne 2 -.mk .na \fB\fIap\fR\fR .ad .RS 6n -.rt Variable argument list passed to the function. .RE @@ -88,12 +82,10 @@ The \fBzcmn_err()\fR function works exactly like \fBcmn_err()\fR, but includes an additional argument: .sp .ne 2 -.mk .na \fB\fIzoneid\fR\fR .ad .RS 10n -.rt Zone to which log messages should be directed. See \fBzones\fR(5). .RE @@ -112,12 +104,10 @@ attempt to write a core file, and halt system processing. See the four severity levels are: .sp .ne 2 -.mk .na \fB\fBCE_CONT\fR\fR .ad .RS 12n -.rt Used to continue another message or to display an informative message not associated with an error. Note that multiple \fBCE_CONT\fR messages without a newline may or may not appear on the system console or in the system log as a @@ -128,12 +118,10 @@ message with \fBsprintf\fR(9F) or \fBvsprintf\fR(9F) before calling .sp .ne 2 -.mk .na \fB\fBCE_NOTE\fR\fR .ad .RS 12n -.rt Used to display a message preceded with \fBNOTICE\fR. This message is used to report system events that do not necessarily require user action, but may interest the system administrator. For example, a message saying that a sector @@ -143,12 +131,10 @@ might be noteworthy. .sp .ne 2 -.mk .na \fB\fBCE_WARN\fR\fR .ad .RS 12n -.rt Used to display a message preceded with \fBWARNING\fR. This message is used to report system events that require immediate attention, such as those where if an action is not taken, the system may panic. For example, when a peripheral @@ -157,12 +143,10 @@ device does not initialize correctly, this level should be used. .sp .ne 2 -.mk .na \fB\fBCE_PANIC\fR\fR .ad .RS 12n -.rt Used to display a message preceded with \fB"panic"\fR, and to panic the system. Drivers should specify this level only under the most severe conditions or when debugging a driver. A valid use of this level is when the system cannot @@ -195,12 +179,10 @@ any other conversion character is ignored. A character indicating the type of conversion to be applied: .sp .ne 2 -.mk .na \fB\fBd\fR,\fBD\fR,\fBo\fR,\fBO\fR,\fBx\fR,\fBX\fR,\fBu\fR\fR .ad .RS 17n -.rt The integer argument is converted to signed decimal (\fBd\fR, \fBD\fR), unsigned octal (\fBo\fR, \fBO\fR), unsigned hexadecimal (\fBx\fR, \fBX\fR), or unsigned decimal (\fBu\fR), respectively, and displayed. The letters @@ -209,23 +191,19 @@ unsigned decimal (\fBu\fR), respectively, and displayed. The letters .sp .ne 2 -.mk .na \fB\fBc\fR\fR .ad .RS 17n -.rt The character value of the argument is displayed. .RE .sp .ne 2 -.mk .na \fB\fBb\fR\fR .ad .RS 17n -.rt The \fB%b\fR conversion specification allows bit values to be displayed meaningfully. Each \fB%b\fR takes an integer value and a format string from the argument list. The first character of the format string should be the output @@ -239,12 +217,10 @@ is displayed after the numerical value. See EXAMPLE section. .sp .ne 2 -.mk .na \fBp\fR .ad .RS 17n -.rt The argument is taken to be a pointer; the value of the pointer is displayed in unsigned hexadecimal. The display format is equivalent to \fB%lx\fR. To avoid lint warnings, cast pointers to type \fBvoid *\fR when using the \fB%p\fR @@ -253,12 +229,10 @@ format specifier. .sp .ne 2 -.mk .na \fB\fBs\fR\fR .ad .RS 17n -.rt The argument is taken to be a string (character pointer), and characters from the string are displayed until a null character is encountered. If the character pointer is \fINULL\fR, the string \fB<null string>\fR is used in its @@ -267,12 +241,10 @@ place. .sp .ne 2 -.mk .na \fB\fB%\fR\fR .ad .RS 17n -.rt Copy a \fB%\fR; no argument is converted. .RE @@ -281,34 +253,28 @@ Copy a \fB%\fR; no argument is converted. The first character in \fIformat\fR affects where the message will be written: .sp .ne 2 -.mk .na \fB\fB!\fR\fR .ad .RS 5n -.rt The message goes only to the system log. .RE .sp .ne 2 -.mk .na \fB\fB^\fR\fR .ad .RS 5n -.rt The message goes only to the console. .RE .sp .ne 2 -.mk .na \fB\fB?\fR\fR .ad .RS 5n -.rt If \fIlevel\fR is also \fBCE_CONT,\fR the message is always sent to the system log, but is only written to the console when the system has been booted in verbose mode. See \fBkernel\fR(1M). If neither condition is met, the '?\|' @@ -376,34 +342,34 @@ both the system console and in the system log (line 28). .sp .in +2 .nf -1 struct reg { -2 uchar_t data; -3 uchar_t csr; -4 }; -5 -6 struct xxstate { -7 .\|.\|. -8 dev_info_t *dip; -9 struct reg *regp; -10 .\|.\|. -11 }; -12 -13 dev_t dev; -14 struct xxstate *xsp; -15 .\|.\|. -16 #ifdef DEBUG /* in debugging mode, log function call */ -17 cmn_err(CE_CONT, "!%s%d: xxopen function called.", -18 ddi_binding_name(xsp->dip), getminor(dev)); -19 #endif /* end DEBUG */ -20 .\|.\|. -21 /* display device power failure on system console */ -22 if ((xsp->regp->csr & POWER) == OFF) -23 cmn_err(CE_NOTE, "^OFF.", -24 ddi_binding_name(xsp->dip), getminor(dev)); -25 .\|.\|. -26 /* display warning if device has bad VTOC */ -27 if (xsp->regp->csr & BADVTOC) -28 cmn_err(CE_WARN, "%s%d: xxopen: Bad VTOC.", +1 struct reg { +2 uchar_t data; +3 uchar_t csr; +4 }; +5 +6 struct xxstate { +7 .\|.\|. +8 dev_info_t *dip; +9 struct reg *regp; +10 .\|.\|. +11 }; +12 +13 dev_t dev; +14 struct xxstate *xsp; +15 .\|.\|. +16 #ifdef DEBUG /* in debugging mode, log function call */ +17 cmn_err(CE_CONT, "!%s%d: xxopen function called.", +18 ddi_binding_name(xsp->dip), getminor(dev)); +19 #endif /* end DEBUG */ +20 .\|.\|. +21 /* display device power failure on system console */ +22 if ((xsp->regp->csr & POWER) == OFF) +23 cmn_err(CE_NOTE, "^OFF.", +24 ddi_binding_name(xsp->dip), getminor(dev)); +25 .\|.\|. +26 /* display warning if device has bad VTOC */ +27 if (xsp->regp->csr & BADVTOC) +28 cmn_err(CE_WARN, "%s%d: xxopen: Bad VTOC.", 29 ddi_binding_name(xsp->dip), getminor(dev)); .fi .in -2 @@ -455,11 +421,11 @@ error message before calling \fBcmn_err()\fR. #include <sys/varargs.h> #include <sys/ddi.h> #include <sys/sunddi.h> -#define MAX_MSG 256; +#define MAX_MSG 256; -void -xxerror(dev_info_t *dip, int level, const char *fmt, .\|.\|.\|) -{ +void +xxerror(dev_info_t *dip, int level, const char *fmt, .\|.\|.\|) +{ va_list ap; int instance; char buf[MAX_MSG], *name; @@ -475,7 +441,7 @@ va_end(ap); /* pass formatted string to cmn_err(9F) */ -cmn_err(level, "%s%d: %s", name, instance, buf); +cmn_err(level, "%s%d: %s", name, instance, buf); } .fi |