delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2001/05/07/06:16:41

Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-apps-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/lists.html#faqs>
Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com
Date: Mon, 7 May 2001 14:13:57 +0400
From: egor duda <deo AT logos-m DOT ru>
X-Mailer: The Bat! (v1.45) Personal
Reply-To: egor duda <cygwin-apps AT cygwin DOT com>
Organization: deo
X-Priority: 3 (Normal)
Message-ID: <77593264899.20010507141357@logos-m.ru>
To: Corinna Vinschen <cygwin-apps AT cygwin DOT com>
Subject: Re: Forcing SYSTEMROOT (opinions needed)
In-reply-To: <20010507114813.V24200@cygbert.vinschen.de>
References:
<E94FF01DFF6CD31186F4080009DC361501F8C39D AT nttwr2 DOT tower DOT bldgs DOT butlermfg DOT org>
<20010502222849 DOT A1238 AT redhat DOT com> <20010503111926 DOT Y24200 AT cygbert DOT vinschen DOT de>
<20010503133346 DOT A5353 AT redhat DOT com> <147585893249 DOT 20010507121105 AT logos-m DOT ru>
<20010507114813 DOT V24200 AT cygbert DOT vinschen DOT de>
Mime-Version: 1.0

Hi!

Monday, 07 May, 2001 Corinna Vinschen cygwin-apps AT cygwin DOT com wrote:

CV> Shouldn't we add a generalized interface to be able to set or
CV> unset "settings" in an application?

CV>     int cygwin_get (const char *setting, char *value, size_t *size);
CV>     int cygwin_set (const char *setting, const char *value);

CV> The settings could influence for example our current problem.
CV> Adding a CYGWIN option called "[no]addsyspath" which cares for
CV> SYSTEMROOT and SYSTEMDRIVE in the environment, a savvy programmer
CV> could then use the interface like that:

CV>     cygwin_set ("addsyspath", "no");

CV> or similar. The settings should get inherited by child processes.

the question here is "when this new setting should have effect?". if
the answer is "immediately" then i don't know how we can implement
this. some cygwin options (like 'tty') can't be easily switched in the
middle of the game. if the answer is "they should affect process'
children", then savvy programmer already has the means to do what he
(she) wants:
  str = getenv ("CYGWIN");
  add_desired_option_at_the_end_of_string (str, new_str);
  putenv (new_str);

something like this is done in winsup/exceptions.cc to prevent
'error_start'ed program from running recursively. yes, this method is
bit ugly, but, afaik, nobody had a need to do things like this yet.
more to say, such generalized api will make a set of $CYGWIN options
(in some sense) part of the api. we won't be able to change them easily,
if some application is known to call cygwin_set ("addsyspath", "no");

Egor.            mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19


- Raw text -


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