111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* $OpenBSD: err.h,v 1.10 2006/01/06 18:53:04 millert Exp $ */ 211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ 311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*- 511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Copyright (c) 1993 611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The Regents of the University of California. All rights reserved. 711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Redistribution and use in source and binary forms, with or without 911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * modification, are permitted provided that the following conditions 1011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * are met: 1111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 1. Redistributions of source code must retain the above copyright 1211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * notice, this list of conditions and the following disclaimer. 1311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 2. Redistributions in binary form must reproduce the above copyright 1411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * notice, this list of conditions and the following disclaimer in the 1511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * documentation and/or other materials provided with the distribution. 1611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 3. Neither the name of the University nor the names of its contributors 1711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * may be used to endorse or promote products derived from this software 1811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * without specific prior written permission. 1911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 2011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * SUCH DAMAGE. 3111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 3211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * @(#)err.h 8.1 (Berkeley) 6/2/93 3311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */ 3411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 3511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#ifndef _ERR_H_ 3611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define _ERR_H_ 3711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 3811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <sys/cdefs.h> 3911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <sys/types.h> 4011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 4111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert__BEGIN_DECLS 4211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 4311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* printf's format string isn't nullable; the err family's one is, 4411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * so we can't use __errlike here. */ 4511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define __errlike(x, y) __attribute__((__format__(printf, x, y))) 4611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 4711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert__noreturn void err(int, const char *, ...) __errlike(2, 3); 4811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert__noreturn void verr(int, const char *, __va_list) __errlike(2, 0); 4911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert__noreturn void errx(int, const char *, ...) __errlike(2, 3); 5011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert__noreturn void verrx(int, const char *, __va_list) __errlike(2, 0); 5111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertvoid warn(const char *, ...) __errlike(1, 2); 5211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertvoid vwarn(const char *, __va_list) __errlike(1, 0); 5311cd02dfb91661c65134cac258cf5924270e9d2Dan Albertvoid warnx(const char *, ...) __errlike(1, 2); 5411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertvoid vwarnx(const char *, __va_list) __errlike(1, 0); 5511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 5611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert__END_DECLS 5711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 5811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif /* !_ERR_H_ */ 59