0.8.6.31:
authorChristophe Rhodes <csr21@cam.ac.uk>
Sat, 6 Dec 2003 16:11:32 +0000 (16:11 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Sat, 6 Dec 2003 16:11:32 +0000 (16:11 +0000)
Grovel errnos rather than (wrongly, for *BSD) hardcoding them.

src/code/unix.lisp
tools-for-build/grovel-headers.c
version.lisp-expr

index a752549..db787af 100644 (file)
@@ -782,13 +782,6 @@ previous timer after the body has finished executing"
            (progn
              ,@body))))))
 \f
-
-(defconstant ENOENT 2) ; Unix error code, "No such file or directory"
-(defconstant EINTR 4) ; Unix error code, "Interrupted system call"
-(defconstant EIO 5) ; Unix error code, "I/O error"
-(defconstant EEXIST 17) ; Unix error code, "File exists"
-(defconstant ESPIPE 29) ; Unix error code, "Illegal seek"
-(defconstant EWOULDBLOCK 11) ; Unix error code, "Operation would block"
 ;;; FIXME: Many Unix error code definitions were deleted from the old
 ;;; CMU CL source code here, but not in the exports of SB-UNIX. I
 ;;; (WHN) hope that someday I'll figure out an automatic way to detect
@@ -796,7 +789,6 @@ previous timer after the body has finished executing"
 ;;; enough of them all in one place here that they should probably be
 ;;; removed by hand.
 \f
-\f
 ;;;; support routines for dealing with Unix pathnames
 
 (defun unix-file-kind (name &optional check-for-links)
index facc3f8..ff81d11 100644 (file)
@@ -28,6 +28,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <signal.h>
+#include <errno.h>
 
 #include "genesis/config.h"
 
@@ -41,6 +42,7 @@ defconstant(char* lisp_name, long unix_number)
           lisp_name, unix_number, unix_number);
 }
 
+#define DEFERRNO(name) defconstant(#name, name)
 #define DEFSIGNAL(name) defconstant(#name, name)
 
 int
@@ -104,6 +106,15 @@ main(int argc, char *argv[])
     defconstant("s-ifsock", S_IFSOCK);
     printf("\n");
 
+    printf(";;; error numbers\n");
+    DEFERRNO(ENOENT);
+    DEFERRNO(EINTR);
+    DEFERRNO(EIO);
+    DEFERRNO(EEXIST);
+    DEFERRNO(ESPIPE);
+    DEFERRNO(EWOULDBLOCK);
+    printf("\n");
+
     printf(";;; for wait3(2) in run-program.lisp\n");
     defconstant("wnohang", WNOHANG);
     defconstant("wuntraced", WUNTRACED);
index 565319a..5af4ef9 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.6.30"
+"0.8.6.31"