public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org>
Cc: Carlos O'Donell <carlos@redhat.com>
Subject: Re: [PATCH] manual: Add note to process.texi about MT-process fork (Bug 30159)
Date: Thu, 23 Feb 2023 22:32:01 +0100	[thread overview]
Message-ID: <871qmg2hm6.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20230223204959.408243-1-carlos@redhat.com> (Carlos O'Donell via Libc-alpha's message of "Thu, 23 Feb 2023 15:49:59 -0500")

* Carlos O'Donell via Libc-alpha:

> The forked child of an MT-process may only call AS-safe functions.
> ---
>  manual/process.texi | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/manual/process.texi b/manual/process.texi
> index 9307379194..dfdf0923b4 100644
> --- a/manual/process.texi
> +++ b/manual/process.texi
> @@ -316,6 +316,12 @@ 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.

We support calling malloc after fork as an extension.  For example,
calling opendir after fork to find file descriptors in /proc/self/fd is
fairly common.

Perhaps add:

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}.

Thanks,
Florian


  reply	other threads:[~2023-02-23 21:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 20:49 Carlos O'Donell
2023-02-23 21:32 ` Florian Weimer [this message]
2023-02-23 22:39   ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qmg2hm6.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).