New environment for child process - how?
From: Charles Sullivan (cwsulliv_at_triad.rr.com)
Date: 01/19/04
- Next message: Albert: "Re: Burning Knoppix CD"
- Previous message: Abrigon Gusiq: "Re: what can home user do with clusters ?!?"
- Next in thread: Dave Carrigan: "Re: New environment for child process - how?"
- Reply: Dave Carrigan: "Re: New environment for child process - how?"
- Reply: Robert Newson: "Re: New environment for child process - how?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 19 Jan 2004 08:23:29 GMT
My process needs to spawn multiple child processes, each with a different
environment. As I understand it, I can do the following:
1. Allocate memory and create the new environment array envp[].
2. fork()
3. execve(child_filename, argv, envp)
But here's the question:
I'm passing the new environment pointer to execve(), which doesn't return
(and which may take a long time to finish execution). But somewhere along
the line I have to free the memory I allocated for the new environment
else I'll have a memory leak.
How do I handle this situation?
Thanks for your advice.
Regards,
Charles Sullivan
- Next message: Albert: "Re: Burning Knoppix CD"
- Previous message: Abrigon Gusiq: "Re: what can home user do with clusters ?!?"
- Next in thread: Dave Carrigan: "Re: New environment for child process - how?"
- Reply: Dave Carrigan: "Re: New environment for child process - how?"
- Reply: Robert Newson: "Re: New environment for child process - how?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|