What is the difference between fork() and vfork() ? Does vfork() return like fork()
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The intent of
vforkwas to eliminate the overhead of copying the whole process image if you only want to do anexec*in the child. Becauseexec*replaces the whole image of the child process, there is no point in copying the image of the parent.For other kinds of uses,
vforkis dangerous and unpredictable.With most current kernels, however, including Linux, the primary benefit of
vforkhas disappeared because of the wayforkis implemented. Rather than copying the whole image whenforkis executed, copy-on-write techniques are used.