Extending domain of O_TMPFILE?

Mark Geisert mark@maxrnd.com
Tue Feb 9 10:15:36 GMT 2021

Corinna Vinschen via Cygwin-developers wrote:
> On Feb  5 23:56, Mark Geisert wrote:
>> So that's what led me to contemplate extending the domain of O_TMPFILE such
>> that one could proactively name the temporary file.  But it's probably more
>> sane to just have _tmpfile_r skip the generation of a file name and instead
>> pass in a directory name to open(), either from environment variable TMPDIR
>> or the libc #define P_tmpdir.
>> Does this sound OK?
> Yes, the matching patch should be in _tmpfile_r / _tmpfile64_r.
> Alternatively, and probably much simpler, you could define our
> own tmpfile / tmpfile64 in Cygwin's syscalls.cc, kind of like this:
>    extern "C" FILE *
>    tmpfile (void)
>    {
>      [...]
>    }
>    EXPORT_ALIAS (tmpfile, tmpfile64)

Oh, that makes much more sense as the code site.  I've a little more testing to 
do, then will submit the patch.


More information about the Cygwin-developers mailing list