Practice mode Operating Systems

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

Explanation

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.