aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-02-01 20:19:06 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-02-01 20:19:06 +0000
commite4b7f41c57cb9a4c57cb7767f332bb8f99976369 (patch)
tree0e02aba03faccdc2207eb78e85cb2ea96ba66744 /gdb/testsuite/gdb.threads
parent7618e12bcb8f15e83c8c6abc5216f520f09bdbf9 (diff)
downloadgdb-e4b7f41c57cb9a4c57cb7767f332bb8f99976369.zip
gdb-e4b7f41c57cb9a4c57cb7767f332bb8f99976369.tar.gz
gdb-e4b7f41c57cb9a4c57cb7767f332bb8f99976369.tar.bz2
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].
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r--gdb/testsuite/gdb.threads/current-lwp-dead.c21
1 files changed, 17 insertions, 4 deletions
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 <unistd.h>
#include <stdlib.h>
+#include <features.h>
+#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;