Mail Archives: djgpp/2000/01/05/06:26:02
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 -