1f06dce2cSAndrew Stormont /*
2f06dce2cSAndrew Stormont  * CDDL HEADER START
3f06dce2cSAndrew Stormont  *
4f06dce2cSAndrew Stormont  * The contents of this file are subject to the terms of the
5f06dce2cSAndrew Stormont  * Common Development and Distribution License, Version 1.0 only
6f06dce2cSAndrew Stormont  * (the "License").  You may not use this file except in compliance
7f06dce2cSAndrew Stormont  * with the License.
8f06dce2cSAndrew Stormont  *
9f06dce2cSAndrew Stormont  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10f06dce2cSAndrew Stormont  * or http://www.opensolaris.org/os/licensing.
11f06dce2cSAndrew Stormont  * See the License for the specific language governing permissions
12f06dce2cSAndrew Stormont  * and limitations under the License.
13f06dce2cSAndrew Stormont  *
14f06dce2cSAndrew Stormont  * When distributing Covered Code, include this CDDL HEADER in each
15f06dce2cSAndrew Stormont  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16f06dce2cSAndrew Stormont  * If applicable, add the following below this CDDL HEADER, with the
17f06dce2cSAndrew Stormont  * fields enclosed by brackets "[]" replaced with your own identifying
18f06dce2cSAndrew Stormont  * information: Portions Copyright [yyyy] [name of copyright owner]
19f06dce2cSAndrew Stormont  *
20f06dce2cSAndrew Stormont  * CDDL HEADER END
21f06dce2cSAndrew Stormont  */
22f06dce2cSAndrew Stormont /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23f06dce2cSAndrew Stormont /*	  All Rights Reserved	*/
24f06dce2cSAndrew Stormont 
25f06dce2cSAndrew Stormont 
26f06dce2cSAndrew Stormont /*
27f06dce2cSAndrew Stormont  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28f06dce2cSAndrew Stormont  * Use is subject to license terms.
29f06dce2cSAndrew Stormont  *
30f06dce2cSAndrew Stormont  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
31f06dce2cSAndrew Stormont  * Copyright 2016 Joyent, Inc.
32f06dce2cSAndrew Stormont  * Copyright 2017 RackTop Systems.
33f06dce2cSAndrew Stormont  */
34f06dce2cSAndrew Stormont 
35f06dce2cSAndrew Stormont #ifndef _SYS_CMN_ERR_H
36f06dce2cSAndrew Stormont #define	_SYS_CMN_ERR_H
37f06dce2cSAndrew Stormont 
38f06dce2cSAndrew Stormont #include <stdio.h>
39f06dce2cSAndrew Stormont 
40f06dce2cSAndrew Stormont #if !defined(_ASM) && (defined(_KERNEL) || defined(_FAKE_KERNEL))
41f06dce2cSAndrew Stormont #include <sys/va_list.h>
42f06dce2cSAndrew Stormont #endif
43f06dce2cSAndrew Stormont 
44f06dce2cSAndrew Stormont #include <sys/dditypes.h>
45f06dce2cSAndrew Stormont 
46f06dce2cSAndrew Stormont #ifdef	__cplusplus
47f06dce2cSAndrew Stormont extern "C" {
48f06dce2cSAndrew Stormont #endif
49f06dce2cSAndrew Stormont 
50f06dce2cSAndrew Stormont /* Common error handling severity levels */
51f06dce2cSAndrew Stormont 
52f06dce2cSAndrew Stormont #define	CE_CONT		0	/* continuation		*/
53f06dce2cSAndrew Stormont #define	CE_NOTE		1	/* notice		*/
54f06dce2cSAndrew Stormont #define	CE_WARN		2	/* warning		*/
55f06dce2cSAndrew Stormont #define	CE_PANIC	3	/* panic		*/
56f06dce2cSAndrew Stormont #define	CE_IGNORE	4	/* print nothing	*/
57f06dce2cSAndrew Stormont 
58f06dce2cSAndrew Stormont #if !defined(_ASM) && (defined(_KERNEL) || defined(_FAKE_KERNEL))
59f06dce2cSAndrew Stormont 
60f06dce2cSAndrew Stormont /*PRINTFLIKE2*/
61f06dce2cSAndrew Stormont extern void cmn_err(int, const char *, ...)
62f06dce2cSAndrew Stormont     __KPRINTFLIKE(2);
63f06dce2cSAndrew Stormont 
64f06dce2cSAndrew Stormont extern void vcmn_err(int, const char *, __va_list)
65f06dce2cSAndrew Stormont     __KVPRINTFLIKE(2);
66f06dce2cSAndrew Stormont 
67*8329232eSGordon Ross /*PRINTFLIKE3*/
68*8329232eSGordon Ross extern void zcmn_err(zoneid_t, int, const char *, ...)
69*8329232eSGordon Ross     __KPRINTFLIKE(3);
70*8329232eSGordon Ross 
71f06dce2cSAndrew Stormont /*PRINTFLIKE1*/
72f06dce2cSAndrew Stormont extern void panic(const char *, ...)
73f06dce2cSAndrew Stormont     __KPRINTFLIKE(1) __NORETURN;
74f06dce2cSAndrew Stormont 
75f06dce2cSAndrew Stormont extern void vpanic(const char *, __va_list)
76f06dce2cSAndrew Stormont     __KVPRINTFLIKE(1) __NORETURN;
77f06dce2cSAndrew Stormont 
78*8329232eSGordon Ross /*PRINTFLIKE2*/
79*8329232eSGordon Ross extern void zprintf(zoneid_t, const char *, ...)
80*8329232eSGordon Ross     __KPRINTFLIKE(2);
81*8329232eSGordon Ross 
82f06dce2cSAndrew Stormont #endif /* !_ASM && (_KERNEL || _FAKE_KERNEL) */
83f06dce2cSAndrew Stormont 
84f06dce2cSAndrew Stormont #ifdef	__cplusplus
85f06dce2cSAndrew Stormont }
86f06dce2cSAndrew Stormont #endif
87f06dce2cSAndrew Stormont 
88f06dce2cSAndrew Stormont #endif	/* _SYS_CMN_ERR_H */