This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: problems in Perl process management

Thanks for raising 'ps -W' behavior Chris. It is interesting.

> >From what I gather, the root problem is that for some processes (as
> >demonstrated by my testcase script), the CW_GETPINFO_FULL query returns:
> >1. Invalid PPIDs
> Only PPIDs for cygwin processes are returned.  Everything else should be
> 0.

This isn't happening in my testcase - a Perl script that forks, then
executes `/bin/sleep` with a Perl backtick. Proc::ProcessTable (i.e.
CW_GETPINFO_FULL) returns invalid PPID (0) and PID (the WINPID) for the
child sleep process, but it does returns correct PID and PPID data for the
fork-ed Perl parent processes.

The PID/PPID of the backticked sleep process shows up correctly in 'ps'.

Would this be an issue within CW_GETPINFO_FULL? 

> >2. WINPID instead of Cygwin PID.

> A cygwin pid can actually be spread across two processes.  You see this
> with
> "ps -W" if you do something like:
>   bash -c "exec sleep 20"
> in one window and:
>   ps -W
> in another window.

I tried this but don't see what you mean. Here, in one window, I do:
$  bash -c "exec sleep 20"

In the second window, 'ps -W' only reports the PID & PPID for a single sleep
$ ps  -W | grep sleep
     1012       0       0       1012    ?    0 14:57:51

However, instead of sleep, if I run a windows program like calc.exe in the
background, ps -W reports two processes: Was this what you meant about the
cygwin pid being spread across two processes?

$ calc &
[1] 2380

$ ps -W | grep calc
     2380    3780    2380       3604    0  400 15:18:21
     3604       0       0       3604    ?    0 15:18:22

Sonam Chauhan
Electronic Commerce, Corporate Express Australia Ltd.
Phone: +61-2-9335-0725, Email:

> cgf
> --
> Unsubscribe info:
> Problem reports:
> Documentation:
> FAQ:         

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]