ps command - revisited

Alan Dobkin Alan@ADobkin.Net
Tue Apr 9 21:03:00 GMT 2002


--On Tuesday, April 09, 2002 11:08 PM -0400 Christopher Faylor
<cgf@redhat.com> wrote:

> As with so many other things in Cygwin, what you see is what 
> you get from the underlying Windows API that we're using.  If 
> certain processes aren't showing up when we say "give me all 
> of your processes", then they aren't being displayed.

Well, I just did a few tests, and the results may shed some light 
on the problem, which seems to be specific to Cygwin, not the API.  
I ran ps -W on several Windows 2000 systems, including one with a 
clean install of the OS and Cygwin from this week.  In every case, 
the CSRSS.EXE process is excluded when ps is run on the local box, 
either in a bash cmd shell or rxvt.  However, when using SSH, even 
to localhost, the CSRSS.EXE process magically re-appears.  Also, 
using every one of the other ps-type utilities (i.e. TLIST, PULIST, 
PsList, Task Manager, etc.), this process is displayed at all times.

So why would Cygwin be excluding this process on the local machine?  
Whatever the answer is may be the same reason to why the original 
poster's process wasn't being displayed either, and I wonder if 
their process would be displayed if they tried the ps -W via SSH.

> The exception is PID 0.  The zero pid is special to cygwin so it 
> can't be displayed due to a cygwin limitation.

A simple solution to this might be to have ps -W prepend PID 0 to 
its output as a placeholder so the listing is complete.  Similarly, 
the System process should be identified as such instead of unknown.

> The functionality you see now is all that I plan on providing.
> 
> Patches are, as always, gratefully accepted, however.

I don't intend to submit a patch for this either, at least not any 
time soon, but I would be happy to provide information and testing 
for someone else who is willing and able to work on it.

Alan

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list