X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0C923858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1682002717; bh=5cSovQIZhY9eZsX2SKNlnoZzlpC4q9zK1phw1qsncbk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KVA+G6HdA/ZQH8j0fzuaTx5kbvKORtb8ElVEW25iRfXm0rIvTWQmrE2oHr2IzEvPd eBuOTcowHBM1apw51hQt0ABMcqE4vR5kIWpDYN+B8JfkVCV6ZdxEUWW0VRMDGWGhDO zxGal6QMiAMa3V5Uxzdh7/nPMS3/q/icIc9F/ouU= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B2A6C385842D ARC-Seal: i=1; a=rsa-sha256; t=1682002700; cv=none; d=strato.com; s=strato-dkim-0002; b=se5N7m8M6SfZFVHwjThrhqgV2C7gIqZ4+pIRc8TATp1VpNTfUfiifdVMqIIL99AAx+ fBEnWXgMWv7q9FHxY0nRm871/zH/oZ5bQM0C7l492I1t2P6iWHQpEnQcu6XcuriYfAXC zVUlm5i+ehJqXKb1sVVUrOmEcuSa0Rz1d10wRCuHx3mPc3jbiVFC4sdDafNIxSVIq0xM 4B0R/UF26hsBMZyuG3aSlMJaGQy0F2MNF8kTtGal4AbtdHdtE86FLL3lTF3AYeBAfZbo C0dbii+DV/CbNAQDISmyTDoT4WUaqTbZQUHomCX21u8BtJ2L27KvJKBcJmuuuPz0n/yU zF9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1682002700; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=tbD9CybqybhrD+Hop4yUOy5l7xiy1lRnnV2YI5x4gl8=; b=U7D07EMFMopOWHI428xc7WO5lK/UgbtwtWkiaIlrPiPPS8mJdHncd26jLhQe+EYkuI SrVHW/WaIn3Ulmj6OIwc5aE0Ucp6hSxynBTYxKB8ejwnu5eNRxznbeulooWsrmxgMg/m Sl//qL62ylKLAuF6n6ftD+dGndCZy+9mV171AsGOzNwxUbdQYulmjnz2vWKdSJd1DHTI KMJ64owxJF1zVBVYBpglMQtZleQLV7Pjv07QOc/vOnZCUyG8E9NmXVNN6ceMW9sPVQch UIVPJ2cjgKQLvFcCb1BibyfQbw0ofNqyzzQ5welx5GqJRXTp0ogdMkAJMPzuyRmXNCnv kPpg== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPDj/1vgIuvkaOwJLsXaUZx50Vobw==" To: cygwin AT cygwin DOT com Subject: Re: posix_spawn facility Date: Thu, 20 Apr 2023 16:58:20 +0200 Message-ID: <4892432.0VBMTVartN@nimes> In-Reply-To: References: <1752276 DOT 7aRn1RRit1 AT nimes> MIME-Version: 1.0 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, 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.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Bruno Haible via Cygwin Reply-To: Bruno Haible Content-Type: text/plain; charset="utf-8" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 33KEwxIt024451 Corinna Vinschen wrote: > > Hmm. Your code uses lpReserved2 for that, but the functionality is > > one implemented in MSVCRT. For obvious reasons, Cygwin executables > > are not linked against msvcrt.dll and we're using lpReserved2 for our > > own purposes. > > Oh, btw., did you know that there's a newer mechanism for defining > specific inheritable handles to CreateProcess, which is implemented > in kernel32.dll, so it does not depend on MSVCRT? > > There's a STARTUPINFOEX structure which allows to specify the > additional handles. See > > https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-startupinfoexa > > and the PROC_THREAD_ATTRIBUTE_HANDLE_LIST argument described in > > https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthreadattribute Indeed, this appears to be a more "official" way to pass handles for fd ≥ 3, instead of lpReserved2 — albeit without associated 'flags'. Not sure how O_APPEND is handled then... (Note: O_APPEND behaviour is tested by gnulib/tests/test-posix_spawn-open2.c.) I had seen this doc page, but thought it was irrelevant because the title is about "thread attributes", not "process attributes"... Bruno -- 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