delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/02/16:16:18

Newsgroups: comp.os.msdos.djgpp
From: Daniel Johnson <u5dj AT csc DOT liv DOT ac DOT uk>
Subject: Why oh why (again)...
Sender: news AT csc DOT liv DOT ac DOT uk (News Eater)
Message-ID: <33686B1A.2DCA@csc.liv.ac.uk>
Date: Thu, 1 May 1997 10:06:18 GMT
Lines: 41
Mime-Version: 1.0
Organization: The University of Liverpool
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ok, I think this time I better start at the beginning...

Recently, I required a simple program to wait for 5 seconds and then
return with no error code. Ok I thought, simple. Indeed it is :

/******************************/

#include <stdio.h>
#include <stdlib.h>

int main(void) {
  delay(2500);
  exit(0);
}

/******************************/

The above code compiles and links correctly, and an executable file
is generated. The problems come when I try to run it.

From DOS only (no windows) the program operates correctly. It waits
for 5 seconds and then exits.

From DOS box within windows (3.11) it appears to hang the machine -
Ctrl-Alt-Del reports that the application has stopped responding to
the system. Occasionally, it hangs the entire machine - but this is
uncommon.

The same happens if it's run from file manager etc.

BUT IT'S NOT A WINDOWS PROBLEM !!!

How do I know this ? The same code operates fine in all conditions
when compiled with Borland Turbo C/C++...

WHY ??????????????????????????????

Any light to be shed ?

Thanks,
Danny.

- Raw text -


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