"stage2: deployment mode" print
] [
"debugger" require
+ os unix? [ "debugger.unix" require ] when
"listener" require
] if
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: debugger io kernel math prettyprint sequences system
-io.launcher.unix accessors strings ;
+USING: accessors debugger io kernel math prettyprint sequences
+system unix.signals ;
IN: debugger.unix
-CONSTANT: signal-names
-{
- "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT"
- "SIGEMT" "SIGFPE" "SIGKILL" "SIGBUS" "SIGSEGV" "SIGSYS"
- "SIGPIPE" "SIGALRM" "SIGTERM" "SIGURG" "SIGSTOP" "SIGTSIP"
- "SIGCONT" "SIGCHLD" "SIGTTIN" "SIGTTOU" "SIGIO" "SIGXCPU"
- "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" "SIGINFO"
- "SIGUSR1" "SIGUSR2"
-}
-
-GENERIC: signal-name ( obj -- str/f )
-
-M: signal signal-name n>> signal-name ;
-
-M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ;
-
: signal-name. ( n -- )
signal-name [ " (" ")" surround write ] when* ;
io.backend io.backend.unix.multiplexers io.buffers io.files
io.ports io.timeouts kernel kernel.private libc locals make math
namespaces sequences summary system threads unix unix.ffi
-unix.stat unix.types ;
+unix.signals unix.stat unix.types ;
QUALIFIED: io
IN: io.backend.unix
size-read-fd <fd> init-fd <input-port> >>size
data-read-fd <fd> >>data ;
-SYMBOL: dispatch-signal-hook
-
-dispatch-signal-hook [ [ drop ] ] initialize
-
: signal-pipe-fd ( -- n )
OBJ-SIGNAL-PIPE special-object ; inline
! Copyright (C) 2011 Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
-USING: assocs io.backend.unix kernel namespaces sequences
-threads ;
+USING: accessors assocs kernel math namespaces sequences threads ;
IN: unix.signals
+CONSTANT: signal-names
+{
+ "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT"
+ "SIGEMT" "SIGFPE" "SIGKILL" "SIGBUS" "SIGSEGV" "SIGSYS"
+ "SIGPIPE" "SIGALRM" "SIGTERM" "SIGURG" "SIGSTOP" "SIGTSIP"
+ "SIGCONT" "SIGCHLD" "SIGTTIN" "SIGTTOU" "SIGIO" "SIGXCPU"
+ "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" "SIGINFO"
+ "SIGUSR1" "SIGUSR2"
+}
+
+TUPLE: signal n ;
+
+GENERIC: signal-name ( obj -- str/f )
+
+M: signal signal-name n>> signal-name ;
+
+M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ;
+
+SYMBOL: dispatch-signal-hook
+
+dispatch-signal-hook [ [ drop ] ] initialize
+
<PRIVATE
SYMBOL: signal-handlers