Checking for waiting characters

Branagon ejbjr at ihuxy.UUCP
Thu May 8 02:35:44 AEST 1986


*** REPLACE THIS MESSAGE WITH YOUR LINE ***

> In article <470 at brl-smoke.ARPA> KEN%NJITCCCC.BITNET at wiscvm.wisc.edu (Kenneth Ng) writes:
> >On Unix System V version 2 on an AT&T 3b5, has anyone been able to
> >successfully test if characters are pending?  I've got an application
> >that needs to time out after a certain amount of time if no characters
> >come through.

The easiest way I've found to do this is to set an alarm, and use a signal
trapping function (see alarm(2) and signal(2)).  The alarm can be set once
at the beginning, or reset after each character.  I'm not sure if alarm()
is sysV specific or not.

-----------------

Ed Branagan
ihnp4!ihuxy!ejbjr



More information about the Comp.unix.wizards mailing list