DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 45759oDr993041 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=PGmu92kY X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0A7339E6655 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1717736988; bh=ih57UNZkh6hkcjDfC9k7eNuT7GiFlT1kI847aj/Phc8=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PGmu92kYRrjhuawnbzwXGHPFBlMT9d2mlGfu70++KTeUmjakd+lj2c3sUa3cWVGC4 UVbfMr8G8dGlIm1akPj3D1zXanwmNTGpbLDtnRVpHY/COPTchkGuRlB4XeBTIFmaaX w6//pMj5YPNr9yyquVJHHwVQsig9Binqb1dO/oBY= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D50D39AB920 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6D50D39AB920 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717736930; cv=none; b=ImSTZTXgQQyPXNjA103yuPXTI6G1NAj9Eob4+Cf4rM6ypMKT57HZExdAb8HHSKqM0+b7BQWTrjF3WoCX2H3loV9BYJa4fWzl2cHToKhVcucot8ACUuO7Era7bL+CeTWeXuYQ1dsL3FWuj9BZQP+BVUozePev6O9eQmhkcWIMFfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717736930; c=relaxed/simple; bh=YYc9V84QsaOZOY9P+zatBCJ26w3BA2kf27HDc+VhAe4=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=wCM5wF4zPs5rM5Kw8yXppx0oqbdcx4SAGZkAp4+NZPr3yXdfQUswOxLrQq4ivseSh0vbiEgM+Qdt2SgUFuLZI31wGzP41JL7F/BKmYLtxx9Syf+9SNabQ9uIonzwAPwoOZQ2PmdToHoGDHST4LijoGc94a9nXQmWyfgeGB5LOHg= ARC-Authentication-Results: i=1; server2.sourceware.org Message-ID: <510a3a52-a046-4e2a-abff-1f97d7db7101@maxrnd.com> Date: Thu, 6 Jun 2024 22:08:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Native posix_spawn() in Cygwin? To: cygwin AT cygwin DOT com References: <00ca6f45-aef6-4d0c-9440-8a00b2de487a AT SystematicSW DOT ab DOT ca> <4ab591dc-6586-4879-94b1-a3c087af1d4f AT maxrnd DOT com> Content-Language: en-US In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mark Geisert via Cygwin Reply-To: Mark Geisert Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On 6/6/2024 4:09 PM, Dan Shelton via Cygwin wrote: > On Wed, 6 Mar 2024 at 01:08, Mark Geisert via Cygwin wrote: >> >> On 3/5/2024 2:42 PM, Dan Shelton via Cygwin wrote: [...] >>> posix_spawn() was added to POSIX so a Win32 implementation can use Win32 spawn() >> >> ...now I see what you're getting at: >> >> If posix_spawn() is intended to launch truly unrelated processes, with >> minimal or no coordination with the launching process, why can't it just >> use Windows' CreateProcess? I assume here that's what Win32 spawn() does. >> Kindly let me interject this first. Could the implementor(s) of Cygwin's posix_spawn() possibly comment on why it ends up doing a fork(), if I understand correctly, rather than doing what Win32 (or even Cygwin's) spawn() does? > > I'm not sure, but I think this would benefit Cygwin greatly to > implement a native posix_spawn(). It should be faster and scale > better. Also the only stuff which do really need fork() are > bash/dash/ksh, and maybe daemon stuff like sshd. I think I remember back in the last century Cygwin's 'make' got some attention because fork()s were judged to be slow during Cygwin's early years. I don't know if the shells got the same attention then or since. Somebody would have to look. > > Re CreateProcess: Maybe CreateProcess() breaks access token or newgrp support? We prefer dealing with detailed bug reports as opposed to speculation :-) That said, Cygwin does implement system(), popen(), and the spawn*() family of functions that all launch subprocesses with CreateProcess() rather than using fork(). Perhaps one of them would work for you? > > Does Cygwin do bounties (paid bug fixes), or Google Summer Of Code? Not that I know of. ..mark -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple