Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!floyd!harpo!seismo!hao!hplabs!sri-unix!gwyn@brl-vld
From: gwyn%brl-vld@sri-unix.UUCP
Newsgroups: net.unix
Subject: Re:  Signal interrupt on character ready in System V?
Message-ID: <17039@sri-arpa.UUCP>
Date: Wed, 7-Mar-84 00:40:38 EST
Article-I.D.: sri-arpa.17039
Posted: Wed Mar  7 00:40:38 1984
Date-Received: Sun, 4-Mar-84 03:24:32 EST
Lines: 14

From:      Doug Gwyn (VLD/VMB) 

UNIX System V has no signal reserved for interrupting when input is
available.  You can achieve such a signal by forking off a reader
process that sends SIGUSR1 to its parent when it successfully gets
a character.  The same scheme works on older UNIXes too, subject to
the well-known problems of using signals for IPC.

It is also possible to do a non-blocking read from a pipe or tty
by using O_NDELAY.  Unfortunately a true EOF cannot be distinguished
from an empty input in any simple way on an O_NDELAY read().  The
non-blocking read can be used to "poll" whether input is available
as an alternative to using interrupts.  (The most probable way of
fielding interrupts would be to just set a flag for polling anyhow.)