bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

environ on MacOS X


From: Bruno Haible
Subject: environ on MacOS X
Date: Sun, 24 Feb 2008 15:30:41 +0100
User-agent: KMail/1.5.4

Hi,

I'm adding a bit of doc about 'environ' on MacOS X. References:
[1] http://wiki.finkproject.org/index.php/Fink:Porting_Notes
[2] http://lists.apple.com/archives/Unix-porting/2005/Sep/msg00062.html
[3] http://lists.apple.com/archives/Java-dev/2007/Dec/msg00096.html
[4] 
http://bob.pythonmac.org/archives/2004/01/02/accessing-environment-information-from-bundlesdylibs-os-x/
[5] http://article.gmane.org/gmane.os.apple.fink.cvs/72951


2008-02-24  Bruno Haible  <address@hidden>

        * doc/posix-functions/environ.texi: Document the MacOS X problem.

*** doc/posix-functions/environ.texi.orig       2008-02-24 15:26:50.000000000 
+0100
--- doc/posix-functions/environ.texi    2008-02-24 15:25:16.000000000 +0100
***************
*** 16,21 ****
--- 16,33 ----
  This variable is missing on some platforms:
  MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, IRIX 6.5, OSF/1 5.1, 
Cygwin.
  @item
+ On MacOS X 10, this variable is not declared.  Up to MacOS X 10.4, one can use
+ @smallexample
+ extern char **environ;
+ @end smallexample
+ to get the variable declared.  This does not work any more, however, in
+ shared libraries on MacOS X 10.5.  Here is a workaround: Instead, one can use
+ @smallexample
+ #include <crt_externs.h>
+ #define environ (*_NSGetEnviron())
+ @end smallexample
+ This works at least on MacOS X 10.3 and newer.
+ @item
  The address of this variable is not a compile-time constant on some platforms:
  mingw.
  @end itemize





reply via email to

[Prev in Thread] Current Thread [Next in Thread]