New __errno() function, returns the address of the errno variable.

This commit is contained in:
jtc 1996-11-07 05:37:34 +00:00
parent af29f79ed4
commit 8610f496a7
2 changed files with 49 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $NetBSD: Makefile.inc,v 1.74 1996/10/16 17:53:44 perry Exp $
# $NetBSD: Makefile.inc,v 1.75 1996/11/07 05:37:34 jtc Exp $
# @(#)Makefile.inc 8.3 (Berkeley) 4/16/94
# gen sources
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/gen ${.CURDIR}/gen
SRCS+= alarm.c assert.c clock.c closedir.c confstr.c ctermid.c \
SRCS+= _errno.c alarm.c assert.c clock.c closedir.c confstr.c ctermid.c \
ctype_.c daemon.c devname.c disklabel.c err.c errx.c errlist.c \
errno.c execl.c execle.c execlp.c execv.c execvp.c fnmatch.c fstab.c \
ftok.c fts.c getbsize.c getcap.c \

47
lib/libc/gen/_errno.c Normal file
View File

@ -0,0 +1,47 @@
/* $NetBSD: _errno.c,v 1.1 1996/11/07 05:37:34 jtc Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by J.T. Conklin.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <errno.h>
#undef errno
int *
__errno()
{
return &errno;
}