Mail Archives: djgpp-workers/1998/04/27/06:48:08
Date sent: Mon, 27 Apr 1998 13:05:01 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Subject: Re: Patch to add target specific cleanup for gcc.c
>
> On Mon, 27 Apr 1998, Andris Pavenis wrote:
>
> > mktemp() only generates the name but file is not
> > actually created. The name after that is given to some other program for
> > example cc1.exe as name of object file to be generated. Unfortunatelly
> > under Windows it is still possible for gcc from other DOS session to generate
> > the same name of temporary file.
>
> I sent patches to this list a few weeks ago that fix that bug. If you
> don't have them, I can resend them (or you can search the mail archives at
> http://www.delorie.com/djgpp/mail-archives/).
>
> I think that with the fixed library functions MKTEM__EACH_FILE should
> solve the problems.
>
As I understood You thought Your patches to
int mkstemp (char *template)
mkstemp() not only returns name but also creates the file. The only information
I need is name of the file, so I then have to close it immediatelly not to waste
file descriptors. After that another program (cpp.exe, cc1.exe, cc1plus.exe,
or as.exe) opens it once more for output.
I think that creating one extra file can still be in average faster than opening EVERY
temporary files once more. Of course this is safer than approach I used,
but is it worth the overhead we'll have
Andris
- Raw text -