Mail Archives: djgpp-workers/2001/05/28/02:44:50
> From: "Mark E." <snowball3 AT bigfoot DOT com>
> 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.
- Raw text -