delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/05/06:26:02

Date: Wed, 5 Jan 2000 10:37:10 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Dlanor Blytkerchan <dlanor AT dds DOT nl>
cc: djgpp AT delorie DOT com
Subject: Re: a bug?
In-Reply-To: <l03130300b496614bbdcf@[145.98.119.193]>
Message-ID: <Pine.SUN.3.91.1000105103609.7920C-100000@is>
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 Mon, 3 Jan 2000, Dlanor Blytkerchan wrote:

> : #include <stdio.h>
> : 
> : int main(void) {
> :   int i;
> : 
> :   for (i = 0; i < TMP_MAX; i++) printf("%d: %p\n", tmpfile());
> : } // main()
> displays (on my computer) 23 pointers and subsequently hangs.

Thanks for the report and a clear test case.

This is indeed a bug in `tmpfile': it doesn't take in consideration
that file creation can fail when all the file handles available to
DOS are exhausted.

This bug will be corrected in the next DJGPP release.  If you have an
urgent need for a fixed version, I can send the corrected source.

Btw, the exact number of files this program opens before it returns a
NULL pointer is determined by your system configuration (the FILES=
directive in CONFIG.SYS and some other factors).  See section 9.6 of
the DJGPP FAQ list for more about this.

- Raw text -


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