Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!quasi-eli!cs.yale.edu!fields-doug From: fields-doug@cs.yale.edu (Doug Fields) Newsgroups: comp.unix.sysv386 Subject: Portable versions of SCO Xenix/Unix nap() and rdchk() Message-ID: <29698@cs.yale.edu> Date: 26 Mar 91 21:43:33 GMT Sender: news@cs.yale.edu Organization: Yale University, CS, New Haven, CT, Admiral's Account Lines: 25 Nntp-Posting-Host: tiger.zoo.cs.yale.edu Originator: fields@tiger.CS.Yale.Edu I am using the functions nap() and rdchk() in one of my programs. I was wondering if anyone had any code to emulate these in a portable, non-cpu intensive way. In case you don't know what these do: rdchk(f) - checks to see if a subsequent read would not block... I use it as rdchk(0) to see if the user has pressed a key yet. Returns 1 if there is input waiting. nap(t) - sleeps for t milliseconds. I use this to put a 1/5th of a second pause (nap(200)). If there is no way to get nap() to work the program works just fine with sleep(1) but it is a lot more slugish. As for rdchk, Apparently you can use ioctl to set the VTIME and the other parameter to 0 and get a very cpu-intensive form of rdchk. Any help is appreiciated. Thanks. Doug -- Doug Fields -POB 1789 Yale Station, New Haven, CT 06520- (FAX) +1 203 661-2996 Internet: fields-doug@cs.yale.edu <-- Best to reach me. Voice: +1 203 436-0184 uucp: ...uunet!sir-alan!admiral!doug --------------------- Thank you Sir-Alan! BBS: (T2500) +1 203 661-2873, (HST/V.32) -1279, (V.32) -0450, (v29/MNP6) -2967