delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/18/12:50:54

Date: Tue, 18 Mar 1997 20:20:12 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Indrek Mandre <indrek AT warp DOT edu DOT ee>
cc: djgpp AT delorie DOT com
Subject: Re: signal() and alarm() - Bug?
In-Reply-To: <Pine.LNX.3.95.970318163935.1271C-100000@warp.edu.ee>
Message-ID: <Pine.SUN.3.91.970318201511.18446F@is>
MIME-Version: 1.0

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019