C I/O Question
Dan Messinger
dan at rose3.UUCP
Fri Aug 8 03:50:26 AEST 1986
In article <423 at argus.UUCP> ken at argus.UUCP (Kenneth Ng) writes:
>> If you have System V, you can also set a minimum number of
>> chars before input returns, and/or a timeout.
>
>I've had a problem using this on an AT&T 3b5 running Syst 5R2.
>It seems that if you set the min character and timeout value,
>the timeout does NOT occur until the process receives at least
>ONE character.
If you want to check to see if there is any input pending WITHOUT
waiting at all, then you should set min to 0. If you are setting
min to zero, then your system is busted.
Also, something not mentioned in all manuals is that the timeout
should not be set to 1. Use 0 for no timeout, or a value of 2
or greater. Setting a timeout of 1 is similiar to doing a sleep(1).
Dan Messinger
ihnp4!rosevax!rose3!dan
More information about the Comp.lang.c
mailing list