Proper way to access executable's "environment"?
Erich Dollansky
erichsfreebsdlist at alogt.com
Sun May 26 22:43:24 UTC 2013
Hi,
On Sun, 26 May 2013 10:20:15 -0700
David Wolfskill <david at catwhisker.org> wrote:
> So I started looking at code that I had reason to expect would do this
> correctly -- src/usr.bin/env/env.c, for starters -- and saw that while
> piewm's twm.c declares main as:
>
> int
> main(int argc, char **argv, char **environ)
> {
I use this concept since decades but with different names. Could it be
a problem of overlapping names?
> ...
>
> and proceeds to use environ as a pointer to a NULL-terminated list
> of strings, env.c declares:
>
> extern char **environ;
The advantage would be - and also the disadvantage - that every piece
of the code could have access to the environment.
That's why I moved away from it.
Erich
More information about the freebsd-ports
mailing list