xref: /titanic_41/usr/src/uts/common/sys/cmn_err.h (revision c2580b931007758eab8cb5ae8726ebe1588e259b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /*
27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 #ifndef _SYS_CMN_ERR_H
32 #define	_SYS_CMN_ERR_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #if defined(_KERNEL) && !defined(_ASM)
37 #include <sys/va_list.h>
38 #endif
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 /* Common error handling severity levels */
45 
46 #define	CE_CONT		0	/* continuation		*/
47 #define	CE_NOTE		1	/* notice		*/
48 #define	CE_WARN		2	/* warning		*/
49 #define	CE_PANIC	3	/* panic		*/
50 #define	CE_IGNORE	4	/* print nothing	*/
51 
52 #ifndef _ASM
53 
54 #ifdef _KERNEL
55 
56 /*PRINTFLIKE2*/
57 extern void cmn_err(int, const char *, ...)
58     __KPRINTFLIKE(2);
59 #pragma rarely_called(cmn_err)
60 
61 extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
62     __KVPRINTFLIKE(3);
63 #pragma rarely_called(vzcmn_err)
64 
65 extern void vcmn_err(int, const char *, __va_list)
66     __KVPRINTFLIKE(2);
67 #pragma rarely_called(vcmn_err)
68 
69 /*PRINTFLIKE3*/
70 extern void zcmn_err(zoneid_t, int, const char *, ...)
71     __KPRINTFLIKE(3);
72 #pragma rarely_called(zcmn_err)
73 
74 /*PRINTFLIKE1*/
75 extern void printf(const char *, ...)
76     __KPRINTFLIKE(1);
77 #pragma	rarely_called(printf)
78 
79 extern void vzprintf(zoneid_t, const char *, __va_list)
80     __KVPRINTFLIKE(2);
81 #pragma rarely_called(vzprintf)
82 
83 /*PRINTFLIKE2*/
84 extern void zprintf(zoneid_t, const char *, ...)
85     __KPRINTFLIKE(2);
86 #pragma rarely_called(zprintf)
87 
88 extern void vprintf(const char *, __va_list)
89     __KVPRINTFLIKE(1);
90 #pragma	rarely_called(vprintf)
91 
92 /*PRINTFLIKE1*/
93 extern void uprintf(const char *, ...)
94     __KPRINTFLIKE(1);
95 #pragma rarely_called(uprintf)
96 
97 extern void vuprintf(const char *, __va_list)
98     __KVPRINTFLIKE(1);
99 #pragma rarely_called(vuprintf)
100 
101 /*PRINTFLIKE3*/
102 extern size_t snprintf(char *, size_t, const char *, ...)
103     __KPRINTFLIKE(3);
104 extern size_t vsnprintf(char *, size_t, const char *, __va_list)
105     __KVPRINTFLIKE(3);
106 /*PRINTFLIKE2*/
107 extern char *sprintf(char *, const char *, ...)
108     __KPRINTFLIKE(2);
109 extern char *vsprintf(char *, const char *, __va_list)
110     __KVPRINTFLIKE(2);
111 
112 /*PRINTFLIKE1*/
113 extern void panic(const char *, ...)
114     __KPRINTFLIKE(1) __NORETURN;
115 #pragma rarely_called(panic)
116 
117 extern void vpanic(const char *, __va_list)
118     __KVPRINTFLIKE(1) __NORETURN;
119 #pragma rarely_called(vpanic)
120 
121 #endif /* _KERNEL */
122 #endif /* !_ASM */
123 
124 #ifdef	__cplusplus
125 }
126 #endif
127 
128 #endif	/* _SYS_CMN_ERR_H */
129