summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/egcs/libf2c/shlib_version2
-rw-r--r--gnu/egcs/libio/shlib_version2
-rw-r--r--gnu/egcs/libobjc/shlib_version2
-rw-r--r--gnu/egcs/libstdc++/shlib_version2
-rw-r--r--gnu/lib/libf2c/shlib_version2
-rw-r--r--gnu/lib/libiberty/shlib_version2
-rw-r--r--gnu/lib/libobjc/shlib_version2
-rw-r--r--gnu/lib/libreadline/shlib_version2
-rw-r--r--gnu/lib/libstdc++/shlib_version2
-rw-r--r--gnu/usr.bin/perl/shlib_version4
-rw-r--r--kerberosV/lib/45/shlib_version2
-rw-r--r--kerberosV/lib/asn1/shlib_version4
-rw-r--r--kerberosV/lib/gssapi/shlib_version2
-rw-r--r--kerberosV/lib/kafs/shlib_version2
-rw-r--r--kerberosV/lib/krb5/shlib_version4
-rw-r--r--lib/libc/gen/errno.c19
-rw-r--r--lib/libc/shlib_version2
-rw-r--r--lib/libcurses++/shlib_version2
-rw-r--r--lib/libcurses/shlib_version2
-rw-r--r--lib/libdes/shlib_version2
-rw-r--r--lib/libedit/shlib_version5
-rw-r--r--lib/libform/shlib_version2
-rw-r--r--lib/libgssapi/shlib_version4
-rw-r--r--lib/libkrb5/shlib_version4
-rw-r--r--lib/libkvm/shlib_version4
-rw-r--r--lib/libm/shlib_version2
-rw-r--r--lib/libmenu/shlib_version2
-rw-r--r--lib/libocurses/shlib_version2
-rw-r--r--lib/libossaudio/shlib_version5
-rw-r--r--lib/libpanel/shlib_version2
-rw-r--r--lib/libpcap/shlib_version4
-rw-r--r--lib/libpthread/shlib_version2
-rw-r--r--lib/libsectok/shlib_version2
-rw-r--r--lib/libskey/shlib_version2
-rw-r--r--lib/libssl/crypto/shlib_version4
-rw-r--r--lib/libssl/ssl/shlib_version2
-rw-r--r--lib/libusbhid/shlib_version2
-rw-r--r--lib/libutil/shlib_version2
-rw-r--r--lib/libwrap/shlib_version2
-rw-r--r--lib/libz/shlib_version2
-rw-r--r--regress/libexec/ld.so/constructor/libaa/shlib_version4
-rw-r--r--regress/libexec/ld.so/constructor/libab/shlib_version4
-rw-r--r--regress/libexec/ld.so/elf/libbar/shlib_version2
-rw-r--r--regress/libexec/ld.so/link-order/lib10/shlib_version2
-rw-r--r--regress/libexec/ld.so/link-order/lib11/shlib_version4
-rw-r--r--regress/libexec/ld.so/link-order/lib20/shlib_version2
-rw-r--r--regress/libexec/ld.so/weak/libstrong/shlib_version2
-rw-r--r--regress/libexec/ld.so/weak/libweak/shlib_version2
-rw-r--r--sys/arch/alpha/stand/Makefile.inc3
-rw-r--r--sys/arch/amd64/stand/Makefile.inc4
-rw-r--r--sys/arch/hp300/stand/Makefile.inc3
-rw-r--r--sys/arch/hppa/stand/Makefile.inc4
-rw-r--r--sys/arch/i386/stand/Makefile.inc4
-rw-r--r--sys/arch/macppc/stand/Makefile.inc4
-rw-r--r--sys/arch/mvme68k/stand/Makefile.inc4
-rw-r--r--sys/arch/mvme88k/stand/Makefile.inc4
-rw-r--r--sys/arch/mvmeppc/stand/Makefile.inc4
-rw-r--r--sys/arch/sparc/stand/Makefile.inc3
-rw-r--r--sys/arch/sparc/stand/libsa/Makefile4
-rw-r--r--sys/arch/sparc64/stand/Makefile.inc3
-rw-r--r--sys/sys/errno.h14
61 files changed, 112 insertions, 87 deletions
diff --git a/gnu/egcs/libf2c/shlib_version b/gnu/egcs/libf2c/shlib_version
index 5b844bbf422..d0f0988b418 100644
--- a/gnu/egcs/libf2c/shlib_version
+++ b/gnu/egcs/libf2c/shlib_version
@@ -1,2 +1,2 @@
-major=7
+major=8
minor=0
diff --git a/gnu/egcs/libio/shlib_version b/gnu/egcs/libio/shlib_version
index 079346fa7b1..07d08b6f13c 100644
--- a/gnu/egcs/libio/shlib_version
+++ b/gnu/egcs/libio/shlib_version
@@ -1,2 +1,2 @@
-major=30
+major=31
minor=0
diff --git a/gnu/egcs/libobjc/shlib_version b/gnu/egcs/libobjc/shlib_version
index 1edea46de91..b52599a164f 100644
--- a/gnu/egcs/libobjc/shlib_version
+++ b/gnu/egcs/libobjc/shlib_version
@@ -1,2 +1,2 @@
-major=1
+major=2
minor=0
diff --git a/gnu/egcs/libstdc++/shlib_version b/gnu/egcs/libstdc++/shlib_version
index 07d08b6f13c..2e4d25cdf59 100644
--- a/gnu/egcs/libstdc++/shlib_version
+++ b/gnu/egcs/libstdc++/shlib_version
@@ -1,2 +1,2 @@
-major=31
+major=32
minor=0
diff --git a/gnu/lib/libf2c/shlib_version b/gnu/lib/libf2c/shlib_version
index 5b844bbf422..d0f0988b418 100644
--- a/gnu/lib/libf2c/shlib_version
+++ b/gnu/lib/libf2c/shlib_version
@@ -1,2 +1,2 @@
-major=7
+major=8
minor=0
diff --git a/gnu/lib/libiberty/shlib_version b/gnu/lib/libiberty/shlib_version
index 5b844bbf422..d0f0988b418 100644
--- a/gnu/lib/libiberty/shlib_version
+++ b/gnu/lib/libiberty/shlib_version
@@ -1,2 +1,2 @@
-major=7
+major=8
minor=0
diff --git a/gnu/lib/libobjc/shlib_version b/gnu/lib/libobjc/shlib_version
index 1edea46de91..b52599a164f 100644
--- a/gnu/lib/libobjc/shlib_version
+++ b/gnu/lib/libobjc/shlib_version
@@ -1,2 +1,2 @@
-major=1
+major=2
minor=0
diff --git a/gnu/lib/libreadline/shlib_version b/gnu/lib/libreadline/shlib_version
index b52599a164f..012c14171d3 100644
--- a/gnu/lib/libreadline/shlib_version
+++ b/gnu/lib/libreadline/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/gnu/lib/libstdc++/shlib_version b/gnu/lib/libstdc++/shlib_version
index 2e4d25cdf59..ed8f7473b52 100644
--- a/gnu/lib/libstdc++/shlib_version
+++ b/gnu/lib/libstdc++/shlib_version
@@ -1,2 +1,2 @@
-major=32
+major=33
minor=0
diff --git a/gnu/usr.bin/perl/shlib_version b/gnu/usr.bin/perl/shlib_version
index 51876cfb75f..1c5d96eb2aa 100644
--- a/gnu/usr.bin/perl/shlib_version
+++ b/gnu/usr.bin/perl/shlib_version
@@ -1,2 +1,2 @@
-major=8
-minor=2
+major=9
+minor=0
diff --git a/kerberosV/lib/45/shlib_version b/kerberosV/lib/45/shlib_version
index b52599a164f..012c14171d3 100644
--- a/kerberosV/lib/45/shlib_version
+++ b/kerberosV/lib/45/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/kerberosV/lib/asn1/shlib_version b/kerberosV/lib/asn1/shlib_version
index 3f0196ebf4a..d9961ea9fef 100644
--- a/kerberosV/lib/asn1/shlib_version
+++ b/kerberosV/lib/asn1/shlib_version
@@ -1,2 +1,2 @@
-major=3
-minor=1
+major=4
+minor=0
diff --git a/kerberosV/lib/gssapi/shlib_version b/kerberosV/lib/gssapi/shlib_version
index b52599a164f..012c14171d3 100644
--- a/kerberosV/lib/gssapi/shlib_version
+++ b/kerberosV/lib/gssapi/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/kerberosV/lib/kafs/shlib_version b/kerberosV/lib/kafs/shlib_version
index 56246d02b24..262f3bc13b6 100644
--- a/kerberosV/lib/kafs/shlib_version
+++ b/kerberosV/lib/kafs/shlib_version
@@ -1,2 +1,2 @@
-major=12
+major=13
minor=0
diff --git a/kerberosV/lib/krb5/shlib_version b/kerberosV/lib/krb5/shlib_version
index 715ca914844..9c1551636c5 100644
--- a/kerberosV/lib/krb5/shlib_version
+++ b/kerberosV/lib/krb5/shlib_version
@@ -1,2 +1,2 @@
-major=5
-minor=2
+major=6
+minor=0
diff --git a/lib/libc/gen/errno.c b/lib/libc/gen/errno.c
index e6560942c1a..3c14afbe3c3 100644
--- a/lib/libc/gen/errno.c
+++ b/lib/libc/gen/errno.c
@@ -1,5 +1,22 @@
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: errno.c,v 1.2 1996/08/19 08:22:34 tholo Exp $";
+static char rcsid[] = "$OpenBSD: errno.c,v 1.3 2004/07/13 21:03:35 marc Exp $";
#endif /* LIBC_SCCS and not lint */
+#include <errno.h>
+#undef errno
+
+/*
+ * global errno for unthreaded programs.
+ */
int errno;
+
+/*
+ * weak version of function used by unthreaded programs.
+ */
+int *
+___errno(void)
+{
+ return &errno;
+}
+
+__weak_alias(__errno, ___errno);
diff --git a/lib/libc/shlib_version b/lib/libc/shlib_version
index a6a346fe782..c3b79bfdab3 100644
--- a/lib/libc/shlib_version
+++ b/lib/libc/shlib_version
@@ -1,4 +1,4 @@
-major=33
+major=34
minor=0
# note: If changes were made to include/thread_private.h or if system
# calls were added/changed then libpthread must also be updated.
diff --git a/lib/libcurses++/shlib_version b/lib/libcurses++/shlib_version
index b52599a164f..012c14171d3 100644
--- a/lib/libcurses++/shlib_version
+++ b/lib/libcurses++/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/lib/libcurses/shlib_version b/lib/libcurses/shlib_version
index 1c5d96eb2aa..c10074d52ae 100644
--- a/lib/libcurses/shlib_version
+++ b/lib/libcurses/shlib_version
@@ -1,2 +1,2 @@
-major=9
+major=10
minor=0
diff --git a/lib/libdes/shlib_version b/lib/libdes/shlib_version
index d0f0988b418..1c5d96eb2aa 100644
--- a/lib/libdes/shlib_version
+++ b/lib/libdes/shlib_version
@@ -1,2 +1,2 @@
-major=8
+major=9
minor=0
diff --git a/lib/libedit/shlib_version b/lib/libedit/shlib_version
index 7d5f3990678..012c14171d3 100644
--- a/lib/libedit/shlib_version
+++ b/lib/libedit/shlib_version
@@ -1,5 +1,2 @@
-# $OpenBSD: shlib_version,v 1.3 2003/10/31 08:42:24 otto Exp $
-# $NetBSD: shlib_version,v 1.14 2003/09/26 17:44:51 christos Exp $
-#
-major=2
+major=3
minor=0
diff --git a/lib/libform/shlib_version b/lib/libform/shlib_version
index b52599a164f..012c14171d3 100644
--- a/lib/libform/shlib_version
+++ b/lib/libform/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/lib/libgssapi/shlib_version b/lib/libgssapi/shlib_version
index c6e3f4d3fc0..012c14171d3 100644
--- a/lib/libgssapi/shlib_version
+++ b/lib/libgssapi/shlib_version
@@ -1,2 +1,2 @@
-major=2
-minor=1
+major=3
+minor=0
diff --git a/lib/libkrb5/shlib_version b/lib/libkrb5/shlib_version
index b91c32ce7c8..d85251eba7d 100644
--- a/lib/libkrb5/shlib_version
+++ b/lib/libkrb5/shlib_version
@@ -1,2 +1,2 @@
-major=13
-minor=1
+major=14
+minor=0
diff --git a/lib/libkvm/shlib_version b/lib/libkvm/shlib_version
index b39addfcc64..d0f0988b418 100644
--- a/lib/libkvm/shlib_version
+++ b/lib/libkvm/shlib_version
@@ -1,2 +1,2 @@
-major=7
-minor=1
+major=8
+minor=0
diff --git a/lib/libm/shlib_version b/lib/libm/shlib_version
index 1edea46de91..b52599a164f 100644
--- a/lib/libm/shlib_version
+++ b/lib/libm/shlib_version
@@ -1,2 +1,2 @@
-major=1
+major=2
minor=0
diff --git a/lib/libmenu/shlib_version b/lib/libmenu/shlib_version
index b52599a164f..012c14171d3 100644
--- a/lib/libmenu/shlib_version
+++ b/lib/libmenu/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/lib/libocurses/shlib_version b/lib/libocurses/shlib_version
index d9961ea9fef..3066b9771e7 100644
--- a/lib/libocurses/shlib_version
+++ b/lib/libocurses/shlib_version
@@ -1,2 +1,2 @@
-major=4
+major=5
minor=0
diff --git a/lib/libossaudio/shlib_version b/lib/libossaudio/shlib_version
index 8c38ab123ff..012c14171d3 100644
--- a/lib/libossaudio/shlib_version
+++ b/lib/libossaudio/shlib_version
@@ -1,5 +1,2 @@
-# $OpenBSD: shlib_version,v 1.3 2002/12/03 06:39:39 millert Exp $
-# $NetBSD: shlib_version,v 1.4 1998/01/05 07:41:13 perry Exp $
-#
-major=2
+major=3
minor=0
diff --git a/lib/libpanel/shlib_version b/lib/libpanel/shlib_version
index b52599a164f..012c14171d3 100644
--- a/lib/libpanel/shlib_version
+++ b/lib/libpanel/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/lib/libpcap/shlib_version b/lib/libpcap/shlib_version
index c6e3f4d3fc0..012c14171d3 100644
--- a/lib/libpcap/shlib_version
+++ b/lib/libpcap/shlib_version
@@ -1,2 +1,2 @@
-major=2
-minor=1
+major=3
+minor=0
diff --git a/lib/libpthread/shlib_version b/lib/libpthread/shlib_version
index 3066b9771e7..9c1551636c5 100644
--- a/lib/libpthread/shlib_version
+++ b/lib/libpthread/shlib_version
@@ -1,2 +1,2 @@
-major=5
+major=6
minor=0
diff --git a/lib/libsectok/shlib_version b/lib/libsectok/shlib_version
index 3066b9771e7..9c1551636c5 100644
--- a/lib/libsectok/shlib_version
+++ b/lib/libsectok/shlib_version
@@ -1,2 +1,2 @@
-major=5
+major=6
minor=0
diff --git a/lib/libskey/shlib_version b/lib/libskey/shlib_version
index d9961ea9fef..3066b9771e7 100644
--- a/lib/libskey/shlib_version
+++ b/lib/libskey/shlib_version
@@ -1,2 +1,2 @@
-major=4
+major=5
minor=0
diff --git a/lib/libssl/crypto/shlib_version b/lib/libssl/crypto/shlib_version
index 57f40b7e5dd..f461c533903 100644
--- a/lib/libssl/crypto/shlib_version
+++ b/lib/libssl/crypto/shlib_version
@@ -1,2 +1,2 @@
-major=10
-minor=4
+major=11
+minor=0
diff --git a/lib/libssl/ssl/shlib_version b/lib/libssl/ssl/shlib_version
index d0f0988b418..1c5d96eb2aa 100644
--- a/lib/libssl/ssl/shlib_version
+++ b/lib/libssl/ssl/shlib_version
@@ -1,2 +1,2 @@
-major=8
+major=9
minor=0
diff --git a/lib/libusbhid/shlib_version b/lib/libusbhid/shlib_version
index b52599a164f..012c14171d3 100644
--- a/lib/libusbhid/shlib_version
+++ b/lib/libusbhid/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/lib/libutil/shlib_version b/lib/libutil/shlib_version
index c10074d52ae..f461c533903 100644
--- a/lib/libutil/shlib_version
+++ b/lib/libutil/shlib_version
@@ -1,2 +1,2 @@
-major=10
+major=11
minor=0
diff --git a/lib/libwrap/shlib_version b/lib/libwrap/shlib_version
index 012c14171d3..d9961ea9fef 100644
--- a/lib/libwrap/shlib_version
+++ b/lib/libwrap/shlib_version
@@ -1,2 +1,2 @@
-major=3
+major=4
minor=0
diff --git a/lib/libz/shlib_version b/lib/libz/shlib_version
index 012c14171d3..d9961ea9fef 100644
--- a/lib/libz/shlib_version
+++ b/lib/libz/shlib_version
@@ -1,2 +1,2 @@
-major=3
+major=4
minor=0
diff --git a/regress/libexec/ld.so/constructor/libaa/shlib_version b/regress/libexec/ld.so/constructor/libaa/shlib_version
index 987ef746955..b52599a164f 100644
--- a/regress/libexec/ld.so/constructor/libaa/shlib_version
+++ b/regress/libexec/ld.so/constructor/libaa/shlib_version
@@ -1,2 +1,2 @@
-major=1
-minor=0
+major=2
+minor=0
diff --git a/regress/libexec/ld.so/constructor/libab/shlib_version b/regress/libexec/ld.so/constructor/libab/shlib_version
index 987ef746955..b52599a164f 100644
--- a/regress/libexec/ld.so/constructor/libab/shlib_version
+++ b/regress/libexec/ld.so/constructor/libab/shlib_version
@@ -1,2 +1,2 @@
-major=1
-minor=0
+major=2
+minor=0
diff --git a/regress/libexec/ld.so/elf/libbar/shlib_version b/regress/libexec/ld.so/elf/libbar/shlib_version
index 97c9f92d6b8..1edea46de91 100644
--- a/regress/libexec/ld.so/elf/libbar/shlib_version
+++ b/regress/libexec/ld.so/elf/libbar/shlib_version
@@ -1,2 +1,2 @@
-major=0
+major=1
minor=0
diff --git a/regress/libexec/ld.so/link-order/lib10/shlib_version b/regress/libexec/ld.so/link-order/lib10/shlib_version
index 1edea46de91..b52599a164f 100644
--- a/regress/libexec/ld.so/link-order/lib10/shlib_version
+++ b/regress/libexec/ld.so/link-order/lib10/shlib_version
@@ -1,2 +1,2 @@
-major=1
+major=2
minor=0
diff --git a/regress/libexec/ld.so/link-order/lib11/shlib_version b/regress/libexec/ld.so/link-order/lib11/shlib_version
index 893819d18ff..b52599a164f 100644
--- a/regress/libexec/ld.so/link-order/lib11/shlib_version
+++ b/regress/libexec/ld.so/link-order/lib11/shlib_version
@@ -1,2 +1,2 @@
-major=1
-minor=1
+major=2
+minor=0
diff --git a/regress/libexec/ld.so/link-order/lib20/shlib_version b/regress/libexec/ld.so/link-order/lib20/shlib_version
index b52599a164f..012c14171d3 100644
--- a/regress/libexec/ld.so/link-order/lib20/shlib_version
+++ b/regress/libexec/ld.so/link-order/lib20/shlib_version
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
diff --git a/regress/libexec/ld.so/weak/libstrong/shlib_version b/regress/libexec/ld.so/weak/libstrong/shlib_version
index 1edea46de91..b52599a164f 100644
--- a/regress/libexec/ld.so/weak/libstrong/shlib_version
+++ b/regress/libexec/ld.so/weak/libstrong/shlib_version
@@ -1,2 +1,2 @@
-major=1
+major=2
minor=0
diff --git a/regress/libexec/ld.so/weak/libweak/shlib_version b/regress/libexec/ld.so/weak/libweak/shlib_version
index 1edea46de91..b52599a164f 100644
--- a/regress/libexec/ld.so/weak/libweak/shlib_version
+++ b/regress/libexec/ld.so/weak/libweak/shlib_version
@@ -1,2 +1,2 @@
-major=1
+major=2
minor=0
diff --git a/sys/arch/alpha/stand/Makefile.inc b/sys/arch/alpha/stand/Makefile.inc
index d71f2ca141c..5c1e5d62d1a 100644
--- a/sys/arch/alpha/stand/Makefile.inc
+++ b/sys/arch/alpha/stand/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.7 2002/12/02 09:00:22 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.8 2004/07/13 21:03:36 marc Exp $
# $NetBSD: Makefile.inc,v 1.8 1997/04/06 08:39:38 cgd Exp $
.include <bsd.own.mk> # for ELF_TOOLCHAIN definition
@@ -17,6 +17,7 @@ CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS="0x${PRIMARY_LOAD_ADDRESS}"
CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS="0x${SECONDARY_LOAD_ADDRESS}"
CPPFLAGS+= -D_STANDALONE
+CPPFLAGS+= -Derrno=errno
XCPPFLAGS+= -DHEAP_LIMIT="0x${HEAP_LIMIT}"
diff --git a/sys/arch/amd64/stand/Makefile.inc b/sys/arch/amd64/stand/Makefile.inc
index 8a995ebab4a..1c59ab6f0b6 100644
--- a/sys/arch/amd64/stand/Makefile.inc
+++ b/sys/arch/amd64/stand/Makefile.inc
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile.inc,v 1.1 2004/02/03 12:09:47 mickey Exp $
+# $OpenBSD: Makefile.inc,v 1.2 2004/07/13 21:03:36 marc Exp $
CFLAGS=${DEBUG} ${COPTS} -Os -Wall -Werror
CFLAGS+= -fno-stack-protector
-CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR}
+CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR} -Derrno=errno
SACFLAGS=-D_STANDALONE
DEBUGLIBS=no
DEBUGFLAGS=
diff --git a/sys/arch/hp300/stand/Makefile.inc b/sys/arch/hp300/stand/Makefile.inc
index 524af1b2d99..6c759c80fd2 100644
--- a/sys/arch/hp300/stand/Makefile.inc
+++ b/sys/arch/hp300/stand/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.4 2002/12/02 09:00:23 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.5 2004/07/13 21:03:37 marc Exp $
# $NetBSD: Makefile.inc,v 1.7 1997/05/12 07:43:18 thorpej Exp $
BINDIR= /usr/mdec
@@ -13,6 +13,7 @@ CPPFLAGS+= -DHIL_KEYBOARD -DUK_KEYBOARD
CPPFLAGS+= -DDOMAIN_KEYBOARD
CPPFLAGS+= -DSTANDALONE -Dhp300
CPPFLAGS+= -DCOMPAT_UFS -DNO_LSEEK
+CPPFLAGS+= -Derrno=errno
# Limit the alloc() heap to below the msgbuf and ROM scratch pages.
CPPFLAGS+= -DHEAP_LIMIT="0xffffdfff"
diff --git a/sys/arch/hppa/stand/Makefile.inc b/sys/arch/hppa/stand/Makefile.inc
index 13574c91666..10c2f2c83a0 100644
--- a/sys/arch/hppa/stand/Makefile.inc
+++ b/sys/arch/hppa/stand/Makefile.inc
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile.inc,v 1.12 2003/04/30 06:02:27 mickey Exp $
+# $OpenBSD: Makefile.inc,v 1.13 2004/07/13 21:03:37 marc Exp $
CFLAGS=${DEBUG} -Os -Wall -Werror
-CPPFLAGS+=-I${S} -I. -I${.CURDIR}
+CPPFLAGS+=-I${S} -I. -I${.CURDIR} -Derrno=errno
SACFLAGS=-nostdinc -fno-builtin -D_STANDALONE -I${STANDIR}/libsa
SACFLAGS+=-mdisable-fpregs -mfast-indirect-calls -mpa-risc-1-1
SACFLAGS+=-fno-stack-protector
diff --git a/sys/arch/i386/stand/Makefile.inc b/sys/arch/i386/stand/Makefile.inc
index 313b680bd91..694a2787857 100644
--- a/sys/arch/i386/stand/Makefile.inc
+++ b/sys/arch/i386/stand/Makefile.inc
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile.inc,v 1.34 2003/08/08 07:37:15 deraadt Exp $
+# $OpenBSD: Makefile.inc,v 1.35 2004/07/13 21:03:38 marc Exp $
CFLAGS=${DEBUG} ${COPTS} -Os -Wall -Werror
CFLAGS+= -fno-stack-protector
-CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR}
+CPPFLAGS+=-I${S} -I${SADIR}/libsa -I. -I${.CURDIR} -Derrno=errno
SACFLAGS=-D_STANDALONE
DEBUGLIBS=no
DEBUGFLAGS=
diff --git a/sys/arch/macppc/stand/Makefile.inc b/sys/arch/macppc/stand/Makefile.inc
index 112d4bb0d15..7919d526242 100644
--- a/sys/arch/macppc/stand/Makefile.inc
+++ b/sys/arch/macppc/stand/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.4 2004/01/09 16:50:30 drahn Exp $
+# $OpenBSD: Makefile.inc,v 1.5 2004/07/13 21:03:38 marc Exp $
# $NetBSD: Makefile.inc,v 1.1 1996/09/30 16:34:59 ws Exp $
.if !defined(__stand_makefile_inc)
@@ -20,7 +20,7 @@ ENTRY?= _start
INCLUDES+= -I. -I$(.OBJDIR) -I$(.CURDIR)/.. -I$(S)/arch -I$(S)
INCLUDES+= -I$(S)/lib/libsa
-DEFS+= -DSTANDALONE -DFIREPOWERBUGS
+DEFS+= -DSTANDALONE -DFIREPOWERBUGS -Derrno=errno
CFLAGS+= $(INCLUDES) $(DEFS) $(EXTRACFLAGS)
CFLAGS+= -fno-stack-protector
CFLAGS+= -fno-builtin-vprintf -fno-builtin-printf -fno-builtin-putchar
diff --git a/sys/arch/mvme68k/stand/Makefile.inc b/sys/arch/mvme68k/stand/Makefile.inc
index e622ccccb11..928347116a9 100644
--- a/sys/arch/mvme68k/stand/Makefile.inc
+++ b/sys/arch/mvme68k/stand/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.4 2002/12/02 09:00:24 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.5 2004/07/13 21:03:38 marc Exp $
MDEC_DIR?=/usr/mdec
-CFLAGS+= -fno-stack-protector
+CFLAGS+= -fno-stack-protector -Derrno=errno
diff --git a/sys/arch/mvme88k/stand/Makefile.inc b/sys/arch/mvme88k/stand/Makefile.inc
index bb712aaa08d..8626cbe8a08 100644
--- a/sys/arch/mvme88k/stand/Makefile.inc
+++ b/sys/arch/mvme88k/stand/Makefile.inc
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile.inc,v 1.7 2003/10/11 22:08:57 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.8 2004/07/13 21:03:38 marc Exp $
MDEC_DIR?=/usr/mdec
-CFLAGS+= -fno-stack-protector -mmemcpy
+CFLAGS+= -fno-stack-protector -mmemcpy -Derrno=errno
# Load addresses for first and second stage bootstraps
STAGE1_RELOC=0x009F0000
diff --git a/sys/arch/mvmeppc/stand/Makefile.inc b/sys/arch/mvmeppc/stand/Makefile.inc
index e14f6de44eb..399eafdf4bb 100644
--- a/sys/arch/mvmeppc/stand/Makefile.inc
+++ b/sys/arch/mvmeppc/stand/Makefile.inc
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile.inc,v 1.2 2002/12/02 09:00:25 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.3 2004/07/13 21:03:38 marc Exp $
MDEC_DIR?=/usr/mdec
-CFLAGS+= -fno-stack-protector
+CFLAGS+= -fno-stack-protector -Derrno=errno
# Load addresses for first and second stage bootstraps
STAGE1_RELOC=4000
diff --git a/sys/arch/sparc/stand/Makefile.inc b/sys/arch/sparc/stand/Makefile.inc
index 1c1d5e4417d..da717ed50b9 100644
--- a/sys/arch/sparc/stand/Makefile.inc
+++ b/sys/arch/sparc/stand/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.11 2002/12/02 09:00:25 miod Exp $
+# $OpenBSD: Makefile.inc,v 1.12 2004/07/13 21:03:38 marc Exp $
# $NetBSD: Makefile.inc,v 1.5 1996/02/01 22:33:01 mycroft Exp $
BINDIR= /usr/mdec
@@ -15,6 +15,7 @@ RELOC2!= perl -e 'printf "0x%x", ${RELOC_TEST} + 0x40000'
CFLAGS+= -fno-stack-protector
DEFS= -DSTANDALONE -DRELOC=${RELOC} -DSUN4 -DSUN4C -DSUN_BOOTPARAMS
+DEFS+= -Derrno=errno
### Figure out what to use for libkern
LIBKERNDIR= ${.CURDIR}/../libkern
diff --git a/sys/arch/sparc/stand/libsa/Makefile b/sys/arch/sparc/stand/libsa/Makefile
index 0002c987e1a..cc9a3519bd3 100644
--- a/sys/arch/sparc/stand/libsa/Makefile
+++ b/sys/arch/sparc/stand/libsa/Makefile
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.2 2003/06/01 17:00:39 deraadt Exp $
+# $OpenBSD: Makefile,v 1.3 2004/07/13 21:03:39 marc Exp $
LIB= sa
.PATH: ${.CURDIR}/../../../../lib/libsa
-CFLAGS= -O2 -D__INTERNAL_LIBSA_CREAD \
+CFLAGS= -O2 -D__INTERNAL_LIBSA_CREAD -Derrno=errno \
-I${.CURDIR} -I${.CURDIR}/../include -I${.CURDIR}/../.. \
-I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. \
-I${.CURDIR}/../../../../lib/libsa
diff --git a/sys/arch/sparc64/stand/Makefile.inc b/sys/arch/sparc64/stand/Makefile.inc
index e31772ea8c8..707faad4c54 100644
--- a/sys/arch/sparc64/stand/Makefile.inc
+++ b/sys/arch/sparc64/stand/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.4 2004/01/10 09:35:42 pvalchev Exp $
+# $OpenBSD: Makefile.inc,v 1.5 2004/07/13 21:03:38 marc Exp $
# $NetBSD: Makefile.inc,v 1.7 2000/08/20 14:57:16 mrg Exp $
.ifndef __INCLUDED_STAND_MAKEFILE_INC
@@ -14,6 +14,7 @@ STANDALONE?= -D_STANDALONE
.if ${MACHINE} == "sparc64"
CPPFLAGS+= ${STANDALONE} -DSUN4U
CPPFLAGS+= -I.
+CPPFLAGS+= -Derrno=errno
CFLAGS+= -fno-stack-protector
CFLAGS+= -msoft-float
diff --git a/sys/sys/errno.h b/sys/sys/errno.h
index aa9fbc5865d..f015c4258c9 100644
--- a/sys/sys/errno.h
+++ b/sys/sys/errno.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: errno.h,v 1.11 2003/06/02 23:28:21 millert Exp $ */
+/* $OpenBSD: errno.h,v 1.12 2004/07/13 21:03:39 marc Exp $ */
/* $NetBSD: errno.h,v 1.10 1996/01/20 01:33:53 jtc Exp $ */
/*
@@ -46,7 +46,17 @@ extern int errno; /* global error number */
extern int sys_nerr;
extern char *sys_errlist[];
#endif
-#endif
+
+#if !defined(errno) && !defined(_STANDALONE)
+#include <sys/cdefs.h>
+__BEGIN_DECLS
+int *__errno(void);
+int *___errno(void);
+__END_DECLS
+#define errno (*__errno())
+#endif /* errno */
+
+#endif /* _KERNEL */
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */