Skip to main content
3 of 3
added 4 characters in body
Nidal
  • 9.1k
  • 11
  • 59
  • 74

The fork() function isn't only to copy the father process, it returns a value which refer that the process is the father or the son process, the image below explain how can you make use of fork() as a father and a son:

enter image description here

as shown when the process is the father fork() returns the son process ID PID else it returns 0

for example you can make use of it if you have a process ( web server ) that receive the requests and on each request it create a son process to process this request, here the father and its sons have different jobs.

SO, no run a copy of a process isn't the exact thing as fork().

Nidal
  • 9.1k
  • 11
  • 59
  • 74