[Coco] Os9 Intercept

William Astle lost at l-w.ca
Tue Oct 30 13:12:00 EDT 2012


On 12-10-30 10:56 AM, Theodore (Alex) Evans wrote:
> On 12-10-30 11:35 AM, Retro Canada wrote:
>> well I fount out that getchar demands an ENTER, like gets(stdin). This
>> C compiler is very buggy.
>
> While the C compiler has some bugs, this isn't one of them.  It is an
> effect of buffered I/O.  It will apear to work this way on most
> operating systems I have dealt with.

Actually, the ENTER for getchar depends as much on the low level 
terminal configuration as it does on I/O buffering. If the terminal is 
operating in "line mode" (which is usually the default), any read of the 
terminal will wait for an entire line before a user program sees the 
input characters.

On Unix, you need to set a terminal to "raw" mode (or similar) to avoid 
the ENTER being required behaviour. I don't know the details of os9 but 
I would expect a similar situation there. Depending how stdio buffering 
is implemented, there may be further interactions with that. If you need 
character oriented interactive behaviour, you generally need to turn off 
all buffering and input character processing at every level of the stack 
from the C library down to the low level operating system drivers.

>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco




More information about the Coco mailing list