diff mbox series

[v2] manual: Add note to process.texi about MT-process fork (Bug 30159)

Message ID 20230223223728.423748-1-carlos@redhat.com
State New
Headers show
Series [v2] manual: Add note to process.texi about MT-process fork (Bug 30159) | expand

Commit Message

Carlos O'Donell Feb. 23, 2023, 10:37 p.m. UTC
The forked child of an MT-process may only call AS-safe functions.
---
 manual/process.texi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Florian Weimer Feb. 27, 2023, 4:39 p.m. UTC | #1
* Carlos O'Donell:

> The forked child of an MT-process may only call AS-safe functions.
> ---
>  manual/process.texi | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/manual/process.texi b/manual/process.texi
> index 9307379194..c712fe3a26 100644
> --- a/manual/process.texi
> +++ b/manual/process.texi
> @@ -316,6 +316,18 @@ The child doesn't inherit alarms set by the parent process.
>  The set of pending signals (@pxref{Delivery of Signal}) for the child
>  process is cleared.  (The child process inherits its mask of blocked
>  signals and signal actions from the parent process.)
> +
> +@item
> +In the case of a multi-threaded parent, the child process may only
> +safely call asynchronous-signal-safe functions until the process is
> +replaced with a call to an @code{exec} family function.
> +
> +As an extension relative to POSIX, @theglibc{} supports calling
> +@code{malloc} and other allocation functions after @code{fork}.  This
> +only applies to the standard @code{malloc}.  Whether this extension is
> +supported by replacement @code{malloc} implementations depends on the
> +replacement.  @xref{Replacing malloc}.
> +
>  @end itemize

My only remaining comment is that this new item isn't really about a
process attribute as such.

Thanks,
Florian
diff mbox series

Patch

diff --git a/manual/process.texi b/manual/process.texi
index 9307379194..c712fe3a26 100644
--- a/manual/process.texi
+++ b/manual/process.texi
@@ -316,6 +316,18 @@  The child doesn't inherit alarms set by the parent process.
 The set of pending signals (@pxref{Delivery of Signal}) for the child
 process is cleared.  (The child process inherits its mask of blocked
 signals and signal actions from the parent process.)
+
+@item
+In the case of a multi-threaded parent, the child process may only
+safely call asynchronous-signal-safe functions until the process is
+replaced with a call to an @code{exec} family function.
+
+As an extension relative to POSIX, @theglibc{} supports calling
+@code{malloc} and other allocation functions after @code{fork}.  This
+only applies to the standard @code{malloc}.  Whether this extension is
+supported by replacement @code{malloc} implementations depends on the
+replacement.  @xref{Replacing malloc}.
+
 @end itemize
 
 @deftypefun pid_t _Fork (void)