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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=h8Qtwo7D2s4d49a6MfrwVk9KrY43v8kYR39WLPkAJNrF3MVdEWzg/ pennulDrdu8+OQ+Cg2DEGhsvGCYZV1oGZekvsjyL53MmIWrBpjeWhx5AApTARX0Q y8EBoTuXkMEpjRF2oCsC8y3xiH/1I6KNhn1BZfmzKxtUUBwfeGjmeQ= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=xb4+NlVwIdcEk4NR6KEUT24LzX8=; b=LaUBaFrBK3m01UZ7R0f6PU/ihHQ6 crq64OnfE5U2skcWpqoh0T2udwjwKn1BPC998trNnmDu7ZmHV2avJObjA7OV+YUt xUPRHHm+a5wfmy4xzNoZEUlxV7t1ZzaJB8yayxGOmaKDXCWe1slvF51Mccistn6l ZRnPGGbLtyggpNI= 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-Virus-Found: No X-Spam-SWARE-Status: No, score=-101.9 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:Process, died, relationship, H*c:application X-HELO: drew.franken.de Date: Wed, 7 Jun 2017 19:31:53 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: PPID in ps -efW not accurate Message-ID: <20170607173153.GC13513@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aVD9QWMuhilNxW9f" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) --aVD9QWMuhilNxW9f Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 7 13:10, Erik Soderquist wrote: > The information exists in Windows somewhere, but either does not seem > to be available to ps, or is not fetched by ps, and I don't know > enough to know which... >=20 > I tested with both elevated and non-elevated bash sessions, and ps > -efW shows 0 (zero) as the PPID for all Windows processes This is accurate because Windows does not maintain a parent-child relationship between processes. That's why there's no Windows functions to fetch a parent process PID or handle. The only information available is the PID of a process this process inherits handles from. In the POSIX context that's equivalent with a parent process, but not on Windows. Therefore this info is only available in the lower NT API(*). Worse, given the fact that Windows reuses PIDs quickly after a process died, this information can be totally wrong. Corinna (*) NtQueryInformationProcess(ProcessBasicInformation) --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --aVD9QWMuhilNxW9f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZODiJAAoJEPU2Bp2uRE+gRYIP/iNMCrpIPFVB4joT2D6/cDsZ oSW88Z63MTKsEZRZr/lvZvGeUij5wzF5pz/8025ukWNEO5vSY6975RyqglXNf+hf 48h1O54AO6eFvMYc0+XepkN+lYvpadHwHJbTeqShv5SpNgmIPbLYWGUy1SmumgBT uRtYkIItQVcEQqzUOznJLCB3TxNceakTqYfACYgWn4Wx/DqocbCJc8MTOZ0lWi9b sw7WV51i4C1v1vatUy7aw1dlT/JvgTM9T55c51njQ5e7FC6xZ9WIcvbeXiFdajll 2nWo5cbDYNJcZPvM9FUUjwOIlhU/ufzr0RHzWesPs6UbEzX+lIvTY11Yi1Iw/J9x dDcZT3/s+cbgxvs1WDAJX0FRgzEwKNfF7/2f9iiqlIlatr9Q3LVmTxrJVr8nDMyU 5jdwn8xJBDSFyEUHBMlPpDm1+9dm4F/nDYxXKXviv/YeFZWKnNjQx34ry3vPP29K hlOOOzkioEENyupJ1K7DkfVgDAIW56eJ1gI9bEMHH5DevhgrQkIk21gno2GkoDZB 6tiZ1tJU0uQQEIHMC/MIqiP3qIdKipIYTe3W2IJ4fjQii/1wzELXxZk79BHDk0Sl U30NIqCtFvQg/0pxQfpcevJy/gWhQTxtLML3yP8BAXS6cVObfIcN66ta4paGPSeD imw74gs2vpuEGu3XDrm9 =xA/t -----END PGP SIGNATURE----- --aVD9QWMuhilNxW9f--