Date: Mon, 28 May 2001 09:44:29 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Mark E." Message-Id: <2110-Mon28May2001094428+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp-workers AT delorie DOT com In-reply-to: <3B11464B.31331.D7FED@localhost> (snowball3@bigfoot.com) Subject: Re: confstr implementation References: <3B11464B DOT 31331 DOT D7FED AT localhost> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Mark E." > Date: Sun, 27 May 2001 18:24:11 -0400 > > I've implemented confstr and wrote some docs for it. This will enable us to > implement and provide our own getconf. Thanks, I think this would be a useful addition. > case _CS_PATH: > { > char *djdir = getenv("DJDIR"); > if (djdir) > out_len = snprintf(buf, len, "%s/bin", djdir); I wonder: is this in the spirit of what Posix says? What if DJDIR is changed during the program's run? Posix seems to indicate that _CS_PATH should return the original value that is unaffected by user-level changes. So perhaps we need something in the startup code which will stash away the value of DJDIR as seen by the startup code. > path_len = confstr (_PC_PATH, NULL, 0); > path = malloc(path_len); > confstr(_PC_PATH, path, path_len); These should use _CS_PATH, not _PC_PATH. Btw, shouldn't we introduce into the system headers some new preprocessing symbols which distinguish between the old Posix standard and the new one? The new Posix functions are not standardized according to the old version of Posix, so, e.g. `symlink' is in a non-Posix part of unistd.h, but it _is_ standardized by the new Posix. There are many such functions in unistd.h and elsewhere, including confstr (when it is added), and I wonder what should we do with this issue.