Wednesday, March 8, 2017

Difference between fork() and exec() system calls

fork():

It creates a copy of running process. 
The running process is called parent process & newly created process is called child process.

  • fork() returns the process identifier (pid) of the child process in the parent, and
  • fork() returns 0 in the child.
exec():

It initiates a new process within a process. It loads a new program into the current process, replacing the existing one.

1 comment:

  1. Nice Blog, When i was read this blog i learnt new things & its truly have well stuff related to developing technology, Thank you for sharing this blog.
    Microsoft Azure Training in Chennai | Azure Training in Chennai

    ReplyDelete