public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Mark Geisert <mark@maxrnd.com>
To: cygwin-developers@cygwin.com
Subject: Re: Extending domain of O_TMPFILE?
Date: Tue, 9 Feb 2021 02:15:36 -0800	[thread overview]
Message-ID: <0445c853-e3b4-9320-fbfa-057d1fadda3b@maxrnd.com> (raw)
In-Reply-To: <20210208103402.GP4251@calimero.vinschen.de>

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.
Thanks!

..mark

      reply	other threads:[~2021-02-09 10:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 10:31 Mark Geisert
2021-02-05 11:26 ` Corinna Vinschen
2021-02-06  7:56   ` Mark Geisert
2021-02-08 10:34     ` Corinna Vinschen
2021-02-09 10:15       ` Mark Geisert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0445c853-e3b4-9320-fbfa-057d1fadda3b@maxrnd.com \
    --to=mark@maxrnd.com \
    --cc=cygwin-developers@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).