/[slime]/slime/swank-cmucl.lisp
ViewVC logotype

Diff of /slime/swank-cmucl.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.215 by heller, Tue Nov 3 18:22:58 2009 UTC revision 1.216 by heller, Tue Dec 22 09:31:15 2009 UTC
# Line 107  Line 107 
107    
108  ;;;;; Sockets  ;;;;; Sockets
109    
110  (defun socket-fd (socket)  (defimplementation socket-fd (socket)
111    "Return the filedescriptor for the socket represented by SOCKET."    "Return the filedescriptor for the socket represented by SOCKET."
112    (etypecase socket    (etypecase socket
113      (fixnum socket)      (fixnum socket)
# Line 137  Line 137 
137                        #+unicode :external-format                        #+unicode :external-format
138                        #+unicode external-format))                        #+unicode external-format))
139    
140    (defimplementation make-fd-stream (fd external-format)
141      (make-socket-io-stream fd :full external-format))
142    
143    (defimplementation dup (fd)
144      (multiple-value-bind (clone error) (unix:unix-dup fd)
145        (unless clone (error "dup failed: ~a" (unix:get-unix-error-msg error)))
146        clone))
147    
148    (defimplementation command-line-args ()
149      ext:*command-line-strings*)
150    
151    (defimplementation exec-image (image-file args)
152      (multiple-value-bind (ok error)
153          (unix:unix-execve (car (command-line-args))
154                            (list* (car (command-line-args))
155                                   "-core" image-file
156                                   "-noinit"
157                                   args))
158        (error "~a" (unix:get-unix-error-msg error))
159        ok))
160    
161  ;;;;; Signal-driven I/O  ;;;;; Signal-driven I/O
162    
163  (defimplementation install-sigint-handler (function)  (defimplementation install-sigint-handler (function)
# Line 149  Line 170 
170  All functions are called on SIGIO, and the key is used for removing  All functions are called on SIGIO, and the key is used for removing
171  specific functions.")  specific functions.")
172    
173    (defun reset-sigio-handlers () (setq *sigio-handlers* '()))
174    ;; All file handlers are invalid afer reload.
175    (pushnew 'reset-sigio-handlers ext:*after-save-initializations*)
176    
177  (defun set-sigio-handler ()  (defun set-sigio-handler ()
178    (sys:enable-interrupt :sigio (lambda (signal code scp)    (sys:enable-interrupt :sigio (lambda (signal code scp)
179                                   (sigio-handler signal code scp))))                                   (sigio-handler signal code scp))))
# Line 2366  The `symbol-value' of each element is a Line 2391  The `symbol-value' of each element is a
2391    (multiple-value-bind (pid error) (unix:unix-fork)    (multiple-value-bind (pid error) (unix:unix-fork)
2392      (when (not pid) (error "fork: ~A" (unix:get-unix-error-msg error)))      (when (not pid) (error "fork: ~A" (unix:get-unix-error-msg error)))
2393      (cond ((= pid 0)      (cond ((= pid 0)
2394             (let ((args `(,filename             (apply #'ext:save-lisp
2395                           ,@(if restart-function                    filename
2396                                 `((:init-function ,restart-function))))))                    (if restart-function
2397               (apply #'ext:save-lisp args)))                        `(:init-function ,restart-function))))
2398            (t            (t
2399             (let ((status (waitpid pid)))             (let ((status (waitpid pid)))
2400               (destructuring-bind (&key exited? status &allow-other-keys) status               (destructuring-bind (&key exited? status &allow-other-keys) status

Legend:
Removed from v.1.215  
changed lines
  Added in v.1.216

  ViewVC Help
Powered by ViewVC 1.1.5