What do fork() internally call?
Answers were Sorted based on User's Feedback
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 |
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 is iptabe on redhat linux?
How to give the root permision to users?
What is the Diffrent between Redhat linux And suse linux
what is cups and how to configure?
1.Diff between Active and passive FTP? 2.What is anacron? 3.Diff between yum update and yum install while doing for kernel? 4.root_squash and no_root_squash does what? 5.What are the commands will you execute to find a new hardware? 6.How will you find out a lun allocated from SAN? 7.What is the main diff in CaT5 and CAT6 cable, except the 1/100 and 1/1000? 8.What is stale NFS and How will you fix it? 9.What is kernel panic error? 10.How will you recover password and shadow file, in case both got deleted. Explain the steps? 11.Explain boot process 12.What is network bonding. Explain the steps? 13.What are the exit codes returned by FSCK? 14.What is LDOM? 15.Diff between block and character device?
what are the different ways the Linux can swich from User Space to Kernel Space & vice-versa ?
What will happen when we invoke a system call and say with an example of invoking a system call ?read? for a device?
what are the backup utilites on red hat linux 4.0?
what happens when we do insmod & rmmod in Linux Device Drivers ?
Explain process management system calls in linux?
What is atomic function / atomic variable ?
how to configure http server on red hat linux4.0?