aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-03-27 03:20:20 +0000
committerUlrich Drepper <drepper@redhat.com>2001-03-27 03:20:20 +0000
commit93a4b7cac4c68f108d784fba8ded542bf41d03bd (patch)
tree4d89f1e0162077b8b760c5069028301566979497 /linuxthreads
parent0a04075ed9766681c796dfe0f2e2fb81881f09ba (diff)
downloadglibc-93a4b7cac4c68f108d784fba8ded542bf41d03bd.tar
glibc-93a4b7cac4c68f108d784fba8ded542bf41d03bd.tar.gz
glibc-93a4b7cac4c68f108d784fba8ded542bf41d03bd.tar.bz2
glibc-93a4b7cac4c68f108d784fba8ded542bf41d03bd.zip
Update.
2001-03-26 Ben Collins <bcollins@debian.org> * sysdeps/unix/sysv/linux/mips/bits/mman.h: Add MAP_* and MADV_* defines to match other architectures.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog7
-rw-r--r--linuxthreads/Examples/ex17.c2
-rw-r--r--linuxthreads/attr.c5
3 files changed, 11 insertions, 3 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 2b24584eb2..be532d55f1 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,10 @@
+2001-03-26 Ulrich Drepper <drepper@redhat.com>
+
+ * attr.c (pthread_getattr_np): Correct computation of stack size
+ for machiens with register stack.
+
+ * Examples/ex17.c (main): Correct detection of failed mmap call.
+
2001-03-21 Jakub Jelinek <jakub@redhat.com>
* pthread.c (__pthread_initialize_manager): Fix a typo.
diff --git a/linuxthreads/Examples/ex17.c b/linuxthreads/Examples/ex17.c
index bedf86806f..f5c99ee3fb 100644
--- a/linuxthreads/Examples/ex17.c
+++ b/linuxthreads/Examples/ex17.c
@@ -28,7 +28,7 @@ main (void)
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (stack == (void *)-1)
+ if (stack == MAP_FAILED)
{
perror ("mmap failed");
return 1;
diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c
index b6b1d9c92b..2d06025ba4 100644
--- a/linuxthreads/attr.c
+++ b/linuxthreads/attr.c
@@ -288,7 +288,8 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
attr->__guardsize = descr->p_guardsize;
attr->__stackaddr_set = descr->p_userstack;
#ifdef NEED_SEPARATE_REGISTER_STACK
- attr->__stacksize *= 2;
+ if (descr->p_userstack == 0)
+ attr->__stacksize *= 2;
/* XXX This is awkward. The guard pages are in the middle of the
two stacks. We must count the guard size in the stack size since
otherwise the range of the stack area cannot be computed. */
@@ -297,7 +298,7 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
#ifndef _STACK_GROWS_UP
attr->__stackaddr = (char *)(descr + 1);
#else
-#error __stackaddr not handled
+# error __stackaddr not handled
#endif
return 0;