X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; q=dns; s=default; b=htufdGu
	/YkQOpNu0/ju7ElfqrH67X1S1ZnWkHTKNJ6M2NYXqjs+R33YpbZuLGn0TYy3RydG
	BtZmQLMbxvRxzBIn0k3UXO6qq04rn47wIN3GKfp7NkoIvYqvLsWFhoH4CGOlQDpv
	nzybkA98ZG10QihAxca+PCQg3ciAXcj8omiM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; s=default; bh=gkRlwiXTUkO6f
	ev/qPGN0k43raM=; b=b9YmUKJbg0YlzpunrfppUY+qGxKC6y5ezb5zqm4k7gnUD
	hEpvaVt636KsoHY7RyZsihGUYGNOr/MvkXGo7O//ZxCnhlqD7RPI0+KMFUscjzhq
	dLaRp9dG+KN5d9XgJrUB/5wla6bWDtt6B2kq0Ui+kv8bHOrC7HaFukoGQlCs4U=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:peda@ly, D*liu.se, sk:pedaly, cook
X-HELO: mail-wj0-f172.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20130820;        h=x-gm-message-state:mime-version:in-reply-to:references:from:date         :message-id:subject:to;        bh=BbgFyVv6nfjPmA1EZ9z4Saiqiat8v3Og26U1HO4J2bg=;        b=fe50SPexnhB23QAe3lCeJ1mGmxcESqKJ4JhydhgBIxmXKa/YXjbNtW2naqXD51pthm         K8CSU42P+q6Na7J72c/900BUKrYmPjyCIXqzYNePnVy/ImgOg/ePglZJtUkwB0mrsRpD         awE45nesP1NYbSPU3PRsaqASVLzbT3sac6Zn0E69zTmA9Q4uWbFbPRN0J7URrzeyXu3I         CXzjVqauhbUhdS5LiTedeyvHHOQfURhcFR9EIhJa29ojOADV4vznMPF23Gt3BVpSXL0I         c15D4GSNFTSXZhR9rGP71Yvqtnj/Bhqdq1P/UaUFKGUnHoMbSyydJEfzKTy//1CiBZcE         T5Og==
X-Gm-Message-State: AKaTC00if9nTP/9Ioaalh+1X1zr+bgHkBa2BarNhwDrougrP4hK1QiyQNSL2GRcwaA0i9L1KJ2BV965NTxGo1g==
X-Received: by 10.194.117.134 with SMTP id ke6mr27032546wjb.123.1480500551341; Wed, 30 Nov 2016 02:09:11 -0800 (PST)
MIME-Version: 1.0
In-Reply-To: <237e4e33-4b51-a124-4108-d67e715dcbf0@lysator.liu.se>
References: <CAOTD34ZFH5E3r3AuDOXctss46e1hoU2f9pwE1mt4L674J2Ak_A@mail.gmail.com> <20161117140012.GA23664@calimero.vinschen.de> <CAOTD34Y9TRq2Qq8Mn2awTf9SCgz0qnbBa-a117pkSEvz9gaHKQ@mail.gmail.com> <98eb08bf-5012-fe14-b10c-241b427c4366@cs.umass.edu> <CAOTD34bPTUkKiHSmqvczz6juePBD=6PyzabDFfHpYL_cFzyf9A@mail.gmail.com> <2925977.20161129192741@yandex.ru> <583E1D4A.4020703@gmx.de> <111bc961-5f69-8e27-f78a-2b82f351d811@cs.umass.edu> <237e4e33-4b51-a124-4108-d67e715dcbf0@lysator.liu.se>
From: Erik Bray <erik.m.bray@gmail.com>
Date: Wed, 30 Nov 2016 11:09:10 +0100
Message-ID: <CAOTD34YjUOtRD7i9Kcv2xi7W93yVv=c=90Pzydya7DtD5O2W0g@mail.gmail.com>
Subject: Re: Retrieving per-process environment block?
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes

On Wed, Nov 30, 2016 at 10:15 AM, Peter Rosin <peda@lysator.liu.se> wrote:
> On 2016-11-30 04:00, Eliot Moss wrote:
>> On 11/29/2016 7:28 PM, Herbert Stocker wrote:
>>
>>> Or we simply copy the variables unconverted to the Windows environment
>>> block, as the Windows env block is not used for anything else - up to
>>> now it is not updated at all.
>>
>> Maybe we could stash them inside one large variable?  Would that help
>> at all?  (It does demand a quoting convention, but since this is all
>> internal stuff, that may not be too hard.)
>
> I believe this is a dead end. The Windows environment block has an
> unacceptable size limit which is circumvented by the internal Cygwin
> handling. Since this is about exposing said Cygwin environment, it
> would simply not work for big environments.

I agree--although I can't off the top of my head recall where I've
read this, I believe there's a deliberate effort in Cygwin to keep the
Windows environment to the bare minimum for Cygwin processes.  Among
other things I imagine it keeps the number of conversions necessary to
a minimum.

And in any case, trying to cache the entire Cygwin environment back
into the Windows environment would be even more overhead than what I'm
proposing which is to store it in shared memory.  My goal is not to
make the Cygwin environment of a process readable from outside
Cygwin--only make it so it can be read from other Cygwin processes by
way of /proc (given the necessary permissions).

Perhaps I'll go ahead and cook up a patch and see what impact it has.
With luck it won't be much--I just don't know how much overhead there
is in open_shared.

Thanks,
Erik

--
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

