Re: fork and clone

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

 



Hi,

Mandeep Sandhu <Mandeep_Sandhu@xxxxxxxxxxx> wrote on Wed, 19 Jan 2005 17:50:19 +0530
> fork() system call is implemented via the clone() system call.

I think the description above is NOT always true, becase the
implementation of the system calls may depend on what libc you are
using.

Once I have checked the glibc-2.3.2 source code, and found that:

  ./sysdeps/unix/sysv/linux/ia64/fork.S
  ./sysdeps/unix/sysv/linux/ia64/vfork.S 

those files have implemented fork() and vfork() by using clone(). So I
think the description above is perfectly true as glibc-2.3.2 for the
ia64 architecture.

But as for the i386 or ia32 architecture, I found that fork() was
implemented as a following code, which was generated when 'make':

----------------------------------------
#include <sysdep.h>
PSEUDO (__libc_fork, fork, 0)
 ret
PSEUDO_END(__libc_fork)
weak_alias (__libc_fork, __fork)
weak_alias (__libc_fork, fork)
----------------------------------------

So, as far as glibc-2.3.2 for the i386 architecture, fork() is NOT
implemented via clone() system call.

=---=---=---=---=---=---=---=---=---=---=---=---=---=
Kawabata Koichi                   kkoichi@xxxxxxxxxxx
L'epoche.com: Put all practical interests in brackets
=---=---=---=---=---=---=---=---=---=---=---=---=---=


  


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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