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: ps questions


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

Attachment: pgpVe1JgRT_bk.pgp
Description: PGP signature


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