fork, clone and vfork

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  
Hi all
LKD (Robert Love) says that fork is implemented via clone()
system call. But in linux kernel 2.6, there are 3 sys_calls
sys_fork, sys_clone and sys_vfork (file: arch/i386/kernel/process.c)
(line 570 onwards)
http://lxr.linux.no/source/arch/i386/kernel/process.c?v=2.6.5

doesn't fork uses sys_fork directly instead of clone.
Also there is comment above sys_vfork which suggest the sys_call
is because of register pressure and some stuff related to call-clobbered registers.
I have pasted the comment here:
/*
 * This is trivial, and on the face of it looks like it
 * could equally well be done in user mode.
 *
 * Not so, for quite unobvious reasons - register pressure.
 * In user mode vfork() cannot have a stack frame, and if
 * done by calling the "clone()" system call directly, you
 * do not have enough call-clobbered registers to hold all
 * the information you need.
 */
Please help me understand what exactly is register pressure and 
what are call-clobbered registers.

TIA
sanjayk


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux