[Top][All Lists]

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

[Gcl-devel] RE: [Axiom-developer] system::getenv does not return MSYS en

From: Page, Bill
Subject: [Gcl-devel] RE: [Axiom-developer] system::getenv does not return MSYS environ ment variables
Date: Tue, 7 Dec 2004 18:23:01 -0500


On Tuesday, December 07, 2004 5:30 PM you replied:
> "Page, Bill" <address@hidden> writes:
>> One of the external lib/cfunc.c routines is copyEnvValue which
>> calls the stdlib routine getenv(). A simple test program shows
>> that this gets both AXIOM and PATH variables properly. But it
>> is apparently no longer used in Axiom. I wonder what GCL is
>> calling of system::getenv?
> This is just a wrapper around the C library getenv.  Does this
> not work on Windows?  Code is in main.c.

Yes I see the code in main.c that implements system::getenv.
I am at a complete loss to explain following since apparently
both copyEnvValue.c in Axiom's lib/cfun-c.c *and* system::getenv
both call getenv from <stdlib>. Are there two different stdlib's??

What is observe is the following::

1) In Windows I go

     Start/Control Panel/System/Advanced/Enviroment Variables

   and I set an environment variable, say

     W1 c:/xxx/yyy

2) Then I start an MSYS shell. I can see the environment variable
   W1 from the shell

     echo $W1

3) Set another environment variable here in MSYS

     export M1=d:/www/zzz
     echo $M1

4) Start GCL (in my case it was AXIOMsys) and interrogate
   the environment variables

   (system::getenv "W1")

   (system::getenv "M1")

   GCL doesn't see the MSYS environment variable.

 5) Write a simple C program that calls getenv directly

    # test.c
    #include <stdlib.h>
    #include <stdio.h>
    main () {

    gcc test.c -o test

    In this case the program sees both environment

 6) Can you guess what happens if we use the same
    environment variable names in both Windows and
    in MSYS?


Bill Page.

reply via email to

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