On Wed, Jan 20, 2010 at 1:02 PM, Tyler Littlefield <[email protected]> wrote:

> what purpose does that serve though? the response didn't include exec, but 
> forking and then execing doesn't make much sense when you can just exec. 
> Maybe I'm missing something, but it seems like it'd take up extra resources 
> for no reason.

The exec...() functions will replace the current process image with a
new one... your original program will no longer be running and you
can't return back to it. This is why you would fork first and then run
exec so the child process is running as the new program while your
original is still running also. system() actually does this behind the
scenes, but you have no control over the child process.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to