What do fork() internally call?

Answer Posted / sasidhar

fork internally calls sys_fork() where sys_fork() calls do_fork().

sys_fork() do the following functions
-> calls do_fork()
-> return PID

do_fork() does the following functions
-> creates a new process
-> Assign a new PCB
-> copies PCB of parent to new PCB with little bit changes in context.
-> return

so if any process calls fork() two number of returns occur and after returning from do_fork() to sys_fork(). sys_fork decides what value to be returned to parent process and child process

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I would like to know whether Simado and Setu products are they EPBX or not ?

1926


What are system calls used for process management in linux?

583


Explain process management system calls in linux?

542


what are different ways the context switch happens from user to kernel space or vice-versa ?

2138