Mail Archives: djgpp/1999/09/01/19:01:41

Date: Wed, 1 Sep 1999 23:24:23 +0200 (MET DST)
From: Gisle Vanem <giva AT bryggen DOT bgnett DOT no>
To: djgpp AT delorie DOT com
Subject: Re: OS/2 + delay() bug
In-Reply-To: <>
Message-ID: <>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 1 Sep 1999, sl wrote:

> ---------------------
> #include <stdio.h>
> #include <dos.h>
> int main()
> {
>   printf("Before delay.\r\n");
>   delay(1000);
>   printf("After delay.\r\n");
>   exit(0);
> }
> -------------------
> 	When running under OS/2 4.0, fixpack 10.. if the user presses PAUSE
> while delay() is in effect, and attempts to unpause a second later, the
> entire DOS session hangs.. It seems that delay() gets into an endless loop
> due to the fact that it missed the target time it was waiting for. While the
> program was paused, the 'target-time' was missed, and when the system was
> unpaused delay() kept on waiting for the target-time which will not be
> reached for another 24 hours .. That is an assumption on my part.

Don't assume, look at libc-source. It doesn't do itlike that.

> I do not
> actually know what is at fault but I do know the following for a fact:
> 1) OS/2 4.0, fixpack 10, 11 all hang as mentioned above (even on different
> machines)
> 2) Win98 does NOT hang

It's probably a bug in emulation of Int15h/86. AFAIK Win-NT has a 
similar problem with delay(). Better to use usleep() altogether.

Gisle V.
> Gili

- Raw text -

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