delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/04/16:29:43

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 4 Aug 2005 16:29:33 -0400 (EDT)
From: Jason Pyeron <jpyeron AT pdinc DOT us>
X-X-Sender: jpyeron AT ns DOT pyerotechnics DOT com
To: cygwin AT cygwin DOT com
Subject: Re: pid confusion and pstree
In-Reply-To: <Pine.GSO.4.61.0508041617420.3695@slinky.cs.nyu.edu>
Message-ID: <Pine.LNX.4.62.0508041626100.25913@ns.pyerotechnics.com>
References: <Pine DOT LNX DOT 4 DOT 62 DOT 0508041520500 DOT 25913 AT ns DOT pyerotechnics DOT com> <Pine DOT GSO DOT 4 DOT 61 DOT 0508041531470 DOT 3695 AT slinky DOT cs DOT nyu DOT edu> <Pine DOT LNX DOT 4 DOT 62 DOT 0508041538440 DOT 25913 AT ns DOT pyerotechnics DOT com> <Pine DOT GSO DOT 4 DOT 61 DOT 0508041617420 DOT 3695 AT slinky DOT cs DOT nyu DOT edu>
MIME-Version: 1.0
X-IsSubscribed: yes

On Thu, 4 Aug 2005, Igor Pechtchanski wrote:

> On Thu, 4 Aug 2005, Jason Pyeron wrote:
>
>> On Thu, 4 Aug 2005, Igor Pechtchanski wrote:
>>
>>> On Thu, 4 Aug 2005, Jason Pyeron wrote:
>>>
>>>> sorry if this wraps.
>>>>
>>>> what is my WINPID for the current bash?
>>>>
>>>> [jpyeron AT mrlaptop mysql-4.1.13.new]$ ps -W | head -1 && ps -W | grep bash && pstree -Ahup
>>>>       PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
>>>> I    2356       1    2356       2356  con 1003   Jul 31 /usr/bin/bash
>>>>       260       0       0        260    ?    0   Aug  3 C:\cygwin\bin\bash.exe
>>>>       484       0       0        484    ?    0   Aug  3 C:\cygwin\bin\bash.exe
>>>>      3004       0       0       3004    ?    0   Aug  3 C:\cygwin\bin\bash.exe
>>>>       456       0       0        456    ?    0   Aug  3 C:\cygwin\bin\bash.exe
>>>
>>> "ps -W" may not be aware of the Cygwin PID for some processes.
>>> How about "/bin/ps | head -1 && /bin/ps -a | grep $$" instead?
>
> Yes, the Cygwin PID and the WINPID are different in most cases.  Doesn't
> the command I suggested show the right WINPID for the current bash?

if there is a -aW then no, -a yes

hmmm? why are there zeros on the PGID, and why when using -W does PID 
change to WINPID? BUG?

[jpyeron AT mrlaptop mysql-4.1.13.new]$ ps |  head -1
       PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
[jpyeron AT mrlaptop mysql-4.1.13.new]$ ps -a | grep 1592
      1592     228    1592        456    3 1003   Aug  3 /usr/bin/bash
S    2872    1592    2872       3124    3 1003 14:58:27 /usr/bin/pico
      2464    1592    3316       2464    3 1003 16:27:32 /usr/bin/bash
      3316    1592    3316       2472    3 1003 16:27:32 /usr/bin/ps
[jpyeron AT mrlaptop mysql-4.1.13.new]$ ps -W | grep 456
       456       0       0        456    ?    0   Aug  3 C:\cygwin\bin\bash.exe
[jpyeron AT mrlaptop mysql-4.1.13.new]$ ps -aW | grep 456
       456       0       0        456    ?    0   Aug  3 C:\cygwin\bin\bash.exe
[jpyeron AT mrlaptop mysql-4.1.13.new]$


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Partner & Sr. Manager             7 West 24th Street #100     -
- +1 (443) 921-0381                 Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019