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 are system calls used for process management in linux?

0 Answers  


What is atomic function / atomic variable ?

1 Answers   Broadcom,


What does exec family return?

1 Answers  


What is the use of proc structure?

2 Answers   NetApp,


what kind of information the linux driver modules (.ko ) files has ?

2 Answers   NetApp,






diff b/w spinlock, seamaphores and mutex and where to use it.

2 Answers   Intel,


1. Where the History file can be located? 2. How will you harden the server? 3. Diff between Raid 1 and Raid 5? 4. What is the largest disk size can be used in LVM? 5. How will you remove a PV from lvm without any data loss? 6. What is the diff between ext3 and ext2 File system? 7. How we can use resize2fs, what is the purpose? 8. What is the purpose of LVM? Why it is used? 9. If the FS is in read-only mode, so we cannot create any file. How will you fix it? 10. How to create swap partition after OS installation? 11. What is the diff between ssh and telnet? 12. How to find out the dependency required for a package?

3 Answers   IBM,


how to configure sendmail server on red hat linux version 4 and what and all we Require?

3 Answers   Wipro,


what is bus trap.

1 Answers   NetApp,


what is nis server

13 Answers  


what is the diff b/w MUTEX and semaphore?

12 Answers   Sony, TCS,


why the kernel panic error was appering?

13 Answers   Air2Web, Allianz,


Categories