Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:19

0001 /*  $NetBSD: verr.c,v 1.13 2005/09/13 01:44:09 christos Exp $   */
0002 
0003 /*-
0004  * Copyright (c) 1993
0005  *  The Regents of the University of California.  All rights reserved.
0006  *
0007  * Redistribution and use in source and binary forms, with or without
0008  * modification, are permitted provided that the following conditions
0009  * are met:
0010  * 1. Redistributions of source code must retain the above copyright
0011  *    notice, this list of conditions and the following disclaimer.
0012  * 2. Redistributions in binary form must reproduce the above copyright
0013  *    notice, this list of conditions and the following disclaimer in the
0014  *    documentation and/or other materials provided with the distribution.
0015  * 3. Neither the name of the University nor the names of its contributors
0016  *    may be used to endorse or promote products derived from this software
0017  *    without specific prior written permission.
0018  *
0019  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
0020  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0022  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
0023  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0024  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
0025  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
0026  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0027  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0028  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0029  * SUCH DAMAGE.
0030  */
0031 
0032 #ifdef HAVE_CONFIG_H
0033 #include "config.h"
0034 #endif
0035 
0036 #if HAVE_NBTOOL_CONFIG_H
0037 #include "nbtool_config.h"
0038 #endif
0039 
0040 #include <sys/cdefs.h>
0041 #if defined(LIBC_SCCS) && !defined(lint)
0042 #if 0
0043 static char sccsid[] = "@(#)err.c   8.1 (Berkeley) 6/4/93";
0044 #else
0045 __RCSID("$NetBSD: verr.c,v 1.13 2005/09/13 01:44:09 christos Exp $");
0046 #endif
0047 #endif /* LIBC_SCCS and not lint */
0048 
0049 #include "err.h"
0050 #include <errno.h>
0051 #include <stdarg.h>
0052 #include <stdio.h>
0053 #include <stdlib.h>
0054 #include <string.h>
0055 
0056 #ifdef __weak_alias
0057 __weak_alias(verr, _verr)
0058 #endif
0059 
0060 __dead void
0061 verr(jmp_buf* exit_jmp, int eval RTEMS_UNUSED, const char *fmt, _BSD_VA_LIST_ ap)
0062 {
0063     int sverrno;
0064 
0065     sverrno = errno;
0066 #if 0
0067     (void)fprintf(stderr, "%s: ", getprogname());
0068 #endif
0069     if (fmt != NULL) {
0070         (void)vfprintf(stdout, fmt, ap);
0071         (void)fprintf(stdout, ": ");
0072     }
0073     (void)fprintf(stdout, "%s\n", strerror(sverrno));
0074   longjmp (*exit_jmp, 1);
0075 }