io.backend.unix: init-signal-pipe function

Currently just reads off signal numbers and drops them.
db4
Joe Groff 2011-11-07 21:14:41 -08:00
parent f9aa0419c4
commit ed24890dce
2 changed files with 9 additions and 0 deletions

View File

@ -187,6 +187,13 @@ M: stdin cancel-operation
size-read-fd <fd> init-fd <input-port> >>size
data-read-fd <fd> >>data ;
: signal-pipe-fd ( -- n )
OBJ-SIGNAL-PIPE special-object { fixnum } declare ; inline
: init-signal-pipe ( -- )
signal-pipe-fd <fd> init-fd <input-port>
'[ [ 4 _ io:stream-read ] loop ] "Signals" spawn drop ;
M: unix init-stdio
<stdin> <input-port>
1 <fd> <output-port>

View File

@ -342,6 +342,8 @@ CONSTANT: OBJ-VM-COMPILER 72
CONSTANT: OBJ-WAITING-CALLBACKS 73
CONSTANT: OBJ-SIGNAL-PIPE 74
! Context object count and identifiers must be kept in sync with:
! vm/contexts.hpp