Co-Authored By:

Asked by: Candelaria Giraldos
technology and computing operating systemsWhat is the use of exec system call?
Furthermore, what is the function of exec system call?
In computing, exec is a functionality ofanoperating system that runs an executable file in thecontextof an already existing process, replacing the previousexecutable.This act is also referred to as an overlay. It isespeciallyimportant in Unix-like systems, although other operatingsystemsimplement it as well.
Also to know, what is the use of fork and exec system calls in OS?
fork starts a new process which is a copy oftheone that calls it, while exec replaces thecurrentprocess image with another (different) one. Both parent andchildprocesses are executed simultaneously in case offork()while Control never returns to the original programunless there isan exec() error.
The exec system call is used to execute afilewhich is residing in an active process. When exec iscalledthe previous executable file is replaced and new file isexecuted.More precisely, we can say that using exec systemcall willreplace the old file or program from the process witha new file orprogram.