aboutsummaryrefslogtreecommitdiff
path: root/nptl/tst-getpid1.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-07 20:34:18 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-07 20:34:18 +0000
commit484cc8018b9e27a8fd90f15eaeee132a430131d8 (patch)
treeb33d11a83982fbc4658d97954cdb6d857fd776f5 /nptl/tst-getpid1.c
parent2da9a6a1a7e08651875ac0026523ab6747caef2e (diff)
downloadglibc-484cc8018b9e27a8fd90f15eaeee132a430131d8.tar
glibc-484cc8018b9e27a8fd90f15eaeee132a430131d8.tar.gz
glibc-484cc8018b9e27a8fd90f15eaeee132a430131d8.tar.bz2
glibc-484cc8018b9e27a8fd90f15eaeee132a430131d8.zip
Update.
2004-12-07 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/ia64/clone2.S (__clone2): Add support for NPTL where the PID is stored at userlevel and needs to be reset when CLONE_THREAD is not used. Restore gp before calling _exit.
Diffstat (limited to 'nptl/tst-getpid1.c')
-rw-r--r--nptl/tst-getpid1.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/nptl/tst-getpid1.c b/nptl/tst-getpid1.c
index 9d637159c4..061b48d735 100644
--- a/nptl/tst-getpid1.c
+++ b/nptl/tst-getpid1.c
@@ -5,6 +5,10 @@
#include <sys/types.h>
#include <sys/wait.h>
+#ifndef TEST_CLONE_FLAGS
+#define TEST_CLONE_FLAGS 0
+#endif
+
static int sig;
static int
@@ -35,8 +39,16 @@ do_test (void)
return 1;
}
+#ifdef __ia64__
+ extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
+ size_t __child_stack_size, int __flags,
+ void *__arg, ...);
+ char st[256 * 1024];
+ pid_t p = __clone2 (f, st, sizeof (st), TEST_CLONE_FLAGS, 0);
+#else
char st[128 * 1024];
- pid_t p = clone (f, st + sizeof (st), 0, 0);
+ pid_t p = clone (f, st + sizeof (st), TEST_CLONE_FLAGS, 0);
+#endif
if (p == -1)
{
printf("clone failed: %m\n");