What do fork() internally call?

Answers were Sorted based on User's Feedback



What do fork() internally call?..

Answer / 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

What do fork() internally call?..

Answer / bhushan bachhav

Linux implements fork() via the clone() system call.
The clone() system call, in turn, calls do_fork().
The bulk of the work in forking is handled by do_fork(),
which is defined in kernel/fork.c.This function calls
copy_process() and then starts the process running.
If copy_process() returns successfully, the new child is
woken up and run. Deliberately, the kernel runs the child
process first.

Is This Answer Correct ?    4 Yes 3 No

What do fork() internally call?..

Answer / vikash

It calls clone function

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Linux System Calls Interview Questions

What do fork() internally call?

3 Answers  


what are the backup utilites on red hat linux 4.0?

4 Answers   Wipro,


how to configure ftp server on redhat linux?

9 Answers   Infosys,


What is atomic function / atomic variable ?

1 Answers   Broadcom,


Port number is already in use .. how to fix for apache..?

1 Answers   Google,






What are the signals we have in Linux

3 Answers   HCL, NetApp,


what is sudo on linux?

3 Answers   IBM,


what is the difference between user APIs and kernel system calls ?

1 Answers   NetApp,


What are system calls used for process management in linux?

0 Answers  


what is nis server

13 Answers  


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

0 Answers   IBM,


what is stored in /proc ? what is significance of /proc in linux ?

3 Answers   NetApp,


Categories