ps questions

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Dec 18 18:34:00 GMT 2014


On Dec 18 18:56, BGINFO4X wrote:
> 2014-12-18 18:11 GMT+01:00 Corinna Vinschen <...>
> > The <defunct> information is fetched from the process itself.  This
> > requires a living, valid Cygwin process, so the info isn't available for
> > Windows processes.
> >
> 
> Hello again, forgive me if this is stupid:
> 
> If any cygwin process has the values
> cwd=/proc/$PID
> root=/
> 
> Instead of fetching the information, you can "hardcode" the values. Isn't it?

And how much sense does it make?

The root value is most of the time ok, unless a process runs under
chroot.

The cwd value on the other hand...  /proc is a virtual, Cygwin-only
directory and isn't a valid CWD for a non-Cygwin process.
And you can't call the OS for the CWD of another process.  On Windows,
the CWD is a process-local concept, not supported by the kernel.
Fetching the CWD of a process requires read access to the VM of a
process and a bit of undocumented NT magic.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141218/d35dfdd9/attachment.sig>


More information about the Cygwin mailing list