From patchwork Thu Feb 23 22:37:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 1747203 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=yqsl0mD0; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PN7G40JpFz2463 for ; Fri, 24 Feb 2023 09:38:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2786385B531 for ; Thu, 23 Feb 2023 22:38:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2786385B531 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677191881; bh=lMOvP3vCxUEpd2ImBFDZBsG+nqteBGOR9b4/Dj6rtgg=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=yqsl0mD0C5ojl/HB5xuO9AElA53VjRcGA0eTO7ahdM3nV94PZsEM2EPApTWRun6Np 2Ak+qTMtzl3p1r3VXH/17IilgsdfqYntxxqHfWSApcaWqR6WkGKy3jRsubNwQndO1o GoCxcu4xx/JXYXXhM4uRmnbLnCnjzbKFr+n/iuQ4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7EC743858C00 for ; Thu, 23 Feb 2023 22:37:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7EC743858C00 Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-115-t5B7D6V6MU2Ufn0K3tGnwA-1; Thu, 23 Feb 2023 17:37:33 -0500 X-MC-Unique: t5B7D6V6MU2Ufn0K3tGnwA-1 Received: by mail-il1-f198.google.com with SMTP id p3-20020a056e02104300b00316f4afe7bfso3059435ilj.5 for ; Thu, 23 Feb 2023 14:37:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lMOvP3vCxUEpd2ImBFDZBsG+nqteBGOR9b4/Dj6rtgg=; b=wElgUofj9Hwi8wDDHpBuTfR9uiPn3cqRIFQaNMrY7femgwjNTFlVFcRdT2OuzWb4Fr SivabVTCxto8fQOXj2C9vhMgc2UJM4lcpDIuJrmDT1xbAOZd2TxawRCBGeO5grT5cd/w 8YHshZ54Veu3NIvSMz2hpp9aZt0mC4xNIB2goAEQnKP7cCCWaKQ7KMIU3ZKTUOktWACv 9/lUH0qIAG/0a0i3AJTRran4UAvvDhNP87HA1oiywSqvrmLqRxsy1aTXWAGNM5LB4nkb gnq+1G132pIQ4qwFu1ZOulIMNUcpKgil5DcDCCXDSdO+W3x3a1TLVLMKvzrK2s5ecFSo LMWQ== X-Gm-Message-State: AO0yUKUOTZOaRqj5QJ5Z+hJc7h1PbW50Dvd+pyh3Hm0L/4wnEjLrpLOC t4JtKOSweZzZ0G6uRjxB7pMQYC9oHgp7mP7xlgjci9Pg6tAUcnJAxvtueiQ3XuHg36DdPGOYE1k yKiGquwwI9m23FiC/SgvkN4wrpPOiacZQwmgCTwaJCdkYdsKqa/gkeKl/9yyI2hilgTgr9VnKs6 U= X-Received: by 2002:a05:6e02:1a08:b0:316:fd71:d505 with SMTP id s8-20020a056e021a0800b00316fd71d505mr3621789ild.6.1677191851582; Thu, 23 Feb 2023 14:37:31 -0800 (PST) X-Google-Smtp-Source: AK7set+dTnQK8d4vV+pAv+7mREg8kQlTD+nsFui/05sl9Sx6vCQ+blrv3mjgPLJlxxuPPW+zafUjfg== X-Received: by 2002:a05:6e02:1a08:b0:316:fd71:d505 with SMTP id s8-20020a056e021a0800b00316fd71d505mr3621779ild.6.1677191851281; Thu, 23 Feb 2023 14:37:31 -0800 (PST) Received: from athas.localdomain ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id r5-20020a02c845000000b003c4f7c419dasm3521804jao.128.2023.02.23.14.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 14:37:30 -0800 (PST) To: libc-alpha@sourceware.org, fweimer@redhat.com Cc: Carlos O'Donell Subject: [PATCH v2] manual: Add note to process.texi about MT-process fork (Bug 30159) Date: Thu, 23 Feb 2023 17:37:28 -0500 Message-Id: <20230223223728.423748-1-carlos@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain; charset=UTF-8 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carlos O'Donell via Libc-alpha From: Carlos O'Donell Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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)