1506c6deff726c8c052ff5abb0cef57e63707bd1cElliott Hughes/* $OpenBSD: errx.c,v 1.11 2015/08/31 02:53:57 guenther Exp $ */ 2cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes/*- 3cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * Copyright (c) 1993 4cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * The Regents of the University of California. All rights reserved. 5cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * 6cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * Redistribution and use in source and binary forms, with or without 7cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * modification, are permitted provided that the following conditions 8cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * are met: 9cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * 1. Redistributions of source code must retain the above copyright 10cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * notice, this list of conditions and the following disclaimer. 11cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * 2. Redistributions in binary form must reproduce the above copyright 12cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * notice, this list of conditions and the following disclaimer in the 13cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * documentation and/or other materials provided with the distribution. 14cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * 3. Neither the name of the University nor the names of its contributors 15cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * may be used to endorse or promote products derived from this software 16cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * without specific prior written permission. 17cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * 18cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes * SUCH DAMAGE. 29cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes */ 30cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes 31cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes#include <err.h> 32cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes#include <stdarg.h> 33cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes 34cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes__dead void 35506c6deff726c8c052ff5abb0cef57e63707bd1cElliott Hugheserrx(int eval, const char *fmt, ...) 36cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes{ 37cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes va_list ap; 38cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes 39cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes va_start(ap, fmt); 40506c6deff726c8c052ff5abb0cef57e63707bd1cElliott Hughes verrx(eval, fmt, ap); 41cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes va_end(ap); 42cc7e5f489f02ceee46e315af4f78559d3ad6c962Elliott Hughes} 43506c6deff726c8c052ff5abb0cef57e63707bd1cElliott HughesDEF_WEAK(errx); 44