From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68867 invoked by alias); 17 Nov 2016 13:30:42 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 68829 invoked by uid 89); 17 Nov 2016 13:30:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1366, environ, highly X-HELO: mail-ua0-f180.google.com Received: from mail-ua0-f180.google.com (HELO mail-ua0-f180.google.com) (209.85.217.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Nov 2016 13:30:27 +0000 Received: by mail-ua0-f180.google.com with SMTP id 51so142234855uai.1 for ; Thu, 17 Nov 2016 05:30:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Y7t87Xi7gn90ymkBxkjhbWJXVxypC6GloiwyQZamJ+8=; b=lEK2egje2yuHEWTGie0dqFj8jA9w0BAYjgXPrA6Y+C5Z+4JCJ5qWcnKP3Xyggz1HkF 6TJZ8yydXWsqzZBFsAT/QsLqnpJE/Cw7OZ3doktIcP3htAIN2ocwAEGXky2dI6OzKR0g Rk/VVLAvgne5vAHJE5B6S8DXwRu1flGQjOwVKwvjh4XXXXnjnCchXG4yHdtO9gGPtxqK 9TqZKsjPQ7dsY9hEm4clJ8DxNXbO+9kRUWcl/BMKx6T2ZW2m61T1GhfQ2giYtf2zdRZY wL3aT6PmnqBB2Ph8ZqClWTaJ1zPWuj6TvLXMP5GpVMZEIDHqePCe7hUib0aO/IgRvWNg U1lw== X-Gm-Message-State: ABUngvf+8ztkETgZVO7OTc91mfHSy4rUn2YXtIqgvekx+nbsOhyEuUZnENdYbg1+qcDIU77b2e/YU8rLaTq06Q== X-Received: by 10.176.2.110 with SMTP id 101mr1857987uas.8.1479389425567; Thu, 17 Nov 2016 05:30:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.80.207 with HTTP; Thu, 17 Nov 2016 05:30:24 -0800 (PST) From: Erik Bray Date: Thu, 17 Nov 2016 18:05:00 -0000 Message-ID: Subject: Retrieving per-process environment block? To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00207.txt.bz2 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//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//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