ReadKey like Function in C
Dave Hammond
daveh at marob.masa.com
Sat Aug 12 01:21:48 AEST 1989
In article <941 at lakesys.UUCP> davef at lakesys.UUCP (Dave Fenske) writes:
>In article <207600029 at s.cs.uiuc.edu> mccaugh at s.cs.uiuc.edu writes:
>> Wait a minute -- am I missing something here? Isn't conventional (Kernighan-
>> Ritchie) C supoosed to be capable of system-calls to the operating-system
>> [...]
>Absolutely! You need only do the following:
>
>1. do an "ioctl (n, TCGETA, &term)
>2. modify some parameters, such as
> term.c_lflag &= ~(ICANON | ECHO) or whatever else you need
>3. term.c_cc [VTIME] = some_value <- for timeout, if desired
>4. term.c_cc [VMIN] = 1 <- satisfy read with 1 character
>5. ioctl (m, TCSETA, &term) to reset the terminal
>6. you can now do a read (n, &work, 10)
True enough -- on ONE of the dozens of systems on which C compilers exist.
Remember, the name of this newsgroup is NOT comp.lang.c.on.unix.system.v !
--
Dave Hammond
daveh at marob.masa.com
More information about the Comp.lang.c
mailing list