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