From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A593D3836C77 for ; Tue, 9 Mar 2021 10:58:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A593D3836C77 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-160-wE4Dq_OnO4qTJ5mIhFHsdg-1; Tue, 09 Mar 2021 05:58:55 -0500 X-MC-Unique: wE4Dq_OnO4qTJ5mIhFHsdg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB43057; Tue, 9 Mar 2021 10:58:54 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D85DA6062F; Tue, 9 Mar 2021 10:58:53 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Subject: Re: [PATCH 3/8] posix: Consolidate fork implementation References: <20210202151134.2123748-1-adhemerval.zanella@linaro.org> <20210202151134.2123748-3-adhemerval.zanella@linaro.org> Date: Tue, 09 Mar 2021 11:58:59 +0100 In-Reply-To: <20210202151134.2123748-3-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Tue, 2 Feb 2021 12:11:29 -0300") Message-ID: <87sg544mq4.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.5 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_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 09 Mar 2021 10:58:58 -0000 * Adhemerval Zanella via Libc-alpha: > diff --git a/sysdeps/nptl/_Fork.c b/sysdeps/nptl/_Fork.c > new file mode 100644 > index 0000000000..9c701bc3d7 > --- /dev/null > +++ b/sysdeps/nptl/_Fork.c > +pid_t > +_Fork (void) > +{ > + pid_t pid = arch_fork (&THREAD_SELF->tid); > + if (pid == 0) > + { > + struct pthread *self = THREAD_SELF; > + > + /* See __pthread_once. */ > + if (__fork_generation_pointer != NULL) > + *__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR; This should not be part of _Fork, I think. There is no need to do that for a new interface. I think this means that there has to be _Fork, the generic fork implementation, and something between _Fork and fork that performs the architecture-specific bits. Hurd may also need this for its internal fork handlers if they are supposed to run for fork, but not for _Fork. Given that this affects the way functionality is split in the consolidation, I have not reviewed this version of the patch further. Thanks, Florian