avoid some overlong lines from posix urls, etc.
[gnulib.git] / doc / posix-functions / environ.texi
1 @node environ
2 @section @code{environ}
3 @findex environ
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/environ.html}
6
7 Gnulib module: environ
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 POSIX does not require this variable to be declared, and it is indeed not
13 declared on some platforms:
14 MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, IRIX 6.5, Solaris 10.
15 @item
16 On MacOS X 10, this variable is not declared.  Up to MacOS X 10.4, one can use
17 @smallexample
18 extern char **environ;
19 @end smallexample
20 to get the variable declared.  This does not work any more, however, in
21 shared libraries on MacOS X 10.5.  Here is a workaround: Instead, one can use
22 @smallexample
23 #include <crt_externs.h>
24 #define environ (*_NSGetEnviron())
25 @end smallexample
26 This works at all versions of MacOS X.
27 @end itemize
28
29 Portability problems not fixed by Gnulib:
30 @itemize
31 @item
32 The address of this variable is not a compile-time constant on some platforms:
33 mingw.
34 @end itemize