Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!brahms.udel.edu!weave From: weave@brahms.udel.edu (Ken Weaverling) Newsgroups: comp.unix.sysv386 Subject: Re: Curses bug in halfdelay() ? Keywords: curses halfdelay bug sysv Message-ID: <17070@brahms.udel.edu> Date: 24 Dec 90 23:50:02 GMT References: <17068@brahms.udel.edu> Distribution: na Organization: University of Delaware Lines: 26 In article <17068@brahms.udel.edu> I (Ken Weaverling) write: >I am trying to get the halfdelay() routine in curses to implement a timeout >on a getch() call. It simply blocks and doesn't return. This same test program >I set up (included below) works fine on a Sun 4 using /usr/5bin/cc to compile. >I have tried cc and gcc on my box, but none work. > >Machine and OS specifics: > >Prime EXL 325, 386 Multibus II box >AT&T Unix Sys V 3.1 version 2 I also just tried this on a Unisys u6000 box running AT&T Sys V/386 3.2 (note, later version than mine). The code STILL doesn't timeout on the read but blocks forever.... Is it a safe work-around for me to use alarm() and trap the alarm signal? What I would do is call alarm() right before the getch() and trap the alarm signal, then set a flag in it and return. The getch() would be terminated after the timeout period. Or is there a better method? Again, using nodelay would force me to poll getch() and that would chew CPU cycles needlessly... Thanks! -- >>>---> Ken Weaverling >>>----> weave@brahms.udel.edu