From patchwork Wed May 14 18:33:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 348915 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DB321140088 for ; Thu, 15 May 2014 04:33:13 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=uxbfk6gbPQ8XXtEqYI1Yem8VufQcsEG0TZzCXZwwXSW1Rj 8JsxLvHGVyUVunz61Z44KdZb8uEgoM7Qt+cNYjVEB1HoHr182XUxMQsKG8vsAU0w Z3XGl1rzva/jjfHegBO54awS+KmLQNbtUExqp6LBWAPM97GWvotInZ7RypfWE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=7Z5+oQ4qFTx2IpQtZzNZBuZiSTk=; b=ahGGF2O11vmOQzx4UnL6 tPAcsRY9bbpFR7fZ43VYeO+02vgtMiDWOT5sizfsquMn/fC8WE8MicwX+1wMlC+5 X/Xop+GFsyEYcOHFlYJIbbtOv2Q8ieCWWZAHHq6gXx38ygM7HeeYeC7JL4HL8Wk+ l1mercvXO8s5yi+yLsmBLXc= Received: (qmail 3566 invoked by alias); 14 May 2014 18:33:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 3553 invoked by uid 89); 14 May 2014 18:33:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] x86: Consolidate NPTL fork. Message-Id: <20140514183305.349662C3A4F@topped-with-meat.com> Date: Wed, 14 May 2014 11:33:05 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=HrjlRSjS c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=1E0y4txBoScA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=20KFwNOVAAAA:8 a=mDV3o1hIAAAA:8 a=4JWfzmm79JVjqq77dDgA:9 a=CjuIK1q_8ugA:10 a=jEp0ucaQiEUA:10 Things work out more cleanly if we make fork.h the thing that varies per machine, rather than fork.c. The header can easily use #include_next. Thanks, Roland * nptl/sysdeps/unix/sysv/linux/fork.c: Use <> for fork.h #include. * nptl/sysdeps/unix/sysv/linux/x86_64/fork.c: File removed. * sysdeps/unix/sysv/linux/x86_64/fork.h: New file. * nptl/sysdeps/unix/sysv/linux/i386/fork.c: File removed. * sysdeps/unix/sysv/linux/i386/fork.h: New file. --- a/nptl/sysdeps/unix/sysv/linux/fork.c +++ b/nptl/sysdeps/unix/sysv/linux/fork.c @@ -23,12 +23,12 @@ #include #include #include -#include "fork.h" #include #include #include #include #include +#include unsigned long int *__fork_generation_pointer; --- a/nptl/sysdeps/unix/sysv/linux/i386/fork.c +++ b/sysdeps/unix/sysv/linux/i386/fork.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2014 Free Software Foundation, Inc. +/* Internal definitions for thread-friendly fork implementation. Linux/i386. + Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -17,14 +18,10 @@ . */ #include -#include -#include -#include - #define ARCH_FORK() \ INLINE_SYSCALL (clone, 5, \ CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \ NULL, NULL, &THREAD_SELF->tid) -#include "../fork.c" +#include_next --- a/nptl/sysdeps/unix/sysv/linux/x86_64/fork.c +++ b/sysdeps/unix/sysv/linux/x86_64/fork.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2003-2014 Free Software Foundation, Inc. +/* Internal definitions for thread-friendly fork implementation. Linux/x86_64. + Copyright (C) 2003-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2003. @@ -17,14 +18,10 @@ . */ #include -#include -#include -#include - #define ARCH_FORK() \ - INLINE_SYSCALL (clone, 4, \ - CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \ - NULL, &THREAD_SELF->tid) + INLINE_SYSCALL (clone, 4, \ + CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, 0, \ + NULL, &THREAD_SELF->tid) -#include "../fork.c" +#include_next