summaryrefslogtreecommitdiff
path: root/man2/fork.2
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2008-04-22 04:18:32 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2008-04-22 04:18:32 +0000
commit429e98671d47c377ff337cc10596708175d76d47 (patch)
treef911668fdf7e0beae07f97d22a70525309b559bf /man2/fork.2
parent14f5ae6dc873e6d47fa01997e37b35a87f9d1452 (diff)
NOTES: since glibc 2.3.3, the glibc NPTL fork() wrapper bypasses the
fork() system call to invoke clone() with appropriate flags.
Diffstat (limited to 'man2/fork.2')
-rw-r--r--man2/fork.218
1 files changed, 17 insertions, 1 deletions
diff --git a/man2/fork.2 b/man2/fork.2
index 2d768558..308e60e6 100644
--- a/man2/fork.2
+++ b/man2/fork.2
@@ -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)