[449] in bugtraq
Re: Race conditions
daemon@ATHENA.MIT.EDU (Fred Blonder)
Fri Dec 9 18:01:22 1994
Date: Fri, 9 Dec 1994 15:19:52 -0500
From: fred@nasirc.hq.nasa.gov (Fred Blonder)
To: jason@dickory.sdsu.edu, rwing!pat@ole.cdac.com
Cc: bugtraq@fc.net
From: rwing!pat@ole.cdac.com (Pat Myrto)
And if a temp file MUST be made, use the mkstemp()
call to generate the name and open it. Mkstemp()
atomically generates the tempname from the template,
opens the file and returns a handle. As the manpage
says, mkstemp() eliminates the race condition between
testing if a file exists, and the opening of the tmp file.
But 'mkstemp()' is in section 3 of the manual; it's a subroutine,
not a system call, so how can it be 'atomic'?