NOTES: since glibc 2.3.3, the glibc NPTL fork() wrapper bypasses the

fork() system call to invoke clone() with appropriate flags.
This commit is contained in:
Michael Kerrisk 2008-04-22 04:18:32 +00:00
parent 14f5ae6dc8
commit 429e98671d
1 changed files with 17 additions and 1 deletions

View File

@ -36,7 +36,7 @@
.\" Greatly expanded, to describe all attributes that differ
.\" parent and child.
.\"
.TH FORK 2 2008-01-13 "Linux" "Linux Programmer's Manual"
.TH FORK 2 2008-04-22 "Linux" "Linux Programmer's Manual"
.SH NAME
fork \- create a child process
.SH SYNOPSIS
@ -191,6 +191,22 @@ Under Linux,
is implemented using copy-on-write pages, so the only penalty that it incurs
is the time and memory required to duplicate the parent's page tables,
and to create a unique task structure for the child.
Since version 2.3.3,
.\" nptl/sysdeps/unix/sysv/linux/fork.c
rather than invoking the kernel's
.BR fork ()
system call,
the glibc
.BR fork ()
wrapper that is provided as part of the
NPTL threading implementation invokes
.BR clone (2)
with flags that provide the same effect as the traditional system call.
The glibc wrapper invokes any fork handlers that have been
have been established using
.BR pthread_atfork (3).
.\" and does some magic to ensure that getpid(2) returns the right value.
.SH EXAMPLE
See
.BR pipe (2)