mirror of https://github.com/mkerrisk/man-pages
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:
parent
14f5ae6dc8
commit
429e98671d
18
man2/fork.2
18
man2/fork.2
|
@ -36,7 +36,7 @@
|
||||||
.\" Greatly expanded, to describe all attributes that differ
|
.\" Greatly expanded, to describe all attributes that differ
|
||||||
.\" parent and child.
|
.\" 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
|
.SH NAME
|
||||||
fork \- create a child process
|
fork \- create a child process
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -191,6 +191,22 @@ Under Linux,
|
||||||
is implemented using copy-on-write pages, so the only penalty that it incurs
|
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,
|
is the time and memory required to duplicate the parent's page tables,
|
||||||
and to create a unique task structure for the child.
|
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
|
.SH EXAMPLE
|
||||||
See
|
See
|
||||||
.BR pipe (2)
|
.BR pipe (2)
|
||||||
|
|
Loading…
Reference in New Issue