[slime-cvs] CVS update: slime/swank-sbcl.lisp

Helmut Eller heller at common-lisp.net
Thu Apr 1 21:27:34 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv23492

Modified Files:
	swank-sbcl.lisp 
Log Message:
Remove the workarounds for non-existent fcntl.
(preferred-communication-style): Use multithreading if futexes are
available, sigio if fctnl is present, and fd-handlers otherwise.

(resolve-note-location): Don't try to construct a source-location if
there's no context.  Notes without location will be displayed in the
note-listing buffer.
Date: Thu Apr  1 16:27:34 2004
Author: heller

Index: slime/swank-sbcl.lisp
diff -u slime/swank-sbcl.lisp:1.81 slime/swank-sbcl.lisp:1.82
--- slime/swank-sbcl.lisp:1.81	Sat Mar 27 15:45:09 2004
+++ slime/swank-sbcl.lisp	Thu Apr  1 16:27:34 2004
@@ -61,8 +61,14 @@
 ;;; TCP Server
 
 (defimplementation preferred-communication-style ()
-  :sigio)
-
+  (cond ((and (sb-int:featurep :sb-thread)
+              (sb-int:featurep :sb-futex))
+         :spawn)
+        ((fboundp 'sb-posix::fcntl)
+         :sigio)
+        (t
+         :fd-handler)))
+        
 (defun resolve-hostname (name)
   (car (sb-bsd-sockets:host-ent-addresses
         (sb-bsd-sockets:get-host-by-name name))))
@@ -95,37 +101,12 @@
         *sigio-handlers*))
 
 (defun set-sigio-handler ()
-  (sb-sys:enable-interrupt sb-unix:SIGIO (lambda (signal code scp)
+  (sb-sys:enable-interrupt sb-unix:sigio (lambda (signal code scp)
                                            (sigio-handler signal code scp))))
 
-
-
-;;;; XXX remove fcntl kludge when SBCL with sb-posix:fcntl is more
-;;;; widely available.
-(defconstant +o_async+ #+linux 8192 #+bsd #x40)
-(defconstant +f_setown+ #+linux 8 #+bsd 6)
-(defconstant +f_setfl+ #+(or linux bsd) 4)
-
-(unless (find-symbol (string :fcntl) :sb-posix)
-  (warn "No binding for fctnl(2) in sb-posix.
-Please upgrade to SBCL 0.8.7.36 or later."))
-
 (defun enable-sigio-on-fd (fd)
-  (cond ((fboundp 'sb-posix::fcntl)
-         (sb-posix::fcntl fd sb-posix::f-setfl sb-posix::o-async)
-         (sb-posix::fcntl fd sb-posix::f-setown (getpid)))
-        (t
-         (unless (or (sb-int:featurep :linux)
-                     (sb-int:featurep :bsd))
-           (warn "You aren't running Linux or *BSD.~
-                ~%The values of +o_async+ etc are probably bogus."))
-         (let ((fcntl (sb-alien:extern-alien 
-                       "fcntl" 
-                       (function sb-alien:int sb-alien:int 
-                                 sb-alien:int sb-alien:int))))
-           ;; XXX error checking
-           (sb-alien:alien-funcall fcntl fd +f_setfl+ +o_async+)
-           (sb-alien:alien-funcall fcntl fd +f_setown+ (getpid))))))
+  (sb-posix::fcntl fd sb-posix::f-setfl sb-posix::o-async)
+  (sb-posix::fcntl fd sb-posix::f-setown (getpid)))
 
 (defimplementation add-sigio-handler (socket fn)
   (set-sigio-handler)
@@ -134,15 +115,6 @@
     (enable-sigio-on-fd fd)
     (push (cons fd fn) *sigio-handlers*)))
 
-#+(or)
-(defimplementation add-sigio-handler (socket fn)
-  (set-sigio-handler)
-  (let ((fd (socket-fd socket)))
-    (format *debug-io* "Adding sigio handler: ~S ~%" fd)
-    (sb-posix:fcntl fd sb-posix::f-setfl sb-posix::o-async)
-    (sb-posix:fcntl fd sb-posix::f-setown (getpid))
-    (push (cons fd fn) *sigio-handlers*)))
-
 (defimplementation remove-sigio-handlers (socket)
   (let ((fd (socket-fd socket)))
     (setf *sigio-handlers* (delete fd *sigio-handlers* :key #'car))
@@ -263,14 +235,7 @@
                                   (pos (eql nil)) 
                                   (path (eql nil))
                                   (source (eql nil)))
-  (cond (buffer
-         (make-location (list :buffer buffer) 
-                        (list :position *buffer-offset*)))
-        (*compile-file-truename*
-         (make-location (list :file (namestring *compile-file-truename*))
-                        (list :position 0)))
-        (t 
-         (list :error "No error location available"))))
+  (list :error "No error location available"))
 
 (defun brief-compiler-message-for-emacs (condition)
   "Briefly describe a compiler error for Emacs.





More information about the slime-cvs mailing list