2 * This file is part of the SPL: Solaris Porting Layer.
4 * Copyright (c) 2008 Lawrence Livermore National Security, LLC.
5 * Produced at Lawrence Livermore National Laboratory
7 * Brian Behlendorf <behlendorf1@llnl.gov>,
8 * Herb Wartens <wartens2@llnl.gov>,
9 * Jim Garlick <garlick@llnl.gov>
12 * This is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include <sys/sysmacros.h>
28 #include <sys/cmn_err.h>
30 #ifdef DEBUG_SUBSYSTEM
31 #undef DEBUG_SUBSYSTEM
34 #define DEBUG_SUBSYSTEM S_GENERIC
37 static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" };
38 static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" };
42 vpanic(const char *fmt, va_list ap)
46 vsnprintf(msg, MAXMSGLEN - 1, fmt, ap);
49 EXPORT_SYMBOL(vpanic);
52 vcmn_err(int ce, const char *fmt, va_list ap)
60 vsnprintf(msg, MAXMSGLEN - 1, fmt, ap);
63 CDEBUG(D_INFO, "%s%s%s",
64 ce_prefix[ce], msg, ce_suffix[ce]);
66 CERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]);
69 EXPORT_SYMBOL(vcmn_err);
72 cmn_err(int ce, const char *fmt, ...)
77 vcmn_err(ce, fmt, ap);
80 EXPORT_SYMBOL(cmn_err);