xref: /netbsd-src/lib/libc/gen/warn.c (revision 2f410732566daa67baa9fb393cc24660d50b0c75)
1*2f410732Sginsbach /*	$NetBSD: warn.c,v 1.14 2007/06/18 14:13:54 ginsbach Exp $	*/
2ec081115Sjtc 
3ec081115Sjtc /*-
4ec081115Sjtc  * Copyright (c) 1993
5ec081115Sjtc  *	The Regents of the University of California.  All rights reserved.
6ec081115Sjtc  *
7ec081115Sjtc  * Redistribution and use in source and binary forms, with or without
8ec081115Sjtc  * modification, are permitted provided that the following conditions
9ec081115Sjtc  * are met:
10ec081115Sjtc  * 1. Redistributions of source code must retain the above copyright
11ec081115Sjtc  *    notice, this list of conditions and the following disclaimer.
12ec081115Sjtc  * 2. Redistributions in binary form must reproduce the above copyright
13ec081115Sjtc  *    notice, this list of conditions and the following disclaimer in the
14ec081115Sjtc  *    documentation and/or other materials provided with the distribution.
15eb7c1594Sagc  * 3. Neither the name of the University nor the names of its contributors
16ec081115Sjtc  *    may be used to endorse or promote products derived from this software
17ec081115Sjtc  *    without specific prior written permission.
18ec081115Sjtc  *
19ec081115Sjtc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20ec081115Sjtc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21ec081115Sjtc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22ec081115Sjtc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23ec081115Sjtc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24ec081115Sjtc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25ec081115Sjtc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26ec081115Sjtc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27ec081115Sjtc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28ec081115Sjtc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29ec081115Sjtc  * SUCH DAMAGE.
30ec081115Sjtc  */
31ec081115Sjtc 
32171d6532Slukem #if HAVE_NBTOOL_CONFIG_H
33171d6532Slukem #include "nbtool_config.h"
34171d6532Slukem #endif
35171d6532Slukem 
363e24b5bcSchristos #include <sys/cdefs.h>
37ec081115Sjtc #if defined(LIBC_SCCS) && !defined(lint)
38ec081115Sjtc #if 0
39ec081115Sjtc static char sccsid[] = "@(#)err.c	8.1 (Berkeley) 6/4/93";
40ec081115Sjtc #else
41*2f410732Sginsbach __RCSID("$NetBSD: warn.c,v 1.14 2007/06/18 14:13:54 ginsbach Exp $");
42ec081115Sjtc #endif
43ec081115Sjtc #endif /* LIBC_SCCS and not lint */
44ec081115Sjtc 
453e24b5bcSchristos #include "namespace.h"
469fbd8888Stv #include <err.h>
47ec081115Sjtc #include <stdarg.h>
48ec081115Sjtc 
49af3e0750Smycroft #ifdef __weak_alias
__weak_alias(warn,_warn)50af3e0750Smycroft __weak_alias(warn, _warn)
51af3e0750Smycroft #endif
52af3e0750Smycroft 
53*2f410732Sginsbach #if !HAVE_ERR_H
54ec081115Sjtc void
555b84b398Schristos warn(const char *fmt, ...)
56ec081115Sjtc {
57ec081115Sjtc 	va_list ap;
58ec081115Sjtc 
59077b67efSwiz 	va_start(ap, fmt);
6095a8d087Schristos 	vwarn(fmt, ap);
61ec081115Sjtc 	va_end(ap);
62ec081115Sjtc }
63*2f410732Sginsbach #endif
64