summaryrefslogtreecommitdiffstats
path: root/man3/pthread_atfork.3
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-11-09 14:20:32 -0800
committerAlejandro Colomar <alx.manpages@gmail.com>2021-11-22 18:02:03 +0100
commitf30deb08a9a0db95a3d6b4d00c0927fb43928cc4 (patch)
tree933a706b469b630ad7f3b04d18b7de0e6b2ecfad /man3/pthread_atfork.3
parent9c07c1e14308b902d971c708e33c3405ded6052f (diff)
pthread_atfork.3: wfix.
Clarify that the pthread_atfork() callback list is a global, not per-thread. The use of "this thread" implied to some readers that pthread_atfork() maintained per-thread lists of callbacks. Given that the next sentence already explains that the callbacks are run in the context of the thread that calls fork(), I actually think it would be fine not to mention threads at all in the earlier sentence, but for now I've gone with what I think was intended to be written. This patch also attempts to clarify other references to "thread", and fixes a trivial typo "form" instead of "fork". Signed-off-by: Elliott Hughes <enh@google.com> Cc: Florian Weimer <fweimer@redhat.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man3/pthread_atfork.3')
-rw-r--r--man3/pthread_atfork.312
1 files changed, 6 insertions, 6 deletions
diff --git a/man3/pthread_atfork.3 b/man3/pthread_atfork.3
index b727cb48e..12a1492b6 100644
--- a/man3/pthread_atfork.3
+++ b/man3/pthread_atfork.3
@@ -39,14 +39,14 @@ The
.BR pthread_atfork ()
function registers fork handlers that are to be executed when
.BR fork (2)
-is called by this thread.
+is called by any thread in a process.
The handlers are executed in the context of the thread that calls
.BR fork (2).
.PP
Three kinds of handler can be registered:
.IP * 3
.IR prepare
-specifies a handler that is executed before
+specifies a handler that is executed in the parent process before
.BR fork (2)
processing starts.
.IP *
@@ -70,8 +70,8 @@ On success,
returns zero.
On error, it returns an error number.
.BR pthread_atfork ()
-may be called multiple times by a thread,
-to register multiple handlers for each phase.
+may be called multiple times by a process
+to register additional handlers.
The handlers for each phase are called in a specified order: the
.I prepare
handlers are called in reverse order of registration; the
@@ -82,7 +82,7 @@ handlers are called in the order of registration.
.SH ERRORS
.TP
.B ENOMEM
-Could not allocate memory to record the form handler entry.
+Could not allocate memory to record the fork handler list entry.
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008.
.SH NOTES
@@ -92,7 +92,7 @@ is called in a multithreaded process,
only the calling thread is duplicated in the child process.
The original intention of
.BR pthread_atfork ()
-was to allow the calling thread to be returned to a consistent state.
+was to allow the child process to be returned to a consistent state.
For example, at the time of the call to
.BR fork (2),
other threads may have locked mutexes that are visible in the