From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m0.truegem.net (m0.truegem.net [69.55.228.47]) by sourceware.org (Postfix) with ESMTPS id 03521386F030 for ; Tue, 9 Feb 2021 10:15:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 03521386F030 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maxrnd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=mark@maxrnd.com Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id 119AFfQM089107 for ; Tue, 9 Feb 2021 02:15:41 -0800 (PST) (envelope-from mark@maxrnd.com) Received: from 162-235-43-67.lightspeed.irvnca.sbcglobal.net(162.235.43.67), claiming to be "[192.168.1.20]" via SMTP by m0.truegem.net, id smtpdGxUrWh; Tue Feb 9 02:15:35 2021 Subject: Re: Extending domain of O_TMPFILE? To: cygwin-developers@cygwin.com References: <20210205112650.GO4251@calimero.vinschen.de> <20210208103402.GP4251@calimero.vinschen.de> From: Mark Geisert Message-ID: <0445c853-e3b4-9320-fbfa-057d1fadda3b@maxrnd.com> Date: Tue, 9 Feb 2021 02:15:36 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: <20210208103402.GP4251@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 10:15:43 -0000 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