aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-03 03:22:23 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-03 03:22:23 +0000
commit4a244f0dcec00a37e8023851ab8ddc503b4aec7e (patch)
tree84a28af11640fc8b0f8f75a23bcac53f46cbd84b /nptl
parente29ef6470637f570919916670ed4d23d5861969e (diff)
downloadglibc-4a244f0dcec00a37e8023851ab8ddc503b4aec7e.tar
glibc-4a244f0dcec00a37e8023851ab8ddc503b4aec7e.tar.gz
glibc-4a244f0dcec00a37e8023851ab8ddc503b4aec7e.tar.bz2
glibc-4a244f0dcec00a37e8023851ab8ddc503b4aec7e.zip
Update.
2003-09-02 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines): Remove rt_sigsuspend, rt_sigprocmask, rt_sigtimedwait, rt_sigqueueinfo and rt_sigpending. * sysdeps/unix/sysv/linux/alpha/sigaction.c (__syscall_rt_sigaction): New prototype. * sysdeps/unix/sysv/linux/arm/syscalls.list (__syscall_*): Remove unused __syscall_ stubs. * sysdeps/unix/sysv/linux/arm/Makefile (sysdep_routines): Remove rt_*. * sysdeps/unix/sysv/linux/cris/Makefile: Removed. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (__syscall_recvfrom, __syscall_sendto): Remove unused aliases. * sysdeps/unix/sysv/linux/mips/syscalls.list (__syscall_*): Remove unused __syscall_ stubs. * sysdeps/unix/sysv/linux/mips/Makefile (sysdep_routines): Remove rt_*. * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (__syscall_*): Remove unused __syscall_ stubs. * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list (__syscall_*): Likewise. * sysdeps/unix/sysv/linux/powerpc/Makefile (sysdep_routines): Remove rt_*. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (__syscall_*): Remove unused __syscall_ stubs. * sysdeps/unix/sysv/linux/sh/Makefile (sysdep_routines): Remove rt_*. * sysdeps/unix/sysv/linux/rt_sigaction.c: Removed. * sysdeps/unix/sysv/linux/rt_sigpending.c: Removed. * sysdeps/unix/sysv/linux/rt_sigprocmask.c: Removed. * sysdeps/unix/sysv/linux/rt_sigqueueinfo.c: Removed. * sysdeps/unix/sysv/linux/rt_sigreturn.c: Removed. * sysdeps/unix/sysv/linux/rt_sigsuspend.c: Removed. * sysdeps/unix/sysv/linux/rt_sigtimedwait.c: Removed. * sysdeps/unix/sysv/linux/s_pread64.c: Removed. * sysdeps/unix/sysv/linux/s_pwrite64.c: Removed. * sysdeps/unix/sysv/linux/alpha/gethostname.c: Remove unused __syscall_* prototypes. * sysdeps/unix/sysv/linux/alpha/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/alpha/msgctl.c: Likewise. * sysdeps/unix/sysv/linux/alpha/semctl.c: Likewise. * sysdeps/unix/sysv/linux/alpha/shmctl.c: Likewise. * sysdeps/unix/sysv/linux/arm/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/i386/chown.c: Likewise. * sysdeps/unix/sysv/linux/i386/fchown.c: Likewise. * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/i386/fxstat.c: Likewise. * sysdeps/unix/sysv/linux/i386/getegid.c: Likewise. * sysdeps/unix/sysv/linux/i386/geteuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/getgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise. * sysdeps/unix/sysv/linux/i386/getmsg.c: Likewise. * sysdeps/unix/sysv/linux/i386/xstat.c: Likewise. * sysdeps/unix/sysv/linux/i386/getresgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/getresuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/getrlimit.c: Likewise. * sysdeps/unix/sysv/linux/i386/getuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/lchown.c: Likewise. * sysdeps/unix/sysv/linux/i386/lockf64.c: Likewise. * sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise. * sysdeps/unix/sysv/linux/i386/putmsg.c: Likewise. * sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setfsuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/i386/setregid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/ia64/fxstat.c: Likewise. * sysdeps/unix/sysv/linux/ia64/lxstat.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/ia64/xstat.c: Likewise. * sysdeps/unix/sysv/linux/m68k/chown.c: Likewise. * sysdeps/unix/sysv/linux/mips/ftruncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread64.c: Likewise. * sysdeps/unix/sysv/linux/mips/ptrace.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/ustat.c: Likewise. * sysdeps/unix/sysv/linux/mips/xmknod.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/chown.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/ioctl.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/lchown.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/xstat.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/fxstat.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/lxstat.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/execve.c: Likewise. * sysdeps/unix/sysv/linux/aio_sigqueue.c: Likewise. * sysdeps/unix/sysv/linux/reboot.c: Likewise. * sysdeps/unix/sysv/linux/_exit.c: Likewise. * sysdeps/unix/sysv/linux/ftruncate64.c: Likewise. * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/fxstat64.c: Likewise. * sysdeps/unix/sysv/linux/gai_sigqueue.c: Likewise. * sysdeps/unix/sysv/linux/readahead.c: Likewise. * sysdeps/unix/sysv/linux/getcwd.c: Likewise. * sysdeps/unix/sysv/linux/sigwait.c: Likewise. * sysdeps/unix/sysv/linux/getdents.c: Likewise. * sysdeps/unix/sysv/linux/readv.c: Likewise. * sysdeps/unix/sysv/linux/getpriority.c: Likewise. * sysdeps/unix/sysv/linux/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/llseek.c: Likewise. * sysdeps/unix/sysv/linux/sysctl.c: Likewise. * sysdeps/unix/sysv/linux/lxstat64.c: Likewise. * sysdeps/unix/sysv/linux/mmap64.c: Likewise. * sysdeps/unix/sysv/linux/ustat.c: Likewise. * sysdeps/unix/sysv/linux/poll.c: Likewise. * sysdeps/unix/sysv/linux/pread64.c: Likewise. * sysdeps/unix/sysv/linux/writev.c: Likewise. * sysdeps/unix/sysv/linux/pread.c: Likewise. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. * sysdeps/unix/sysv/linux/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/sigqueue.c: Likewise. * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. * sysdeps/unix/sysv/linux/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/xmknod.c: Likewise. * sysdeps/unix/sysv/linux/xstat64.c: Likewise. 2003-09-02 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/i386/sysdep.h (PSEUDO): Revert last change. * sysdeps/unix/sysv/linux/powerpc/syscalls.list: New file. * sysdeps/unix/sysv/linux/sparc/syscalls.list: New file. * stdio-common/Makefile (CFLAGS-vprintf.c): Add -fexceptions. * intl/loadmsgcat.c: For _LIBC, call not cancelable versions of open, close, and read.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog20
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/pthread_attr_setstack.c40
-rw-r--r--nptl/pthread_attr_setstacksize.c35
-rw-r--r--nptl/sysdeps/unix/sysv/linux/alpha/Versions6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h83
-rw-r--r--nptl/sysdeps/unix/sysv/linux/ia64/Versions6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h83
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sparc/Versions6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h83
-rw-r--r--nptl/tst-stack1.c6
-rw-r--r--nptl/tst-stack2.c156
12 files changed, 521 insertions, 5 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 95c458bee6..0ecb632963 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,24 @@
2003-09-02 Jakub Jelinek <jakub@redhat.com>
+ * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
+ * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
+ pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
+ * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
+ * sysdeps/unix/sysv/linux/alpha/Versions: New file.
+ * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
+ * sysdeps/unix/sysv/linux/sparc/Versions: New file.
+ * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
+ (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
+ as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
+ * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
+ function.
+ (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
+ as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
+ * Makefile (tests): Add tst-stack2.
+ * tst-stack2.c: New test.
+ * tst-stack1.c: Include limits.h and sys/param.h.
+ (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
+
* pthread_condattr_setpshared.c: Include errno.h.
(pthread_condattr_setpshared): Return EINVAL if pshared
is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
@@ -25,7 +44,6 @@
* sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
* sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
-
* sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
2003-09-02 Ulrich Drepper <drepper@redhat.com>
diff --git a/nptl/Makefile b/nptl/Makefile
index 4d1e1de2f0..816064f73e 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -223,7 +223,7 @@ tests = tst-attr1 tst-attr2 \
tst-exec1 tst-exec2 tst-exec3 tst-exec4 \
tst-exit1 \
tst-stdio1 tst-stdio2 \
- tst-stack1 \
+ tst-stack1 tst-stack2 \
tst-unload \
tst-dlsym1 \
tst-sysconf \
diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c
index b5105f1fc1..3e00c48a4f 100644
--- a/nptl/pthread_attr_setstack.c
+++ b/nptl/pthread_attr_setstack.c
@@ -48,4 +48,44 @@ __pthread_attr_setstack (attr, stackaddr, stacksize)
return 0;
}
+
+#if PTHREAD_STACK_MIN == 16384
strong_alias (__pthread_attr_setstack, pthread_attr_setstack)
+#else
+# include <shlib-compat.h>
+versioned_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack,
+ GLIBC_2_3_3);
+
+# if SHLIB_COMPAT(libpthread, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+__old_pthread_attr_setstack (attr, stackaddr, stacksize)
+ pthread_attr_t *attr;
+ void *stackaddr;
+ size_t stacksize;
+{
+ struct pthread_attr *iattr;
+
+ assert (sizeof (*attr) >= sizeof (struct pthread_attr));
+ iattr = (struct pthread_attr *) attr;
+
+ /* Catch invalid sizes. */
+ if (stacksize < 16384)
+ return EINVAL;
+
+# ifdef EXTRA_PARAM_CHECKS
+ EXTRA_PARAM_CHECKS;
+# endif
+
+ iattr->stacksize = stacksize;
+ iattr->stackaddr = (char *) stackaddr + stacksize;
+ iattr->flags |= ATTR_FLAG_STACKADDR;
+
+ return 0;
+}
+
+compat_symbol (libpthread, __old_pthread_attr_setstack, pthread_attr_setstack,
+ GLIBC_2_2);
+# endif
+
+#endif
diff --git a/nptl/pthread_attr_setstacksize.c b/nptl/pthread_attr_setstacksize.c
index 508cc3f70f..5fda323e41 100644
--- a/nptl/pthread_attr_setstacksize.c
+++ b/nptl/pthread_attr_setstacksize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -41,4 +41,37 @@ __pthread_attr_setstacksize (attr, stacksize)
return 0;
}
+
+#if PTHREAD_STACK_MIN == 16384
strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize)
+#else
+# include <shlib-compat.h>
+versioned_symbol (libpthread, __pthread_attr_setstacksize,
+ pthread_attr_setstacksize, GLIBC_2_3_3);
+
+# if SHLIB_COMPAT(libpthread, GLIBC_2_1, GLIBC_2_3_3)
+
+int
+__old_pthread_attr_setstacksize (attr, stacksize)
+ pthread_attr_t *attr;
+ size_t stacksize;
+{
+ struct pthread_attr *iattr;
+
+ assert (sizeof (*attr) >= sizeof (struct pthread_attr));
+ iattr = (struct pthread_attr *) attr;
+
+ /* Catch invalid sizes. */
+ if (stacksize < 16384)
+ return EINVAL;
+
+ iattr->stacksize = stacksize;
+
+ return 0;
+}
+
+compat_symbol (libpthread, __old_pthread_attr_setstacksize,
+ pthread_attr_setstacksize, GLIBC_2_1);
+# endif
+
+#endif
diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/Versions b/nptl/sysdeps/unix/sysv/linux/alpha/Versions
index 3b111ddb51..437c4da28b 100644
--- a/nptl/sysdeps/unix/sysv/linux/alpha/Versions
+++ b/nptl/sysdeps/unix/sysv/linux/alpha/Versions
@@ -1,3 +1,9 @@
+libpthread {
+ GLIBC_2.3.3 {
+ # Changed PTHREAD_STACK_MIN.
+ pthread_attr_setstack; pthread_attr_setstacksize;
+ }
+}
librt {
GLIBC_2.3.3 {
# Changed timer_t.
diff --git a/nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h
new file mode 100644
index 0000000000..e2a363fa02
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/alpha/bits/local_lim.h
@@ -0,0 +1,83 @@
+/* Minimum guaranteed maximum values for system limits. Linux/Alpha version.
+ Copyright (C) 1993-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+ and defines LINK_MAX although filesystems have different maxima. A
+ similar thing is true for OPEN_MAX: the limit can be changed at
+ runtime and therefore the macro must not be defined. Remove this
+ after including the header if necessary. */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information. */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN? */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX? */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX? */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+/* We have no predefined limit on the number of threads. */
+#undef PTHREAD_THREADS_MAX
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 24576
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
+/* Maximum tty name length. */
+#define TTY_NAME_MAX 32
+
+/* Maximum login name length. This is arbitrary. */
+#define LOGIN_NAME_MAX 256
diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/Versions b/nptl/sysdeps/unix/sysv/linux/ia64/Versions
index 3b111ddb51..437c4da28b 100644
--- a/nptl/sysdeps/unix/sysv/linux/ia64/Versions
+++ b/nptl/sysdeps/unix/sysv/linux/ia64/Versions
@@ -1,3 +1,9 @@
+libpthread {
+ GLIBC_2.3.3 {
+ # Changed PTHREAD_STACK_MIN.
+ pthread_attr_setstack; pthread_attr_setstacksize;
+ }
+}
librt {
GLIBC_2.3.3 {
# Changed timer_t.
diff --git a/nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
new file mode 100644
index 0000000000..96c689b30e
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
@@ -0,0 +1,83 @@
+/* Minimum guaranteed maximum values for system limits. Linux/IA-64 version.
+ Copyright (C) 1993-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+ and defines LINK_MAX although filesystems have different maxima. A
+ similar thing is true for OPEN_MAX: the limit can be changed at
+ runtime and therefore the macro must not be defined. Remove this
+ after including the header if necessary. */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information. */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN? */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX? */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX? */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+/* We have no predefined limit on the number of threads. */
+#undef PTHREAD_THREADS_MAX
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 196608
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
+/* Maximum tty name length. */
+#define TTY_NAME_MAX 32
+
+/* Maximum login name length. This is arbitrary. */
+#define LOGIN_NAME_MAX 256
diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/Versions b/nptl/sysdeps/unix/sysv/linux/sparc/Versions
new file mode 100644
index 0000000000..d102772482
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/sparc/Versions
@@ -0,0 +1,6 @@
+libpthread {
+ GLIBC_2.3.3 {
+ # Changed PTHREAD_STACK_MIN.
+ pthread_attr_setstack; pthread_attr_setstacksize;
+ }
+}
diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h b/nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h
new file mode 100644
index 0000000000..5c15a32175
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/sparc/bits/local_lim.h
@@ -0,0 +1,83 @@
+/* Minimum guaranteed maximum values for system limits. Linux/SPARC version.
+ Copyright (C) 1993-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+ and defines LINK_MAX although filesystems have different maxima. A
+ similar thing is true for OPEN_MAX: the limit can be changed at
+ runtime and therefore the macro must not be defined. Remove this
+ after including the header if necessary. */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information. */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN? */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX? */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX? */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+/* We have no predefined limit on the number of threads. */
+#undef PTHREAD_THREADS_MAX
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 24576
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
+/* Maximum tty name length. */
+#define TTY_NAME_MAX 32
+
+/* Maximum login name length. This is arbitrary. */
+#define LOGIN_NAME_MAX 256
diff --git a/nptl/tst-stack1.c b/nptl/tst-stack1.c
index 471e6753e5..93405981d3 100644
--- a/nptl/tst-stack1.c
+++ b/nptl/tst-stack1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,9 +17,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <limits.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/param.h>
#include <unistd.h>
@@ -74,7 +76,7 @@ do_test (void)
{
int result = 0;
- size = 4 * getpagesize ();
+ size = MAX (4 * getpagesize (), PTHREAD_STACK_MIN);
if (posix_memalign (&stack, getpagesize (), size) != 0)
{
puts ("out of memory while allocating the stack memory");
diff --git a/nptl/tst-stack2.c b/nptl/tst-stack2.c
new file mode 100644
index 0000000000..93487db8ae
--- /dev/null
+++ b/nptl/tst-stack2.c
@@ -0,0 +1,156 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Test whether it is possible to create a thread with PTHREAD_STACK_MIN
+ stack size. */
+
+#include <pthread.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+int seen;
+
+void *tf (void *p)
+{
+ ++seen;
+ return NULL;
+}
+
+static int
+do_test (void)
+{
+ pthread_attr_t attr;
+ pthread_attr_init (&attr);
+
+ int result = 0;
+ int res = pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
+ if (res)
+ {
+ printf ("pthread_attr_setstacksize failed %d\n", res);
+ result = 1;
+ }
+
+ /* Create the thread. */
+ pthread_t th;
+ res = pthread_create (&th, &attr, tf, NULL);
+ if (res)
+ {
+ printf ("pthread_create failed %d\n", res);
+ result = 1;
+ }
+ else
+ {
+ res = pthread_join (th, NULL);
+ if (res)
+ {
+ printf ("pthread_join failed %d\n", res);
+ result = 1;
+ }
+ }
+
+ if (seen != 1)
+ {
+ printf ("seen %d != 1\n", seen);
+ result = 1;
+ }
+
+ return result;
+}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Test whether it is possible to create a thread with PTHREAD_STACK_MIN
+ stack size. */
+
+#include <pthread.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+int seen;
+
+void *tf (void *p)
+{
+ ++seen;
+ return NULL;
+}
+
+int
+do_test (void)
+{
+ pthread_attr_t attr;
+ pthread_attr_init (&attr);
+
+ int result = 0;
+ int res = pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
+ if (res)
+ {
+ printf ("pthread_attr_setstacksize failed %d\n", res);
+ result = 1;
+ }
+
+ /* Create the thread. */
+ pthread_t th;
+ res = pthread_create (&th, &attr, tf, NULL);
+ if (res)
+ {
+ printf ("pthread_create failed %d\n", res);
+ result = 1;
+ }
+ else
+ {
+ res = pthread_join (th, NULL);
+ if (res)
+ {
+ printf ("pthread_join failed %d\n", res);
+ result = 1;
+ }
+ }
+
+ if (seen != 1)
+ {
+ printf ("seen %d != 1\n", seen);
+ result = 1;
+ }
+
+ return result;
+}
+
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"