[plt-scheme] set environment variables in subprocess
On Wed, Jan 13, 2010 at 4:00 PM, David Brown <plt at davidb.org> wrote:
> On Wed, Jan 13, 2010 at 03:07:59PM -0800, YC wrote:
>
> is there a way to set the environment variables for the subprocess?
>> Looking
>> at http://docs.plt-scheme.org/reference/subprocess.html it was not clear
>> how
>> this can be accomplished.
>>
>
> The 'subprocess' call calls execv on Unix/Linux, so you would have to
> set it in the current process before the subprocess is created, which
> you could do with 'putenv'.
>
Thanks Jay & Dave. setenv & putenv modifies the current process's
environment variable, so it sounds like if you want to spawn multiple
subprocesses in multi-threaded fashion you will have some sort of contention
if you are setting more than one environment variables. The example I am
thinking about is spawning CGI processes, where the headers are written into
the environment variables.
Are there other ways or is my concern moot? Thanks,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100113/52a2bc4e/attachment.html>