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