Re: How do I ex****t a environmental variable to a C program?
by roberson@[EMAIL PROTECTED]
(Walter Roberson)
May 9, 2008 at 05:44 PM
In article
<5eca7cf1-8080-4625-b2c1-383808d530b7@[EMAIL PROTECTED]
>,
iavian <vijay@[EMAIL PROTECTED]
> wrote:
>I want to set a env variable in a C program? . Not through shell env
>variables. Any help?
C does not provide any mechanism to set environment variables.
It is common for OSes to provide a setenv() routine in their libraries.
Note that when OSes do so provide, often setenv() only affects
the environment of the running program and any programs that it
invokes after that point, such as by system() or by OS routines
such as exec*() . Unix-like systems often have *no* mechanism
that would allow a program to change the environment variables of
other programs that are already running.
--
"All is vanity." -- Ecclesiastes