[net.unix] Signal interrupt on character ready in System V?

FISCHER@RU-BLUE.ARPA (03/01/84)

From:  Ron <FISCHER@RU-BLUE.ARPA>

Could someone with a version V manual tell me if this can be done?

(ron)
-------

gwyn%brl-vld@sri-unix.UUCP (03/07/84)

From:      Doug Gwyn (VLD/VMB) <gwyn@brl-vld>

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.)