aboutsummaryrefslogtreecommitdiffstats
path: root/man2/clone.2
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-03-17 17:08:01 +0100
committerAlejandro Colomar <alx@kernel.org>2023-03-30 15:14:55 +0200
commit4131356cdab8d37fc395ca5466a0401c8573380c (patch)
tree8c4c6f1c3172358b735b481cbbfdd9cc04b00ed9 /man2/clone.2
parentfd00f831b52d61a91d59cb3b46182869145d9700 (diff)
downloadman-pages-4131356cdab8.tar.gz
man*/, man-pages.7: VERSIONS, STANDARDS, HISTORY: Reorganize sections
- Add a new HISTORY section that covers the history of an API, both regarding implementations and regarding old standards. This was previously covered in VERSIONS, and in some cases in STANDARDS. - Repurpose VERSIONS to cover differing implementations in _current_ systems. - STANDARDS is reduced to only cover current versions of standards. That basically means only C11 (C99 has been superseeded by C11; C17 is just a bugfix of C11, so not really a new version), and POSIX.1-2008 (*-2001 was superseeded by *-2008; *-2017 was just a bugfix for *-2008). The section also mentions for example 'Linux', 'GNU' or 'BSD' when a non-standard API is Linux- or GNU-only or if it's (de-facto) standard in the BSDs. - In some cases content that should go into one of these sections was in NOTES. Move it from there to where it corresponds. - In the SYNOPSIS, I added [[deprecated]] in some functions that I found are deprecated by the relevant standards. - A few other related changes... Cc: Oskari Pirhonen <xxc3ncoredxx@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man2/clone.2')
-rw-r--r--man2/clone.277
1 files changed, 37 insertions, 40 deletions
diff --git a/man2/clone.2 b/man2/clone.2
index be802a2800..42ee3fee8b 100644
--- a/man2/clone.2
+++ b/man2/clone.2
@@ -1553,25 +1553,7 @@ See the discussion of the
.B ENOSPC
error above.
.SH VERSIONS
-The
-.BR clone3 ()
-system call first appeared in Linux 5.3.
-.\" There is no entry for
-.\" .BR clone ()
-.\" in libc5.
-.\" glibc2 provides
-.\" .BR clone ()
-.\" as described in this manual page.
-.SH STANDARDS
-These system calls
-are Linux-specific and should not be used in programs
-intended to be portable.
-.SH NOTES
-One use of these systems calls
-is to implement threads: multiple flows of control in a program that
-run concurrently in a shared address space.
-.PP
-Note that the glibc
+The glibc
.BR clone ()
wrapper function makes some changes
in the memory pointed to by
@@ -1587,31 +1569,10 @@ is used to recursively create children,
do not use the buffer employed for the parent's stack
as the stack of the child.
.PP
-The
-.BR kcmp (2)
-system call can be used to test whether two processes share various
-resources such as a file descriptor table,
-System V semaphore undo operations, or a virtual address space.
-.PP
-Handlers registered using
-.BR pthread_atfork (3)
-are not executed during a clone call.
-.PP
-In the Linux 2.4.x series,
-.B CLONE_THREAD
-generally does not make the parent of the new thread the same
-as the parent of the calling process.
-However, from Linux 2.4.7 to Linux 2.4.18 the
-.B CLONE_THREAD
-flag implied the
-.B CLONE_PARENT
-flag (as in Linux 2.6.0 and later).
-.PP
On i386,
.BR clone ()
should not be called through vsyscall, but directly through
.IR "int $0x80" .
-.\"
.SS C library/kernel differences
The raw
.BR clone ()
@@ -1748,7 +1709,29 @@ and
.I stack_size
specifies the size of the stack pointed to by
.IR stack_base .
+.SH STANDARDS
+Linux.
+.SH HISTORY
+.TP
+.BR clone3 ()
+Linux 5.3.
+.\" There is no entry for
+.\" .BR clone ()
+.\" in libc5.
+.\" glibc2 provides
+.\" .BR clone ()
+.\" as described in this manual page.
.SS Linux 2.4 and earlier
+In the Linux 2.4.x series,
+.B CLONE_THREAD
+generally does not make the parent of the new thread the same
+as the parent of the calling process.
+However, from Linux 2.4.7 to Linux 2.4.18 the
+.B CLONE_THREAD
+flag implied the
+.B CLONE_PARENT
+flag (as in Linux 2.6.0 and later).
+.PP
In Linux 2.4 and earlier,
.BR clone ()
does not take arguments
@@ -1756,6 +1739,20 @@ does not take arguments
.IR tls ,
and
.IR child_tid .
+.SH NOTES
+One use of these systems calls
+is to implement threads: multiple flows of control in a program that
+run concurrently in a shared address space.
+.PP
+The
+.BR kcmp (2)
+system call can be used to test whether two processes share various
+resources such as a file descriptor table,
+System V semaphore undo operations, or a virtual address space.
+.PP
+Handlers registered using
+.BR pthread_atfork (3)
+are not executed during a clone call.
.SH BUGS
GNU C library versions 2.3.4 up to and including 2.24
contained a wrapper function for