"SETUIDEXEC" "SG-ERASE" "SG-FLAGS" "SG-ISPEED" "SG-KILL"
"SG-OSPEED" "SGTTYB" "SIZE-T" "ST-ATIME" "ST-BLKSIZE"
"ST-BLOCKS" "ST-CTIME" "ST-DEV" "ST-GID" "ST-MODE" "ST-MTIME"
- "ST-NLINK" "ST-RDEV" "ST-SIZE" "ST-UID" "STAT"
+ "ST-NLINK" "ST-RDEV" "ST-SIZE" "ST-UID" "STAT"
"TERMINAL-SPEEDS" "TIME-T" "TIMEVAL" "TIMEZONE" "TIOCFLUSH"
"TIOCGETC" "TIOCGETP" "TIOCGLTC" "TIOCGPGRP" "TIOCGWINSZ"
"TIOCNOTTY" "TIOCSETC" "TIOCSETP" "TIOCSLTC" "TIOCSPGRP"
"WRITEGRP" "WRITEOTH" "WRITEOWN" "WS-COL" "WS-ROW" "WS-XPIXEL"
"WS-YPIXEL"
"WNOHANG" "WSTOPPED" "WUNTRACED"
- "W_OK" "X_OK" "SIGSYS" "TCSETPGRP" "FD-ZERO"
- "SIGQUIT" "SIGCHLD" "SIGSEGV" "FD-CLR" "SIGUSR2"
- "EALREADY" "SIGPIPE" "CHECK" "SIGXCPU" "EOPNOTSUPP"
- "SIGFPE" "SIGHUP" "ENOTSOCK" "EINTR"
- "SIGCONT" "UNIX-RESOLVE-LINKS" "SIGKILL" "EMSGSIZE" "ERANGE"
- "EPROTOTYPE" "UNIX-SIGNAL-NUMBER" "EPFNOSUPPORT" "SIGILL"
- "EDOM" "EDQUOT" "FD-SETSIZE" "SIGTSTP"
- "EAFNOSUPPORT" "TCGETPGRP" "EMFILE" "ECONNRESET"
- "EADDRNOTAVAIL" "SIGALRM" "ENETDOWN" "EVICEOP"
- "UNIX-FAST-GETRUSAGE" "EPERM" "SIGINT" "EXDEV" "EDEADLK"
- "ENOSPC" "ECONNREFUSED" "SIGWINCH" "ENOPROTOOPT" "ESRCH"
- "EUSERS" "SIGVTALRM" "ENOTCONN" "ESUCCESS" "EPIPE"
- "UNIX-SIMPLIFY-PATHNAME" "EISCONN" "FD-ISSET"
- "ESHUTDOWN" "EBUSY" "SIGTERM" "ENAMETOOLONG" "EMLINK"
- "EADDRINUSE" "SIGBUS" "ERESTART"
- "UNIX-SIGNAL-NAME" "ETIMEDOUT" "ECHILD" "EFBIG" "SIGTRAP"
- "UNIX-KILLPG" "ENOTBLK" "SIGIOT" "SIGUSR1" "ECONNABORTED"
- "EHOSTUNREACH" "EBADF" "EINVAL" "FD-SET" "EISDIR"
- "SIGTTIN" "UNIX-KILL" "EHOSTDOWN" "E2BIG" "ESPIPE"
- "UNIX-FAST-SELECT" "ENXIO" "ENOTTY" "ELOOP" "LTCHARS"
- "SIGXFSZ" "EINPROGRESS" "ENOENT"
- "EPROTONOSUPPORT" "SIGIO" "ENOMEM" "SIGEMT"
- "EFAULT" "ENODEV" "EIO" "EVICEERR" "ETXTBSY" "EWOULDBLOCK"
- "EAGAIN" "EDESTADDRREQ" "ENOEXEC" "ENETUNREACH" "ENOTEMPTY"
- "ENFILE"
- "SIGTTOU" "EEXIST" "SIGPROF" "SIGSTOP" "ENETRESET" "SIGURG"
- "ENOBUFS" "EPROCLIM" "EROFS" "ETOOMANYREFS" "UNIX-FILE-KIND"
- "ELOCAL" "UNIX-SIGSETMASK" "EREMOTE" "ESOCKTNOSUPPORT"
- "TIOCSIGSEND" "SIGWAITING"
+ "W_OK" "X_OK"
+ ;; signals
+ "SIGALRM" "SIGBUS" "SIGCHLD" "SIGCONT" "SIGEMT" "SIGFPE"
+ "SIGHUP" "SIGILL" "SIGINT" "SIGIO" "SIGIOT" "SIGKILL"
+ "SIGPIPE" "SIGPROF" "SIGQUIT" "SIGSEGV" "SIGSTOP" "SIGSYS"
+ "SIGTERM" "SIGTRAP" "SIGTSTP" "SIGTTIN" "SIGTTOU" "SIGURG"
+ "SIGUSR1" "SIGUSR2" "SIGVTALRM" "SIGWAITING" "SIGWINCH"
+ "SIGXCPU" "SIGXFSZ"
+
+ ;; errors
+ "E2BIG" "EADDRINUSE" "EADDRNOTAVAIL" "EAFNOSUPPORT"
+ "EAGAIN" "EALREADY" "EBADF" "EBUSY" "ECHILD" "ECONNABORTED"
+ "ECONNREFUSED" "ECONNRESET" "EDEADLK" "EDESTADDRREQ" "EDOM"
+ "EDQUOT" "EEXIST" "EFAULT" "EFBIG" "EHOSTDOWN"
+ "EHOSTUNREACH" "EINPROGRESS" "EINTR" "EINVAL" "EIO"
+ "EISCONN" "EISDIR" "ELOCAL" "ELOOP" "EMFILE" "EMLINK"
+ "EMSGSIZE" "ENAMETOOLONG" "ENETDOWN" "ENETRESET"
+ "ENETUNREACH" "ENFILE" "ENOBUFS" "ENODEV" "ENOENT"
+ "ENOEXEC" "ENOMEM" "ENOPROTOOPT" "ENOSPC" "ENOTBLK"
+ "ENOTCONN" "ENOTEMPTY" "ENOTSOCK" "ENOTTY" "ENXIO"
+ "EOPNOTSUPP" "EPERM" "EPFNOSUPPORT" "EPIPE" "EPROCLIM"
+ "EPROTONOSUPPORT" "EPROTOTYPE" "ERANGE" "EREMOTE"
+ "ERESTART" "EROFS" "ESHUTDOWN" "ESOCKTNOSUPPORT" "ESPIPE"
+ "ESRCH" "ESUCCESS" "ETIMEDOUT" "ETOOMANYREFS" "ETXTBSY"
+ "EUSERS" "EVICEERR" "EVICEOP" "EWOULDBLOCK" "EXDEV"
+
+ "FD-ISSET" "FD-SET" "LTCHARS" "UNIX-FAST-SELECT"
+ "UNIX-FILE-KIND" "UNIX-KILL" "UNIX-SIGSETMASK"
+ "TCSETPGRP" "FD-ZERO" "FD-CLR" "CHECK" "UNIX-RESOLVE-LINKS"
+ "FD-SETSIZE" "TCGETPGRP" "UNIX-FAST-GETRUSAGE"
+ "UNIX-SIMPLIFY-PATHNAME" "UNIX-KILLPG"
+ "TIOCSIGSEND"
"C-IFLAG" "UNIX-TCGETATTR" "C-LFLAG" "C-OFLAG"
"C-CFLAG" "TCSAFLUSH" "C-CC" "SIOCSPGRP" "TERMIOS"
"UNIX-TCSETATTR" "O_NDELAY" "O_NOCTTY"
(values pid
(if (position signal
#.(vector
- (sb-unix:unix-signal-number :sigstop)
- (sb-unix:unix-signal-number :sigtstp)
- (sb-unix:unix-signal-number :sigttin)
- (sb-unix:unix-signal-number :sigttou)))
+ sb-unix:sigstop
+ sb-unix:sigtstp
+ sb-unix:sigttin
+ sb-unix:sigttou))
:stopped
:signaled)
signal
(sb-unix:unix-ioctl (sb-sys:fd-stream-fd (process-pty proc))
sb-unix:TIOCSIGSEND
(sb-sys:int-sap
- (sb-unix:unix-signal-number signal))))
+ signal)))
((:process-group #-hpux :pty-process-group)
(sb-unix:unix-killpg pid signal))
(t
(cond ((not okay)
(values nil errno))
((and (eql pid (process-pid proc))
- (= (sb-unix:unix-signal-number signal)
- (sb-unix:unix-signal-number :sigcont)))
+ (= signal sb-unix:sigcont))
(setf (process-%status proc) :running)
(setf (process-exit-code proc) nil)
(when (process-status-hook proc)
(when (and env-p environment-p)
(error "can't specify :ENV and :ENVIRONMENT simultaneously"))
;; Make sure that the interrupt handler is installed.
- (sb-sys:enable-interrupt :sigchld #'sigchld-handler)
+ (sb-sys:enable-interrupt sb-unix:sigchld #'sigchld-handler)
;; Prepend the program to the argument list.
(push (namestring program) args)
(let (;; Clear various specials used by GET-DESCRIPTOR-FOR to
(when *interrupt-pending*
(receive-pending-interrupt))
(,name))))))
-\f
-;;;; utilities for dealing with signal names and numbers
-
-(defstruct (unix-signal
- (:constructor make-unix-signal (%name %number))
- (:copier nil))
- ;; signal keyword (e.g. :SIGINT for the Unix SIGINT signal)
- (%name (missing-arg) :type keyword :read-only t)
- ;; signal number
- (%number (missing-arg) :type integer :read-only t))
-
-;;; list of all defined UNIX-SIGNALs
-(defvar *unix-signals* nil)
-
-(defmacro !def-unix-signal (name number)
- (declare (type keyword name))
- (declare (type (and fixnum unsigned-byte) number))
- `(push (make-unix-signal ,name ,number) *unix-signals*))
-
-(/show0 "signal.lisp 131")
-
-(defun unix-signal-or-lose (designator)
- (or (find designator (the list *unix-signals*)
- :key (etypecase designator
- (symbol #'unix-signal-%name)
- (number #'unix-signal-%number)))
- (error "not a valid signal name or number: ~S" designator)))
-
-(/show0 "signal.lisp 142")
-
-;;; Return the name of the designated signal.
-(defun unix-signal-name (designator)
- (symbol-name (unix-signal-%name (unix-signal-or-lose designator))))
-
-(/show0 "signal.lisp 150")
-
-;;; Return the number of the designated signal.
-(defun unix-signal-number (designator)
- (unix-signal-%number (unix-signal-or-lose designator)))
-
-(/show0 "signal.lisp 168")
-
-;;; known signals
-(/show0 "defining Unix signals")
-(!def-unix-signal :CHECK 0) ; check
-(/show0 "done defining CHECK")
-(!def-unix-signal :SIGHUP 1) ; hangup
-(/show0 "done defining SIGHUP")
-(!def-unix-signal :SIGINT 2) ; interrupt
-(/show0 "done defining SIGINT")
-(!def-unix-signal :SIGQUIT 3) ; quit
-(!def-unix-signal :SIGILL 4) ; illegal instruction
-(!def-unix-signal :SIGTRAP 5) ; trace trap
-(!def-unix-signal :SIGIOT 6) ; IOT instruction
-#!-linux
-(!def-unix-signal :SIGEMT 7) ; EMT instruction
-(!def-unix-signal :SIGFPE 8) ; floating point exception
-(!def-unix-signal :SIGKILL 9) ; kill
-(!def-unix-signal :SIGBUS #!-linux 10 #!+linux 7) ; bus error
-(!def-unix-signal :SIGSEGV 11) ; segmentation violation
-#!-linux
-(!def-unix-signal :SIGSYS 12) ; bad argument to system call
-(!def-unix-signal :SIGPIPE 13) ; write on a pipe with no one to read it
-(!def-unix-signal :SIGALRM 14) ; alarm clock
-(!def-unix-signal :SIGTERM 15) ; software termination signal
-#!+linux
-(!def-unix-signal :SIGSTKFLT 16) ; stack fault on coprocessor
-(!def-unix-signal :SIGURG ; urgent condition present on socket
- #!+svr4 21
- #!-(or hpux svr4 linux) 16
- #!+hpux 29
- #!+linux 23)
-(!def-unix-signal :SIGSTOP ; stop
- #!-(or hpux svr4 linux) 17
- #!+hpux 24
- #!+svr4 23
- #!+linux 19)
-(!def-unix-signal :SIGTSTP ; stop signal generated from keyboard
- #!-(or hpux svr4 linux) 18
- #!+hpux 25
- #!+svr4 24
- #!+linux 20)
-(!def-unix-signal :SIGCONT ; continue after stop
- #!-(or hpux svr4 linux) 19
- #!+hpux 26
- #!+svr4 25
- #!+linux 18)
-(!def-unix-signal :SIGCHLD ; Child status has changed.
- #!-(or linux hpux) 20
- #!+hpux 18
- #!+linux 17)
-(!def-unix-signal :SIGTTIN ; background read attempted from control terminal
- #!-(or hpux svr4) 21
- #!+hpux 27
- #!+svr4 26)
-(!def-unix-signal :SIGTTOU ; background write attempted to control terminal
- #!-(or hpux svr4) 22
- #!+hpux 28
- #!+svr4 27)
-(!def-unix-signal :SIGIO ; I/O is possible on a descriptor.
- #!-(or hpux irix linux) 23
- #!+(or hpux irix) 22
- #!+linux 29)
-#!-hpux
-(!def-unix-signal :SIGXCPU ; CPU time limit exceeded
- #!-svr4 24
- #!+svr4 30)
-#!-hpux
-(!def-unix-signal :SIGXFSZ ; file size limit exceeded
- #!-svr4 25
- #!+svr4 31)
-(!def-unix-signal :SIGVTALRM ; virtual time alarm
- #!-(or hpux svr4) 26
- #!+hpux 20
- #!+svr4 28)
-(!def-unix-signal :SIGPROF ; profiling timer alarm
- #!-(or hpux svr4 linux) 27
- #!+hpux 21
- #!+svr4 29
- #!+linux 30)
-(!def-unix-signal :SIGWINCH ; window size change
- #!-(or hpux svr4) 28
- #!+hpux 23
- #!+svr4 20)
-(!def-unix-signal :SIGUSR1 ; user-defined signal 1
- #!-(or hpux svr4 linux) 30
- #!+(or hpux svr4) 16
- #!+linux 10)
-(!def-unix-signal :SIGUSR2 ; user-defined signal 2
- #!-(or hpux svr4 linux) 31
- #!+(or hpux svr4) 17
- #!+linux 12)
-
-;;; SVR4 (or Solaris?) specific signals
-#!+svr4
-(!def-unix-signal :SIGWAITING 32) ; Process's LWPs are blocked.
-
-(/show0 "done with signal.lisp")
;;; should be a valid signal number or a keyword of the standard UNIX
;;; signal name.
(defun unix-kill (pid signal)
- (real-unix-kill pid (unix-signal-number signal)))
+ (real-unix-kill pid signal))
#!-sb-fluid (declaim (inline real-unix-killpg))
(sb!alien:define-alien-routine ("killpg" real-unix-killpg) sb!alien:int
;;; PGRP. SIGNAL should be a valid signal number or a keyword of the
;;; standard UNIX signal name.
(defun unix-killpg (pgrp signal)
- (real-unix-killpg pgrp (unix-signal-number signal)))
+ (real-unix-killpg pgrp signal))
;;; Set the current set of masked signals (those being blocked from
;;; delivery).
\f
;;;; interface to enabling and disabling signal handlers
-(defun enable-interrupt (signal-designator handler)
+(defun enable-interrupt (signal handler)
(declare (type (or function fixnum (member :default :ignore)) handler))
(without-gcing
- (let ((result (install-handler (unix-signal-number signal-designator)
+ (let ((result (install-handler signal
(case handler
(:default sig_dfl)
(:ignore sig_ign)
(defun sb!kernel:signal-cold-init-or-reinit ()
#!+sb-doc
"Enable all the default signals that Lisp knows how to deal with."
- (enable-interrupt :sigint #'sigint-handler)
- (enable-interrupt :sigquit #'sigquit-handler)
- (enable-interrupt :sigill #'sigill-handler)
- (enable-interrupt :sigtrap #'sigtrap-handler)
- (enable-interrupt :sigiot #'sigiot-handler)
+ (enable-interrupt sigint #'sigint-handler)
+ (enable-interrupt sigquit #'sigquit-handler)
+ (enable-interrupt sigill #'sigill-handler)
+ (enable-interrupt sigtrap #'sigtrap-handler)
+ (enable-interrupt sigiot #'sigiot-handler)
#!-linux
- (enable-interrupt :sigemt #'sigemt-handler)
- (enable-interrupt :sigfpe #'sb!vm:sigfpe-handler)
- (enable-interrupt :sigbus #'sigbus-handler)
- (enable-interrupt :sigsegv #'sigsegv-handler)
+ (enable-interrupt sigemt #'sigemt-handler)
+ (enable-interrupt sigfpe #'sb!vm:sigfpe-handler)
+ (enable-interrupt sigbus #'sigbus-handler)
+ (enable-interrupt sigsegv #'sigsegv-handler)
#!-linux
- (enable-interrupt :sigsys #'sigsys-handler)
- (enable-interrupt :sigpipe #'sigpipe-handler)
- (enable-interrupt :sigalrm #'sigalrm-handler)
+ (enable-interrupt sigsys #'sigsys-handler)
+ (enable-interrupt sigpipe #'sigpipe-handler)
+ (enable-interrupt sigalrm #'sigalrm-handler)
(values))
\f
;;;; etc.
;; can't use handling-end-of-the-world, because that flushes
;; output streams, and we don't necessarily have any (or we
;; could be sharing them)
- (sb!sys:enable-interrupt :sigint :ignore)
+ (sb!sys:enable-interrupt sb!unix:sigint :ignore)
(sb!unix:unix-exit
(catch 'sb!impl::%end-of-the-world
(with-simple-restart
;;; Conventional wisdom says that it's a bad idea to use these unless
;;; you really need to. Use a lock or a waitqueue instead
(defun suspend-thread (thread-id)
- (sb!unix:unix-kill thread-id :sigstop))
+ (sb!unix:unix-kill thread-id sb!unix:sigstop))
(defun resume-thread (thread-id)
- (sb!unix:unix-kill thread-id :sigcont))
+ (sb!unix:unix-kill thread-id sb!unix:sigcont))
;;; Note warning about cleanup forms
(defun destroy-thread (thread-id)
"Destroy the thread identified by THREAD-ID abruptly, without running cleanup forms"
- (sb!unix:unix-kill thread-id :sigterm)
+ (sb!unix:unix-kill thread-id sb!unix:sigterm)
;; may have been stopped for some reason, so now wake it up to
;; deliver the TERM
- (sb!unix:unix-kill thread-id :sigcont))
+ (sb!unix:unix-kill thread-id sb!unix:sigcont))
;;; a moderate degree of care is expected for use of interrupt-thread,
;;; this should only be called while holding the queue spinlock.
(defun signal-queue-head (queue)
(let ((p (car (waitqueue-data queue))))
- (when p (sb!unix:unix-kill p :sigcont))))
+ (when p (sb!unix:unix-kill p sb!unix:sigcont))))
;;;; mutex
(sb!sys:make-fd-stream err :input t :output t :buffering :line))
(sb!impl::*descriptor-handlers* nil))
(get-mutex *session-lock*)
- (sb!sys:enable-interrupt :sigint #'sb!unix::sigint-handler)
+ (sb!sys:enable-interrupt sb!unix:sigint #'sb!unix::sigint-handler)
(unwind-protect
(sb!impl::toplevel-repl nil)
(sb!int:flush-standard-output-streams)))))
(let ((h (car (waitqueue-data queue))))
(setf (waitqueue-lock queue) 0)
(when h
- (sb!unix:unix-kill h :sigcont)))))
+ (sb!unix:unix-kill h sb!unix:sigcont)))))
;;;; mutex
(defun get-foreground ()
(when (not (eql (mutex-value *session-lock*) (current-thread-id)))
(get-mutex *session-lock*))
- (sb!sys:enable-interrupt :sigint #'sb!unix::sigint-handler)
+ (sb!sys:enable-interrupt sb!unix:sigint #'sb!unix::sigint-handler)
t)
#!-sb-thread
(defun get-foreground () t)
#!+sb-thread
(defun release-foreground ()
- (sb!sys:enable-interrupt :sigint :ignore)
+ (sb!sys:enable-interrupt sb!unix:sigint :ignore)
(release-mutex *session-lock*)
t)
#!-sb-thread
include ../src/runtime/Config
+CPPFLAGS=-I../src/runtime
+
all: grovel_headers determine-endianness
clean:
#include <sys/termios.h>
#include <fcntl.h>
#include <unistd.h>
+#include <signal.h>
+
+#include "genesis/config.h"
#define DEFTYPE(lispname,cname) { cname foo; \
printf("(define-alien-type " lispname " (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); }
lisp_name, unix_number, unix_number);
}
+#define DEFSIGNAL(name) defconstant(#name, name)
+
int
main(int argc, char *argv[])
{
*/
printf("\n");
+ printf(";;; signals\n");
+ DEFSIGNAL(SIGALRM);
+ DEFSIGNAL(SIGBUS);
+ DEFSIGNAL(SIGCHLD);
+ DEFSIGNAL(SIGCONT);
+#ifndef LISP_FEATURE_LINUX
+ DEFSIGNAL(SIGEMT);
+#endif
+ DEFSIGNAL(SIGFPE);
+ DEFSIGNAL(SIGHUP);
+ DEFSIGNAL(SIGILL);
+ DEFSIGNAL(SIGINT);
+ DEFSIGNAL(SIGIO);
+ DEFSIGNAL(SIGIOT);
+ DEFSIGNAL(SIGKILL);
+ DEFSIGNAL(SIGPIPE);
+ DEFSIGNAL(SIGPROF);
+ DEFSIGNAL(SIGQUIT);
+ DEFSIGNAL(SIGSEGV);
+#ifdef LISP_FEATURE_LINUX
+ DEFSIGNAL(SIGSTKFLT);
+#endif
+ DEFSIGNAL(SIGSTOP);
+#ifndef LISP_FEATURE_LINUX
+ DEFSIGNAL(SIGSYS);
+#endif
+ DEFSIGNAL(SIGTERM);
+ DEFSIGNAL(SIGTRAP);
+ DEFSIGNAL(SIGTSTP);
+ DEFSIGNAL(SIGTTIN);
+ DEFSIGNAL(SIGTTOU);
+ DEFSIGNAL(SIGURG);
+ DEFSIGNAL(SIGUSR1);
+ DEFSIGNAL(SIGUSR2);
+ DEFSIGNAL(SIGVTALRM);
+#ifdef LISP_FEATURE_SVR4
+ DEFSIGNAL(SIGWAITING);
+#endif
+ DEFSIGNAL(SIGWINCH);
+#ifndef LISP_FEATURE_HPUX
+ DEFSIGNAL(SIGXCPU);
+ DEFSIGNAL(SIGXFSZ);
+#endif
+
return 0;
}
;;; 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.3.16"
+"0.8.3.17"