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 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
31 * Copyright 2016 Joyent, Inc.
32 */
33
34 #ifndef _SYS_CMN_ERR_H
35 #define _SYS_CMN_ERR_H
36
37 #if !defined(_ASM) && (defined(_KERNEL) || defined(_FAKE_KERNEL))
38 #include <sys/va_list.h>
39 #endif
40
41 #include <sys/dditypes.h>
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 /* Common error handling severity levels */
48
49 #define CE_CONT 0 /* continuation */
50 #define CE_NOTE 1 /* notice */
51 #define CE_WARN 2 /* warning */
52 #define CE_PANIC 3 /* panic */
53 #define CE_IGNORE 4 /* print nothing */
54
55 #if !defined(_ASM) && (defined(_KERNEL) || defined(_FAKE_KERNEL))
56
57 /*PRINTFLIKE2*/
58 extern void cmn_err(int, const char *, ...)
59 __KPRINTFLIKE(2);
60
61 extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
62 __KVPRINTFLIKE(3);
63
64 extern void dev_err(dev_info_t *, int, char *, ...)
65 __KPRINTFLIKE(3);
66
67 extern void vdev_err(dev_info_t *, int, const char *, __va_list)
68 __KVPRINTFLIKE(3);
69
70 extern void vcmn_err(int, const char *, __va_list)
71 __KVPRINTFLIKE(2);
72
73 /*PRINTFLIKE3*/
74 extern void zcmn_err(zoneid_t, int, const char *, ...)
75 __KPRINTFLIKE(3);
76
77 /*PRINTFLIKE1*/
78 extern void printf(const char *, ...)
79 __KPRINTFLIKE(1);
80
81 extern void vzprintf(zoneid_t, const char *, __va_list)
82 __KVPRINTFLIKE(2);
83
84 /*PRINTFLIKE2*/
85 extern void zprintf(zoneid_t, const char *, ...)
86 __KPRINTFLIKE(2);
87
88 extern void vprintf(const char *, __va_list)
89 __KVPRINTFLIKE(1);
90
91 /*PRINTFLIKE1*/
92 extern void uprintf(const char *, ...)
93 __KPRINTFLIKE(1);
94
95 extern void vuprintf(const char *, __va_list)
96 __KVPRINTFLIKE(1);
97
98 /*PRINTFLIKE3*/
99 extern size_t snprintf(char *, size_t, const char *, ...)
100 __KPRINTFLIKE(3);
101 extern size_t vsnprintf(char *, size_t, const char *, __va_list)
102 __KVPRINTFLIKE(3);
103 /*PRINTFLIKE2*/
104 extern char *sprintf(char *, const char *, ...)
105 __KPRINTFLIKE(2);
106 extern char *vsprintf(char *, const char *, __va_list)
107 __KVPRINTFLIKE(2);
108
109 /*PRINTFLIKE1*/
110 extern void panic(const char *, ...)
111 __KPRINTFLIKE(1) __NORETURN;
112
113 extern void vpanic(const char *, __va_list)
114 __KVPRINTFLIKE(1) __NORETURN;
115
116 #endif /* !_ASM && _KERNEL ... */
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122 #endif /* _SYS_CMN_ERR_H */
|
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 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
31 * Copyright 2016 Joyent, Inc.
32 * Copyright 2017 RackTop Systems.
33 */
34
35 #ifndef _SYS_CMN_ERR_H
36 #define _SYS_CMN_ERR_H
37
38 #if !defined(_ASM) && (defined(_KERNEL) || defined(_FAKE_KERNEL))
39 #include <sys/va_list.h>
40 #endif
41
42 #include <sys/dditypes.h>
43
44 #if !defined(_ASM) && defined(_FAKE_KERNEL)
45 #include <stdio.h>
46 #endif
47
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51
52 /* Common error handling severity levels */
53
54 #define CE_CONT 0 /* continuation */
55 #define CE_NOTE 1 /* notice */
56 #define CE_WARN 2 /* warning */
57 #define CE_PANIC 3 /* panic */
58 #define CE_IGNORE 4 /* print nothing */
59
60 #if !defined(_ASM) && (defined(_KERNEL) || defined(_FAKE_KERNEL))
61
62 /*PRINTFLIKE2*/
63 extern void cmn_err(int, const char *, ...)
64 __KPRINTFLIKE(2);
65
66 extern void vcmn_err(int, const char *, __va_list)
67 __KVPRINTFLIKE(2);
68
69 #ifndef _FAKE_KERNEL
70 /*
71 * The following functions are either absent from libfakekernel
72 * or have different prototypes from the versions in libc.
73 */
74
75 extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
76 __KVPRINTFLIKE(3);
77
78 extern void dev_err(dev_info_t *, int, char *, ...)
79 __KPRINTFLIKE(3);
80
81 extern void vdev_err(dev_info_t *, int, const char *, __va_list)
82 __KVPRINTFLIKE(3);
83
84 /*PRINTFLIKE3*/
85 extern void zcmn_err(zoneid_t, int, const char *, ...)
86 __KPRINTFLIKE(3);
87
88 /*PRINTFLIKE1*/
89 extern void printf(const char *, ...)
90 __KPRINTFLIKE(1);
91
92 extern void vzprintf(zoneid_t, const char *, __va_list)
93 __KVPRINTFLIKE(2);
94
95 /*PRINTFLIKE2*/
96 extern void zprintf(zoneid_t, const char *, ...)
97 __KPRINTFLIKE(2);
98
99 extern void vprintf(const char *, __va_list)
100 __KVPRINTFLIKE(1);
101
102 /*PRINTFLIKE1*/
103 extern void uprintf(const char *, ...)
104 __KPRINTFLIKE(1);
105
106 extern void vuprintf(const char *, __va_list)
107 __KVPRINTFLIKE(1);
108
109 /*PRINTFLIKE3*/
110 extern size_t snprintf(char *, size_t, const char *, ...)
111 __KPRINTFLIKE(3);
112 extern size_t vsnprintf(char *, size_t, const char *, __va_list)
113 __KVPRINTFLIKE(3);
114 /*PRINTFLIKE2*/
115 extern char *sprintf(char *, const char *, ...)
116 __KPRINTFLIKE(2);
117 extern char *vsprintf(char *, const char *, __va_list)
118 __KVPRINTFLIKE(2);
119
120 #endif /* !_FAKE_KERNEL */
121
122 /*PRINTFLIKE1*/
123 extern void panic(const char *, ...)
124 __KPRINTFLIKE(1) __NORETURN;
125
126 extern void vpanic(const char *, __va_list)
127 __KVPRINTFLIKE(1) __NORETURN;
128
129 #endif /* !_ASM && _KERNEL ... */
130
131 #ifdef __cplusplus
132 }
133 #endif
134
135 #endif /* _SYS_CMN_ERR_H */
|