1219820Sjeff/*	$NetBSD: vwarnx.c,v 1.14 2007/06/18 14:13:54 ginsbach Exp $	*/
2219820Sjeff
3219820Sjeff/*-
4219820Sjeff * Copyright (c) 1993
5219820Sjeff *	The Regents of the University of California.  All rights reserved.
6219820Sjeff *
7219820Sjeff * Redistribution and use in source and binary forms, with or without
8219820Sjeff * modification, are permitted provided that the following conditions
9219820Sjeff * are met:
10219820Sjeff * 1. Redistributions of source code must retain the above copyright
11219820Sjeff *    notice, this list of conditions and the following disclaimer.
12219820Sjeff * 2. Redistributions in binary form must reproduce the above copyright
13219820Sjeff *    notice, this list of conditions and the following disclaimer in the
14219820Sjeff *    documentation and/or other materials provided with the distribution.
15219820Sjeff * 3. Neither the name of the University nor the names of its contributors
16219820Sjeff *    may be used to endorse or promote products derived from this software
17219820Sjeff *    without specific prior written permission.
18219820Sjeff *
19219820Sjeff * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20219820Sjeff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21219820Sjeff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22219820Sjeff * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23219820Sjeff * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24219820Sjeff * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25219820Sjeff * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26219820Sjeff * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27219820Sjeff * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28219820Sjeff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29219820Sjeff * SUCH DAMAGE.
30219820Sjeff */
31219820Sjeff
32219820Sjeff#if HAVE_NBTOOL_CONFIG_H
33219820Sjeff#include "nbtool_config.h"
34219820Sjeff#endif
35219820Sjeff
36219820Sjeff#include <sys/cdefs.h>
37219820Sjeff#if defined(LIBC_SCCS) && !defined(lint)
38219820Sjeff#if 0
39219820Sjeffstatic char sccsid[] = "@(#)err.c	8.1 (Berkeley) 6/4/93";
40219820Sjeff#else
41219820Sjeff__RCSID("$NetBSD: vwarnx.c,v 1.14 2007/06/18 14:13:54 ginsbach Exp $");
42219820Sjeff#endif
43219820Sjeff#endif /* LIBC_SCCS and not lint */
44219820Sjeff
45219820Sjeff#include "namespace.h"
46219820Sjeff#include <err.h>
47219820Sjeff#include <stdarg.h>
48219820Sjeff#include <stdio.h>
49219820Sjeff#include <stdlib.h>
50219820Sjeff
51219820Sjeff#ifdef __weak_alias
52219820Sjeff__weak_alias(vwarnx, _vwarnx)
53219820Sjeff#endif
54219820Sjeff
55219820Sjeff#if !HAVE_ERR_H
56219820Sjeffvoid
57219820Sjeffvwarnx(const char *fmt, va_list ap)
58{
59	(void)fprintf(stderr, "%s: ", getprogname());
60	if (fmt != NULL)
61		(void)vfprintf(stderr, fmt, ap);
62	(void)fprintf(stderr, "\n");
63}
64#endif
65