www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/29/10:39:08

Message-ID: <3AC356EE.3010201@ujf-grenoble.fr>
Date: Thu, 29 Mar 2001 17:38:22 +0200
From: Maurice Lombardi <Maurice DOT Lombardi AT ujf-grenoble DOT fr>
User-Agent: Mozilla/5.0 (Windows; U; Win98; fr-FR; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: fr,it,en
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com, gpc <gpc AT gnu DOT de>
Subject: Re: Bug in Delay
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010329120944 DOT 3269d AT is>
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:

> On Thu, 29 Mar 2001, Maurice Lombardi wrote:
> 
> 
>>> What I'm wondering is, if DJGPP's libc contains a delay() function
>>> which does handle short delays well (and even seems to use
>>> microseconds internally AFAICS), why doesn't its usleep() function
>>> do the same thing?
>> 
> 
> If both functions used the same service, you couldn't have chosen one or 
> the other, depending on your needs.  Having both is better than only one.
> 
> Why is it a problem that they use different methods?  The docs clearly 
> says what service is used, so the information is available, isn't it?

The question has been raised by an user of GNU pascal (gpc) who found a difference between delay() in C and delay() in 
gpc. gpc beeing all platforms, not limited to djgpp, has implemented a delay() function by using usleep(), which, while 
being neither ANSI nor POSIX, is available on many platforms: prototype in unistd.h which exists e.g. on linux. The 
djgpp C delay() function is a dosish nicety (prototype in dos.h) which exists nowhere else. It is unfortunate that djgpp 
implemented the less accurate delay function with the more standard usleep() function. But probably gpc maintainers will 
cope with this ...
Maurice

-- 
        Maurice Lombardi
Laboratoire de  Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex     FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 51 45 44
mailto:Maurice DOT Lombardi AT ujf-grenoble DOT fr

- Raw text -


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