diff mbox

[COMMITTED] x86: Consolidate NPTL fork.

Message ID 20140514183305.349662C3A4F@topped-with-meat.com
State New
Headers show

Commit Message

Roland McGrath May 14, 2014, 6:33 p.m. UTC
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.
diff mbox

Patch

--- a/nptl/sysdeps/unix/sysv/linux/fork.c
+++ b/nptl/sysdeps/unix/sysv/linux/fork.c
@@ -23,12 +23,12 @@ 
 #include <sysdep.h>
 #include <libio/libioP.h>
 #include <tls.h>
-#include "fork.h"
 #include <hp-timing.h>
 #include <ldsodefs.h>
 #include <bits/stdio-lock.h>
 #include <atomic.h>
 #include <pthreadP.h>
+#include <fork.h>
 
 
 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 <drepper@redhat.com>, 2002.
 
@@ -17,14 +18,10 @@ 
    <http://www.gnu.org/licenses/>.  */
 
 #include <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
 
 #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 <fork.h>
--- 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 <drepper@redhat.com>, 2003.
 
@@ -17,14 +18,10 @@ 
    <http://www.gnu.org/licenses/>.  */
 
 #include <sched.h>
-#include <signal.h>
-#include <sysdep.h>
-#include <tls.h>
-
 
 #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 <fork.h>