Mail Archives: djgpp/2001/03/29/10:39:08
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 -