xref: /netbsd-src/include/errno.h (revision 65900038ce581fc63f42dddc1feab9717e8cb4c0)
1*65900038Sdholland /*	$NetBSD: errno.h,v 1.11 2008/03/03 06:57:48 dholland Exp $	*/
222fc60a5Skleink 
322fc60a5Skleink /*
422fc60a5Skleink  * Copyright (c) 1982, 1986, 1989, 1993
522fc60a5Skleink  *	The Regents of the University of California.  All rights reserved.
622fc60a5Skleink  * (c) UNIX System Laboratories, Inc.
722fc60a5Skleink  * All or some portions of this file are derived from material licensed
822fc60a5Skleink  * to the University of California by American Telephone and Telegraph
922fc60a5Skleink  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
1022fc60a5Skleink  * the permission of UNIX System Laboratories, Inc.
1122fc60a5Skleink  *
1222fc60a5Skleink  * Redistribution and use in source and binary forms, with or without
1322fc60a5Skleink  * modification, are permitted provided that the following conditions
1422fc60a5Skleink  * are met:
1522fc60a5Skleink  * 1. Redistributions of source code must retain the above copyright
1622fc60a5Skleink  *    notice, this list of conditions and the following disclaimer.
1722fc60a5Skleink  * 2. Redistributions in binary form must reproduce the above copyright
1822fc60a5Skleink  *    notice, this list of conditions and the following disclaimer in the
1922fc60a5Skleink  *    documentation and/or other materials provided with the distribution.
20039cc956Sagc  * 3. Neither the name of the University nor the names of its contributors
2122fc60a5Skleink  *    may be used to endorse or promote products derived from this software
2222fc60a5Skleink  *    without specific prior written permission.
2322fc60a5Skleink  *
2422fc60a5Skleink  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2522fc60a5Skleink  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2622fc60a5Skleink  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2722fc60a5Skleink  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2822fc60a5Skleink  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2922fc60a5Skleink  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3022fc60a5Skleink  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3122fc60a5Skleink  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3222fc60a5Skleink  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3322fc60a5Skleink  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3422fc60a5Skleink  * SUCH DAMAGE.
3522fc60a5Skleink  *
3622fc60a5Skleink  *	from: @(#)errno.h	8.5 (Berkeley) 1/21/94
3722fc60a5Skleink  */
3822fc60a5Skleink 
3922fc60a5Skleink #ifndef _ERRNO_H_
4022fc60a5Skleink #define _ERRNO_H_
4122fc60a5Skleink 
4222fc60a5Skleink #include <sys/cdefs.h>
4322fc60a5Skleink #include <sys/errno.h>
4422fc60a5Skleink #include <sys/featuretest.h>
4522fc60a5Skleink 
4622fc60a5Skleink __BEGIN_DECLS
47933ac468Sdholland 
48*65900038Sdholland /* note: this appears in both errno.h and signal.h */
49933ac468Sdholland #ifndef __errno
5019b7469aSperry int *__errno(void);
51933ac468Sdholland #define __errno __errno
52933ac468Sdholland #endif
53933ac468Sdholland 
54933ac468Sdholland #ifndef errno
5522fc60a5Skleink #define errno (*__errno())
568939b770Schristos #endif
5722fc60a5Skleink 
584be7a2dcSbjh21 #if defined(_NETBSD_SOURCE)
5966412e72Schristos #ifndef __LIBC12_SOURCE__
60a2cd7322Sperry extern const int sys_nerr __RENAME(__sys_nerr14);
61a2cd7322Sperry extern const char *const *sys_errlist __RENAME(__sys_errlist14);
6222fc60a5Skleink #endif
6366412e72Schristos #endif
6422fc60a5Skleink __END_DECLS
6522fc60a5Skleink 
6622fc60a5Skleink #endif /* !_ERRNO_H_ */
67