public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] manual: Add note to process.texi about MT-process fork (Bug 30159)
@ 2023-02-23 22:37 Carlos O'Donell
  2023-02-27 16:39 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Carlos O'Donell @ 2023-02-23 22:37 UTC (permalink / raw)
  To: libc-alpha, fweimer; +Cc: 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
 
 @deftypefun pid_t _Fork (void)
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] manual: Add note to process.texi about MT-process fork (Bug 30159)
  2023-02-23 22:37 [PATCH v2] manual: Add note to process.texi about MT-process fork (Bug 30159) Carlos O'Donell
@ 2023-02-27 16:39 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2023-02-27 16:39 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: libc-alpha

* 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-27 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 22:37 [PATCH v2] manual: Add note to process.texi about MT-process fork (Bug 30159) Carlos O'Donell
2023-02-27 16:39 ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).