delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/28/04:57:24

X-Spam-Check-By: sourceware.org
Message-ID: <44290879.3EBBD463@dessent.net>
Date: Tue, 28 Mar 2006 01:57:13 -0800
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Problem setenv/putenv for msgget
References: <4428F3FD DOT 6060507 AT bull DOT net> <4428FA02 DOT 9FA236A7 AT dessent DOT net> <442904F2 DOT 30903 AT bull DOT net>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Martine Carannante wrote:

> Does that mean it is impossible to set environment variables once the
> program is started ? In that case; the setenv/putenv are not equivalent
> to UNIX functions.

No, of course you can set environment variables using getenv/putenv. 
They should work just as expected.  But the point is that by the time
your code makes any of these changes to the environment, the Cygwin DLL
has already initialized itself and read the contents of the $CYGWIN
variable so it is too late for any changes to matter.  Of course if you
set the variable and then spawn a child process, it should get the
updated version of the variable, and in that case it would be set in
time to matter.

But to me it seems far easier to just set the variable once at the "top
level" (through the control panel) and then it will be set everywhere,
globally, for all processes, without any further action.  If you do it
any other way you have to worry about setting the value and then passing
it on to a child process.

Brian

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019