Hi Todd and Thomas,

WOW, thanks for the prompt patches and replies! I hope we'll see a new
point release of CMUCL incorporating this fix.

> If the server really never wants to talk to the network, you might
> want to consider using unix domain sockets.

I'm talking to a Java java.net.Socket class.

I'm the meantime I updated db-sockets for CMUCL:
<http://www.cliki.net/db-sockets>

Here are the patches necessary for it to compile (cleanly, i.e. without
any warnings):

$ svn diff -r 711
Index: defpackage.lisp
===================================================================
--- defpackage.lisp     (revision 711)
+++ defpackage.lisp     (working copy)
@@ -1,7 +1,7 @@
 (defpackage "SOCKETS-INTERNAL"
   (:nicknames "SOCKINT")
   (:shadow close listen)
-  #+cmu (:shadowing-import-from "CL" with-array-data)
+  #+cmu (:shadowing-import-from "LISP" with-array-data)
   #+sbcl (:shadowing-import-from "SB-KERNEL" with-array-data)

   #+cmu (:use "COMMON-LISP" "ALIEN" "SYSTEM" "EXT" "C-CALL")
Index: sockets.lisp
===================================================================
--- sockets.lisp        (revision 711)
+++ sockets.lisp        (working copy)
@@ -259,21 +259,14 @@
 (defun condition-for-errno (err)
   (or (cdr (assoc err *conditions-for-errno* :test #'eql)) 'socket-error))

-#+cmu
+
 (defun socket-error (where)
   ;; Peter's debian/x86 cmucl packages (and sbcl, derived from them)
   ;; use a direct syscall interface, and have to call UNIX-GET-ERRNO
   ;; to update the value that unix-errno looks at.  On other CMUCL
   ;; ports, (UNIX-GET-ERRNO) is not needed and doesn't exist
-  (when (fboundp 'unix::unix-get-errno) (unix::unix-get-errno))
-  (let ((condition (condition-for-errno sb-unix:unix-errno)))
-    (error condition :errno sb-unix:unix-errno  :syscall where)))
-
-#+sbcl
-(defun socket-error (where)
-  (let* ((errno  (sb-unix::get-errno))
-         (condition (condition-for-errno errno)))
-    (error condition :errno errno  :syscall where)))
-
-
-
+  #+cmu (when (fboundp 'unix::unix-get-errno) (unix::unix-get-errno))
+  (let* ((errno #+cmu (unix:unix-errno)
+               #+sbcl (sb-unix::get-errno))
+        (condition (condition-for-errno errno)))
+    (error condition :errno errno :syscall where)))
Index: def-to-lisp.lisp
===================================================================
--- def-to-lisp.lisp    (revision 711)
+++ def-to-lisp.lisp    (working copy)
@@ -26,8 +26,13 @@
       (princ lisp-name stream)
       (princ " ) " stream)
       (dolist (d definition)
+       ;;From http://www.cliki.net/db-sockets: I just (3/21/04) attempted to
+       ;;use db-sockets in CMUCL 18e with gcc version 3.3.2. Did not work
+       ;;because of multi line strings in the generated foo.c. Problem is in
+       ;;c-for-function in def-to-lisp.lisp. Changed :right-margin nil to
+       ;;:right-margin 100000. Fixes problem.
         (write d :length nil
-               :right-margin nil :stream stream)
+               :right-margin most-positive-fixnum :stream stream)
         (princ " " stream))
       (format stream ")\\n\");")
       (terpri stream))))


Thanks again,
Adam


Reply via email to