Date: Tue, 18 Mar 1997 20:20:12 +0300 (IDT) From: Eli Zaretskii To: Indrek Mandre cc: djgpp AT delorie DOT com Subject: Re: signal() and alarm() - Bug? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 18 Mar 1997, Indrek Mandre wrote: > I have a programme in Linux. It sets with sigaction to SIGALARM call my > handler. After that I use setitimer to call my function 100 times in one > second. It works. In DJGPP my handler gets called only 10 times in > one second. Is it possible to make it call my function more times? You can't get more than 18.2 calls per second, because that's the frequency of the timer tick interrupt on MSDOS. I guess you get less that that because the exception mechanism used by DJGPP signal processing involves a lot of overhead. SIGALARM isn't meant to be used as a substitute for timer interrupt handler. > Another question (why not all in here): I'v seen that in DOS there are > strange functions like findfirst, findnext and other such stupid (my > opinion) things. I wonder why people do not use open-/read-/xxx-dir/stat/xx. Because many other DOS compilers don't have opendir/readdir. findfirst and findnext directly follow the DOS functions which do that. > Anyway I want to port some programmes from DJGPP to Linux. And there are > those findfirsts and other artworks in there. My question: is there > anywhere such library which helps me to port those ugly things. I would suggest rewriting the relevant fragment using opendir/readdir. Use #ifdef to separate the two versions.