g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013 
<== Date ==> <== Thread ==>

Subject: Mac OS X and environ
From: Stephen Norum <snorum@slac.stanford.edu>
To: tech-talk <tech-talk@aps.anl.gov>
Date: Mon, 23 Feb 2009 09:41:30 -0800

Hello,


I ran into a missing symbol in EPICS base on Mac OS X. Starting in Mac OS X 10.5 (Leopard), shared libraries and bundles don't have direct access to environ (man environ).

Shared libraries and bundles don't have direct access to environ, which is only available to the loader ld(1) when a complete program is being linked. The environment routines can still be used, but if direct access to environ is needed, the _NSGetEnviron() routine, defined in <crt_externs.h>, can be used to retrieve the address of environ at runtime.

http://developer.apple.com/documentation/Darwin/Reference/Manpages/man7/environ.7.html



I copied libCom's osdEnv.c to base/src/libCom/osi/os/Darwin and added the following:


/* Starting in Mac OS X 10.5 (Leopard), shared libraries and
 * bundles don't have direct access to environ (man environ).
 *
 * Define environ as (*_NSGetEnviron())
 */
#include <crt_externs.h>
#define environ (*_NSGetEnviron())


Everything seems to work fine with this change and it has been committed to the trunk and R3-14-2_branch by Eric Norum.




Stephen


Navigate by Date:
Prev: Re: Asyn driver access to PV fields. tieman
Next: Dynamic Listing of PVs Bruno Coudoin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013 
Navigate by Thread:
Prev: Re: Asyn driver access to PV fields. Dirk Zimoch
Next: Dynamic Listing of PVs Bruno Coudoin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·