diff --git a/code/unix-glibc2.lisp b/code/unix-glibc2.lisp
index e0af64cc4cee5361ec337e6d1c2bf404c2cbdc3b..41408c4d5d58097c8958939576e25dbef451d47f 100644
--- a/code/unix-glibc2.lisp
+++ b/code/unix-glibc2.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix-glibc2.lisp,v 1.37 2007/04/07 15:05:52 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix-glibc2.lisp,v 1.38 2007/07/31 10:08:47 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -324,13 +324,11 @@
 
 
 ;;;; System calls.
-(def-alien-variable ("errno" unix-internal-errno) int)
 
-;;; later...
-(defun unix-get-errno ())
-
-(defun unix-errno () (unix-get-errno) unix-internal-errno)
-(defun (setf unix-errno) (newvalue) (setf unix-internal-errno newvalue))
+(def-alien-routine ("os_get_errno" unix-get-errno) int)
+(def-alien-routine ("os_set_errno" unix-set-errno) int (newvalue int))
+(defun unix-errno () (unix-get-errno))
+(defun (setf unix-errno) (newvalue) (unix-set-errno newvalue))
 
 ;;; GET-UNIX-ERROR-MSG -- public.
 ;;; 
@@ -371,9 +369,6 @@
 (defmacro int-syscall ((name &rest arg-types) &rest args)
   `(syscall (,name ,@arg-types) (values result 0) ,@args))
 
-(defun unix-get-errno ()
-  "Get the unix errno value in errno..."
-  (void-syscall ("update_errno")))
 ;;; From stdio.h
 
 ;;; Unix-rename accepts two files names and renames the first to the second.
diff --git a/code/unix.lisp b/code/unix.lisp
index 630661b4cbd9e5453e78782042b5941472e5c7dd..a624d787b5108cc0e8cae50dcc5cb9d86e99d235 100644
--- a/code/unix.lisp
+++ b/code/unix.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix.lisp,v 1.112 2007/07/30 06:44:19 cshapiro Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix.lisp,v 1.113 2007/07/31 10:08:47 cshapiro Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -912,17 +912,10 @@
 ;;; And now for something completely different ...
 (emit-unix-errors)
 
-#-bsd
-(progn
-(def-alien-variable ("errno" unix-internal-errno) int)
-(defun unix-errno () unix-internal-errno)
-(defun (setf unix-errno) (newvalue) (setf unix-internal-errno newvalue)))
-#+bsd
-(progn
 (def-alien-routine ("os_get_errno" unix-get-errno) int)
 (def-alien-routine ("os_set_errno" unix-set-errno) int (newvalue int))
 (defun unix-errno () (unix-get-errno))
-(defun (setf unix-errno) (newvalue) (unix-set-errno newvalue)))
+(defun (setf unix-errno) (newvalue) (unix-set-errno newvalue))
 
 ;;; GET-UNIX-ERROR-MSG -- public.
 ;;; 
diff --git a/lisp/Darwin-os.c b/lisp/Darwin-os.c
index f9f08da12de3cb964eaa34a2f65d359dc78d82ba..e51b539be68788204f818c2cfd583bde19371241 100644
--- a/lisp/Darwin-os.c
+++ b/lisp/Darwin-os.c
@@ -14,7 +14,7 @@
  * Frobbed for OpenBSD by Pierre R. Mai, 2001.
  * Frobbed for Darwin by Pierre R. Mai, 2003.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.10 2007/07/15 21:33:13 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.11 2007/07/31 10:08:47 cshapiro Exp $
  *
  */
 
@@ -109,19 +109,6 @@ os_init(void)
 #endif
 }
 
-int
-os_get_errno(void)
-{
-    return errno;
-}
-
-int
-os_set_errno(int newvalue)
-{
-    errno = newvalue;
-    return errno;
-}
-
 #if defined(__ppc__)
 int *
 sc_reg(os_context_t * context, int offset)
diff --git a/lisp/FreeBSD-os.c b/lisp/FreeBSD-os.c
index eee8ab96631ada2b0f5c6091bef0a3ca98e9c3e6..e48fb64c86b21c27994f868a4452cf07ceaea9c3 100644
--- a/lisp/FreeBSD-os.c
+++ b/lisp/FreeBSD-os.c
@@ -12,7 +12,7 @@
  * Much hacked by Paul Werkowski
  * GENCGC support by Douglas Crosher, 1996, 1997.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.19 2007/07/30 07:24:46 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.20 2007/07/31 10:08:47 cshapiro Exp $
  *
  */
 
@@ -44,18 +44,6 @@ os_init(void)
     os_vm_page_size = getpagesize();
 }
 
-int
-os_get_errno(void)
-{
-    return errno;
-}
-
-int
-os_set_errno(int value)
-{
-    return errno = value;
-}
-
 int *
 sc_reg(ucontext_t *context, int offset)
 {
diff --git a/lisp/Linux-os.c b/lisp/Linux-os.c
index 1f8b75fa0fbb6dffc318b35f4b5775aa5891961e..38990defbac85c544ec7bdcb1a210e4330d00fd6 100644
--- a/lisp/Linux-os.c
+++ b/lisp/Linux-os.c
@@ -15,7 +15,7 @@
  * GENCGC support by Douglas Crosher, 1996, 1997.
  * Alpha support by Julian Dolby, 1999.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.32 2007/07/30 07:24:46 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.33 2007/07/31 10:08:47 cshapiro Exp $
  *
  */
 
@@ -54,14 +54,6 @@ size_t os_vm_page_size;
 #if defined GENCGC
 #include "gencgc.h"
 #endif
-
-int PVE_stub_errno;
-
-void
-update_errno(void)
-{
-    PVE_stub_errno = errno;
-}
 
 
 void
diff --git a/lisp/os-common.c b/lisp/os-common.c
index f76083f027746acb7b61b8acb04d6456e7e2d410..e1f90ba9be7a0c44c99072ef4326309b16e73a5e 100644
--- a/lisp/os-common.c
+++ b/lisp/os-common.c
@@ -1,6 +1,6 @@
 /*
 
- $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os-common.c,v 1.22 2007/07/06 08:04:39 cshapiro Exp $
+ $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os-common.c,v 1.23 2007/07/31 10:08:47 cshapiro Exp $
 
  This code was written as part of the CMU Common Lisp project at
  Carnegie Mellon University, and has been placed in the public domain.
@@ -113,6 +113,18 @@ os_reallocate(os_vm_address_t addr, os_vm_size_t old_len, os_vm_size_t len)
     }
 }
 
+int
+os_get_errno(void)
+{
+    return errno;
+}
+
+int
+os_set_errno(int value)
+{
+    return errno = value;
+}
+
 #ifdef LINKAGE_TABLE
 
 /* These declarations are lies.  They actually take args, but are