;;; can pull it out of the CMU CL sources, or the old SBCL sources;
;;; but you might also consider doing things the SBCL way and moving
;;; this kind of C-level work down to C wrapper functions.)
+#!-sunos
(sb!alien:define-alien-routine ("sigsetmask" unix-sigsetmask)
sb!alien:unsigned-long
(mask sb!alien:unsigned-long))
;;;; interface to enabling and disabling signal handlers
(defun enable-interrupt (signal-designator handler)
- (declare (type (or function (member :default :ignore)) handler))
+ (declare (type (or function fixnum (member :default :ignore)) handler))
(without-gcing
(let ((result (install-handler (unix-signal-number signal-designator)
(case handler
handler))))))
(cond ((= result sig_dfl) :default)
((= result sig_ign) :ignore)
- (t (the function (sb!kernel:make-lisp-obj result)))))))
+ (t (the (or function fixnum) (sb!kernel:make-lisp-obj result)))))))
(defun default-interrupt (signal)
(enable-interrupt signal :default))
;;; SIGINT is handled like BREAK, except that ANSI BREAK ignores
;;; *DEBUGGER-HOOK*, but we want SIGINT's BREAK to respect it, so that
-;;; SIGINT in --noprogrammer mode will cleanly terminate the system
+;;; SIGINT in --disable-debugger mode will cleanly terminate the system
;;; (by respecting the *DEBUGGER-HOOK* established in that mode).
(defun sigint-%break (format-string &rest format-arguments)
(apply #'%break 'sigint format-string format-arguments))
#!-linux
(define-signal-handler sigsys-handler "bad argument to a system call")
(define-signal-handler sigpipe-handler "SIGPIPE")
-(define-signal-handler sigalrm-handler "SIGALRM")
+
+(defun sigalrm-handler (signal info context)
+ (declare (ignore signal info context))
+ (declare (type system-area-pointer context))
+ (cerror "Continue" 'sb!ext::timeout))
(defun sigquit-handler (signal code context)
(declare (ignore signal code context))