true unbuffered input.

Elliott Finley efinley%ug.utah.edu at cs.utah.edu
Tue Jan 16 16:26:52 AEST 1990


I can't seem to get true unbuffered input.  By unbuffered input I mean
that the user should be able to type a key and then the program should
be able to act on that key before <CR> is pressed.

I've tried the following:

int getchar(void)
{
   char c;

   return (read(0, &c, 1) == 1) ? (unsigned char) c : EOF;
}

But it still waits for a carriage return before the program actually sees
the data..

Any help would be appreciated.  (I running on a VAX with BSD 4.3)

--

Send email to efinley at ug.utah.edu




More information about the Comp.lang.c mailing list