What is the difference between fork and exec system call?

Đức Lưu

New member
What is the difference between fork and exec system call?
Answer
fork starts a new process which is a copy of the one that calls it, while exec replaces the current process image with another (different) one. Both parent and child processes are executed simultaneously in case of fork() while Control never returns to the original program unless there is an exec() error.
 

Tìm kiếm

Back
Top