Curses bug in halfdelay() ?

Ken Weaverling weave at brahms.udel.edu
Tue Dec 25 10:50:02 AEST 1990


In article <17068 at 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 at brahms.udel.edu



More information about the Comp.unix.sysv386 mailing list