fork() in libc

Jonathan Neuschäfer j.neuschaefer at gmx.net
Tue Jun 14 13:12:39 EDT 2011


On Tue, Jun 14, 2011 at 05:50:53PM +0530, Venkateswarlu P wrote:
> anyone can send
> implementation of  *fork()* library call  in the library

I don't know exactly where it is, but you could look at
http://repo.or.cz/w/glibc.git.

> i want to know how it is get connected to the system call.

>From the manpage:

    Since version 2.3.3, rather than invoking the kernel's fork()
    system call, the glibc fork() wrapper that is provided as part of
    the NPTL  threading  implementation  invokes clone(2) with flags
    that provide the same effect as the traditional system call. The
    glibc wrapper invokes any fork handlers that have been established
    using pthread_atfork(3).

Thanks,
	Jonathan Neuschäfer



More information about the Kernelnewbies mailing list