Fork() and exec()

20 views
Skip to first unread message

koyelsa...@acropolis.in

unread,
Jan 31, 2021, 1:38:31 PM1/31/21
to noc21-cs4...@nptel.iitm.ac.in
Hi,

I have a question about what is happening in this video at 00:38:28 -

http://www.youtube.com/watch?v=YGe9e9jiK8A#t=2308s.

Sir can you once more explain me what is fork() and exec() does in operating system.

Thanks!



Reference Key - Key('StudentQuestionEntity', 5720873167224832, namespace='ns_noc21_cs44')

Arsh Gautam

unread,
Feb 1, 2021, 2:16:23 AM2/1/21
to Discussion forum for Operating System, koyelsa...@acropolis.in
Hi,
On calling a fork() system call, a new process (which is called the child of the process which called fork()) is made. The child process has everything identical to the parent process except process id.
On calling exec() system call, an executable file is loaded in the process address space and executed. That is, the old contents of process are replaced by new contents present in the executable file which is executed.
Reply all
Reply to author
Forward
0 new messages