A question about the environment variable

A question about the environment variable

Post by Carlos Bouson » Wed, 10 Apr 2002 16:59:32



Hi everyone,

I'd like to know how does the shell allocate the environment variable. I'm
quite sure it allocates memory dynamically, but if such is the case, I'd
like to know how exactly does it do it. Does it use malloc, or some other
internal allocator?

The reason for my question is that I read in the man page of malloc that
"Recent  versions of Linux libc (later than 5.4.23) and GNU libc (2.x)
include a malloc implementation which  is  tun-able  via  environment
variables." If that is the case, isn't there some kind of a loop? I mean, it
seems that malloc cannot exist without environment variables, and
environment variables cannot exist without malloc. How is this actually
solved?

Thanks,

Carlos B.

 
 
 

A question about the environment variable

Post by ken_yap_2272cbb4_.. » Wed, 10 Apr 2002 17:46:47


|The reason for my question is that I read in the man page of malloc that
|"Recent  versions of Linux libc (later than 5.4.23) and GNU libc (2.x)
|include a malloc implementation which  is  tun-able  via  environment
|variables." If that is the case, isn't there some kind of a loop? I mean, it
|seems that malloc cannot exist without environment variables, and
|environment variables cannot exist without malloc. How is this actually
|solved?

Where's the loop? If you don't set any of the controling environment
variables, malloc will probably do something reasonable by default. Just
because the environment variable isn't set doesn't mean malloc can't
run.

 
 
 

1. Why does the cgi environment not inherit environment variables?

When using apache it normally inherits the environment in which it was
started and keeps this environment for executing cgi scripts. For example:
if root has oracle environment variables such as ORACLE_SID set when
starting the server then these are normally available to cgi scripts when
they execute much like the path is. However sometimes and specifically this
time they are not. Could someone explain how this works? It seems to be
somewhat random to me. I've had situations where various instances of the
server had different paths than others.

I'm running apache 1.3.4 and apache 1.3.6 on solaris 2.7 with mod_perl 1.18
and 1.19 respectively.

Matt

2. How to tell which version of Solaris?

3. how to export shell environment variables to the primary environment?

4. Weird NIC behaviour under FBSD 3.3-RC

5. c shell script; Howto use environement variables to build environment variables and take their value

6. GLUT

7. Difference between shell variables and environment variables!

8. tkperl?

9. difference between shell variable and environment variable

10. How to get value of environment variable in variable name?

11. Question: Setting Environment Variables in C

12. Environment Variable Question

13. ksh environment variable question