Skip to main content
added 4 characters in body
Source Link
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().

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

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

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().

added 4 characters in body
Source Link
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 PID elseID PID else it returns the 0

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

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 son process PID else it returns the 0

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

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

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

Source Link
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 son process PID else it returns the 0

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