public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Retrieving per-process environment block?
@ 2016-11-17 18:05 Erik Bray
  2016-11-17 18:11 ` Corinna Vinschen
  0 siblings, 1 reply; 19+ messages in thread
From: Erik Bray @ 2016-11-17 18:05 UTC (permalink / raw)
  To: cygwin

Hi all,

For a quick bit of background, I'm working on porting the highly
useful psutil [1] Python library to Cygwin.  This has proved an
interesting exercise, as much of the functionality of psutil works on
Cygwin through existing POSIX interfaces, and a handful of
Linux-specific interfaces as well.  But there are some bits that
simply don't map at all.

The one I'm struggling with right now is retrieving Cygwin environment
variables for a process (under inspection--i.e. not listing a
process's environment from within that process which is obviously
trivial).

I've looked at every route I could conceive of but as far as I can
tell this is currently impossible.  That's fine for now--I simply
disable that functionality in psutil.  But it is unfortunate, though,
since the information is there.

There are a couple avenues I could see to this.  The most "obvious"
(to me) being to implement /proc/<pid>/environ.

I would be willing to provide a patch for this if it would be
accepted.  Is there some particular non-obvious hurdle to this that it
hasn't been implemented?  Obviously there are security
implications--the /proc/<pid>/environ should only be readable to the
process's owner, but that is already within Cygwin's capabilities, and
works for other /proc files.

Thanks,
Erik


[1] https://pythonhosted.org/psutil/

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-11-30 12:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-17 18:05 Retrieving per-process environment block? Erik Bray
2016-11-17 18:11 ` Corinna Vinschen
2016-11-29 15:28   ` Erik Bray
2016-11-29 16:01     ` cyg Simple
2016-11-30 11:03       ` Corinna Vinschen
2016-11-29 16:35     ` Eliot Moss
2016-11-29 17:42       ` Erik Bray
2016-11-29 18:02         ` Andrey Repin
2016-11-30  4:28           ` Herbert Stocker
2016-11-30 10:43             ` Eliot Moss
2016-11-30 10:47               ` Peter Rosin
2016-11-30 10:47                 ` Erik Bray
2016-11-30 12:29                 ` Corinna Vinschen
2016-11-30 12:36                   ` Corinna Vinschen
2016-11-30 11:36           ` Corinna Vinschen
2016-11-30 11:06       ` Corinna Vinschen
2016-11-30 10:48     ` Corinna Vinschen
2016-11-30 14:49       ` Erik Bray
2016-11-30 15:04         ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).