X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=hwbpDqraQko8fpa/ tLHdLH/lumyeOirkYuWD1amqC+1/4mf/FgNYqdD38xRFAsYbMPKGR4IEcFzdBfiR hx+CfwgiHFS1qVgWIpkHiClakLlNQ1mkI5M0vzIaWI++zzD8GORIzNpMbkHUNU1D b6ycA9Ssp0Qz36vlDOg6vo3pX6Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=XfhygK579vxtrjnIdjJPlT DYxCY=; b=uKm/ir9QIE10ZkK4Fg5yu6v/HZjT5ju+HTtQBrIgbxlhwvRU/TT5TI 8WHHn4ft3qzlJEiNfhEySJIJoERgxJ7dYACW/d/j+Jf6T6nm/rXaWDyJkbObSqrW C0j/1QV/IYMZmPwygbh6YgjQfq2oHJ/4CzSxsplTFS4BtmxCVISxU= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=informed X-HELO: atfriesa01.ssi-schaefer.com Subject: Re: [ANNOUNCEMENT] TEST: Cygwin 3.0.0-0.7 To: cygwin AT cygwin DOT com References: <02da4eeb-fcce-b1bc-e6eb-68ff3ec0cf74 AT ssi-schaefer DOT com> <20190207182735 DOT GG13951 AT calimero DOT vinschen DOT de> <8a2f041f-f8f7-6e17-5d97-5a168440009b AT ssi-schaefer DOT com> <20190208113158 DOT GH13951 AT calimero DOT vinschen DOT de> <17e339bb-2115-bf22-7291-04215aab3150 AT ssi-schaefer DOT com> <20190208122126 DOT GM13951 AT calimero DOT vinschen DOT de> <20190208122338 DOT GN13951 AT calimero DOT vinschen DOT de> <20190208130635 DOT GO13951 AT calimero DOT vinschen DOT de> <20190208132807 DOT GP13951 AT calimero DOT vinschen DOT de> From: Michael Haubenwallner Message-ID: <6b182191-b235-fcbb-5b25-66243950043c@ssi-schaefer.com> Date: Fri, 8 Feb 2019 15:43:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190208132807.GP13951@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 2/8/19 2:28 PM, Corinna Vinschen wrote: > On Feb 8 14:06, Corinna Vinschen wrote: >> On Feb 8 13:52, Michael Haubenwallner wrote: >>> On 2/8/19 1:23 PM, Corinna Vinschen wrote: >>>> On Feb 8 13:21, Corinna Vinschen wrote: >>>>> On Feb 8 12:51, Michael Haubenwallner wrote: >>>>>> >>>>>> For now it seems like there's an inconsistency with PIDs: >>>>>> A first process PID 100, receives PID 101 from spawn(), >>>>>> but in the new process getpid() returns 102: >>>>>> >>>>>> $ ./dospawn /bin/bash -c 'echo $$' >>>>>> 12625 >>>>>> waitpid: pid 12624 status 0x0 >>>>> >>>>> Oh, hmm. If you call spawnve, rather than execve, a new child pid >>>>> is generated in spawnve, rather than just keeping the callers pid. >>>>> >>>>> However, apparently the child invents its own pid in pinfo::thisproc >>>>> after being spawned. But actually this should only occur for forked >>>>> processes aore processes started from non-Cygwin parents. >>>> >>>> Does that help, by any chance: >>>> [nope] >>> >>> How should the child be informed at all about the new cygpid value generated in >>> parent's child_info_spawn::worker() ? >> >> I just realized this myself. The old method creating Cygwin pids just >> fetched the pid from GetCurrentProcessId(), which was right for spawned >> (but not execed) processes. For the new pid we might have to give this >> to the child via child_info_spawn. > > This works for me, can you test this, too, please? Looks good to me as well, I'm going to start my hours running use case now. > > I pushed your forkable branch to master, btw. Would you mind to do the > honors in the ;rease notes at cygwin/release/3.0 and doc/new-features.xml? Ok, just preparing the tests first. Thanks a lot! /haubi/ -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple