From e4b7f41c57cb9a4c57cb7767f332bb8f99976369 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 1 Feb 2010 20:19:06 +0000 Subject: gdb/ PR libc/11214: * linux-low.c (linux_tracefork_child) [!(__UCLIBC__ && HAS_NOMMU)]: New. (linux_test_for_tracefork): Move `stack' into [__UCLIBC__ && HAS_NOMMU]. (linux_test_for_tracefork) [!(__UCLIBC__ && HAS_NOMMU)]: New. gdb/testsuite/ PR libc/11214: * gdb.threads/current-lwp-dead.c: Include features.h. (HAS_NOMMU): New. (fn, main): Move CLONE_VM into [__UCLIBC__ && HAS_NOMMU]. --- gdb/testsuite/gdb.threads/current-lwp-dead.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'gdb/testsuite/gdb.threads') diff --git a/gdb/testsuite/gdb.threads/current-lwp-dead.c b/gdb/testsuite/gdb.threads/current-lwp-dead.c index 834b8b7..16f8705 100644 --- a/gdb/testsuite/gdb.threads/current-lwp-dead.c +++ b/gdb/testsuite/gdb.threads/current-lwp-dead.c @@ -30,6 +30,13 @@ #include #include +#include +#ifdef __UCLIBC__ +#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__)) +#define HAS_NOMMU +#endif +#endif + #define STACK_SIZE 0x1000 static int @@ -51,8 +58,11 @@ fn (void *unused) stack = malloc (STACK_SIZE); assert (stack != NULL); - new_pid = clone (fn_return, stack + STACK_SIZE, CLONE_FILES | CLONE_VM, NULL, - NULL, NULL, NULL); + new_pid = clone (fn_return, stack + STACK_SIZE, CLONE_FILES +#if defined(__UCLIBC__) && defined(HAS_NOMMU) + | CLONE_VM +#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ + , NULL, NULL, NULL, NULL); assert (new_pid > 0); return 0; @@ -67,8 +77,11 @@ main (int argc, char **argv) stack = malloc (STACK_SIZE); assert (stack != NULL); - new_pid = clone (fn, stack + STACK_SIZE, CLONE_FILES | CLONE_VM, NULL, NULL, - NULL, NULL); + new_pid = clone (fn, stack + STACK_SIZE, CLONE_FILES +#if defined(__UCLIBC__) && defined(HAS_NOMMU) + | CLONE_VM +#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ + , NULL, NULL, NULL, NULL); assert (new_pid > 0); return 0; -- cgit v1.1