What does a successful call to execve() do to the calling process?
Correct answer C. Replaces the process's program image with a new program while keeping the same process ID
execve() loads a new program into the current process, overwriting its text, data, heap and stack, while the PID stays the same. Because the old program is gone, a successful execve() never returns. Creating a child is fork()'s job, and waiting is done with wait(). The usual UNIX pattern is fork() followed by exec in the child.
Answer checked How we write and check questions
Discussion