From ed24890dce697d119b9cd47b1fbf75b09c1f0150 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 7 Nov 2011 21:14:41 -0800 Subject: [PATCH] io.backend.unix: init-signal-pipe function Currently just reads off signal numbers and drops them. --- basis/io/backend/unix/unix.factor | 7 +++++++ core/kernel/kernel.factor | 2 ++ 2 files changed, 9 insertions(+) diff --git a/basis/io/backend/unix/unix.factor b/basis/io/backend/unix/unix.factor index 20799cbb4a..96f0d21749 100755 --- a/basis/io/backend/unix/unix.factor +++ b/basis/io/backend/unix/unix.factor @@ -187,6 +187,13 @@ M: stdin cancel-operation size-read-fd init-fd >>size data-read-fd >>data ; +: signal-pipe-fd ( -- n ) + OBJ-SIGNAL-PIPE special-object { fixnum } declare ; inline + +: init-signal-pipe ( -- ) + signal-pipe-fd init-fd + '[ [ 4 _ io:stream-read ] loop ] "Signals" spawn drop ; + M: unix init-stdio 1 diff --git a/core/kernel/kernel.factor b/core/kernel/kernel.factor index 32cdb24b06..a79e65c2b4 100644 --- a/core/kernel/kernel.factor +++ b/core/kernel/kernel.factor @@ -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