delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/04/27/06:48:08

Message-Id: <199804271144.NAA33208@ieva06.lanet.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Date: Mon, 27 Apr 1998 13:42:58 +0300
MIME-Version: 1.0
Subject: Re: Patch to add target specific cleanup for gcc.c
CC: djgpp-workers AT delorie DOT com
References: <199804270915 DOT LAA57422 AT ieva06 DOT lanet DOT lv>
In-reply-to: <Pine.SUN.3.91.980427130137.23236A-100000@is>

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 -


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