One question about fork, vfork and clone
Hi,
I'm a kernel newbie and are reading the source code about process management of kernel-2.11.10
I found it has not only the sys_clone() but also three explict syscalls in the arch/<ARCH>/kernel/process.c
sys_fork(), sys_vfork(), sys_clone()
is this means the library calls no more wrap the sys_clone() for the three library call(fork,vfork,clone), but
call the corresponding syscall? or it never did that?
I've also downloaded the source code of glibc-2.3.5, but I'm not sure where I should I start to figure out this.
Thank you for your reply.
Roy
Quoted 3 lines · Roy Lee
is this means the library calls no more wrap the
sys_clone()for the three librarycall(fork,vfork,clone), but
call the corresponding syscall? or it never did that?
The sys_vfork and sys_fork entry points are there so old libc versions can still work. Some architectures that were added after sys_clone was introduced wrongly copied this code, but new architectures that get added should just provide sys_clone and have the other calls implemented as wrappers in libc.
Arnd <><