Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!brl-adm!brl-smoke!smoke!02335%UWAV4.BITNET@wiscvm.ARPA From: 02335%UWAV4.BITNET@wiscvm.ARPA Newsgroups: net.lang.c Subject: C prgram needed - read with timeout Message-ID: <3092@brl-smoke.ARPA> Date: Sat, 16-Aug-86 01:08:48 EDT Article-I.D.: brl-smok.3092 Posted: Sat Aug 16 01:08:48 1986 Date-Received: Tue, 19-Aug-86 03:34:42 EDT Sender: news@brl-smoke.ARPA Lines: 28 Hi, I have been working on an HP-9000 Unix machine trying to do a read that does not wait for a RETURN. One character is all I need, but there doesn;t seem to be a C function to do this. I've looked at the IOCTL stuff, but the timeout doesn't work until after one character has been pressed. I did get something to work setting the O_NDELAY bit with FCNTL, but there is no way to unset that bit so when I exit the program I get logged out since UNIX timeouts and all other reads timeout as well. I eventually wrote an interrupt handler using SIGNAL. But I really need to trap and return any character being pressed not just the DELETE key. My main program is really in FORTRAN, but I'm pretty sure that I must call a C routine to get the job done if it is possible. I am really a Vax FORTRAN programmer which has no problem polling the keypboard, so I am a little amused that C doesn't seem to have this capability. Any help would be greatly appreciated... Please reply directly to me since I do not get INFO-C mail. Thanks in advance, Tony Andrea Sierra Geophysics, Inc. Kirkland, Washington BITNET: 02335 at UWAV4 ARPA/CSNET: 02335%uwav4.bitnet@wiscvm.arpa