Extending domain of O_TMPFILE?

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Feb 5 11:26:50 GMT 2021


On Feb  5 02:31, Mark Geisert wrote:
> Hi folks,
> I've been following up on a response I made to a Cygwin user in
> https://cygwin.com/pipermail/cygwin/2021-January/247306.html .
> I've figured out that Cygwin's implementation of the open() flag O_TMPFILE
> follows Linux in that one can't specify the name of a file when using this
> flag.  User supplies only the path, and Cygwin chooses an obscure file name
> for you.
> 
> That means the OP's suggested improvement of applying O_TMPFILE semantics to
> files created by tmpfile() won't work.

I don't understand the problem.  tmpfile(3) does not take filenames, it
creates its own filenames.  Thus, just adding O_TMPFILE in _tmpfile_r's
and _tmpfile64's calls to open() on systems supporting this flag and not
calling _remove_r subsequently would already do the trick.


Corinna


More information about the Cygwin-developers mailing list