This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [ANN] mingw32-egcs native dev toolchain

At 11:46 AM 11/11/97 +0100, Kees van Veen wrote:
>I'm not using mingw32, but b18 with Sergey's patches.
>I have another question though.
>A while ago I posted a message about getenv() not returning the values
>my environment variables when called from a relocatable dll.
>I found out that if I call _getenv() instead of getenv() that problem
>does not
>occur. The same goes for execv(), execvp() and system(), to name a few.
>It seems only the underscore functions export the environment.
>Can anybody explain why this is?
>I now use '#define getenv _getenv' etc to get around this, but is there
>a way
>to force the compiler/linker to do this for me?
>Kees van Veen (

I won't state this definitively but I suspect you are calling the Win32
function directly by using _getenv() as opposed to using the b18 wrapper.
I don't know why the cygwin32 implementation of this function doesn't work 
right.  MS commonly puts an underscore in front of these function names, I 
believe to differentiate the MBCS versions of these function from the 
UNICODE (underscore functions being MBCS).  They then define the original 
function name to the MBCS or UNICODE function appropriately.

I think what you're doing will work although you might miss the cygwin32 
"flavoring" of the environment if what I think your getting with this holds

Larry Hall            
RFK Partners, Inc.              (781) 239-1053
8 Grove Street                  (781) 239-1655 - FAX
Wellesley, MA, 02181

For help on using this list (especially unsubscribing), send a message to
"" with one line of text: "help".

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]