From 484cc8018b9e27a8fd90f15eaeee132a430131d8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 7 Dec 2004 20:34:18 +0000 Subject: Update. 2004-12-07 Jakub Jelinek * 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. --- nptl/ChangeLog | 10 ++++++++++ nptl/Makefile | 2 +- nptl/sysdeps/ia64/tcb-offsets.sym | 1 + nptl/sysdeps/unix/sysv/linux/ia64/clone2.S | 2 ++ nptl/tst-getpid1.c | 14 +++++++++++++- nptl/tst-getpid2.c | 2 ++ 6 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 nptl/sysdeps/unix/sysv/linux/ia64/clone2.S create mode 100644 nptl/tst-getpid2.c (limited to 'nptl') diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 94764f1..4cb92c9 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,13 @@ +2004-12-07 Jakub Jelinek + + * sysdeps/ia64/tcb-offsets.sym (TID): Add. + * sysdeps/unix/sysv/linux/ia64/clone2.S: New file. + + * Makefile (tests): Add tst-getpid2. + * tst-getpid1.c (TEST_CLONE_FLAGS): Define. + (do_test): Use it. Use __clone2 instead of clone on ia64. + * tst-getpid2.c: New test. + 2004-12-07 Kaz Kojima * sysdeps/unix/sysv/linux/sh/clone.S: New file. diff --git a/nptl/Makefile b/nptl/Makefile index ecd5e52..8149ef5 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -241,7 +241,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \ tst-backtrace1 \ tst-oddstacklimit \ tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ - tst-getpid1 + tst-getpid1 tst-getpid2 xtests = tst-setuid1 tst-setuid1-static # Files which must not be linked with libpthread. diff --git a/nptl/sysdeps/ia64/tcb-offsets.sym b/nptl/sysdeps/ia64/tcb-offsets.sym index 09ea70d..f5108e0 100644 --- a/nptl/sysdeps/ia64/tcb-offsets.sym +++ b/nptl/sysdeps/ia64/tcb-offsets.sym @@ -2,5 +2,6 @@ #include PID offsetof (struct pthread, pid) - sizeof (struct pthread) +TID offsetof (struct pthread, tid) - sizeof (struct pthread) MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads) - sizeof (struct pthread) SYSINFO_OFFSET offsetof (tcbhead_t, private) diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S b/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S new file mode 100644 index 0000000..8664056 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/ia64/clone2.S @@ -0,0 +1,2 @@ +#define RESET_PID +#include diff --git a/nptl/tst-getpid1.c b/nptl/tst-getpid1.c index 9d63715..061b48d 100644 --- a/nptl/tst-getpid1.c +++ b/nptl/tst-getpid1.c @@ -5,6 +5,10 @@ #include #include +#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"); diff --git a/nptl/tst-getpid2.c b/nptl/tst-getpid2.c new file mode 100644 index 0000000..fc98cb6 --- /dev/null +++ b/nptl/tst-getpid2.c @@ -0,0 +1,2 @@ +#define TEST_CLONE_FLAGS CLONE_VM +#include "tst-getpid1.c" -- cgit v1.1