diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-06-03 02:51:14 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-06-03 02:51:14 +0000 |
commit | 5b9e501c32829682998ec9b5bfdd9417b99d1ad3 (patch) | |
tree | 1d1671382a93930180b7ec2a9104bba4baf9a71b /libpthread/nptl/pthread_attr_setstacksize.c | |
parent | 855c7fda61d9313052a0afdfe851a4b390da845c (diff) | |
download | uClibc-alpine-5b9e501c32829682998ec9b5bfdd9417b99d1ad3.tar.bz2 uClibc-alpine-5b9e501c32829682998ec9b5bfdd9417b99d1ad3.tar.xz |
Sync up with latest NPTL code from glibc and add minor
#ifdef __UCLIBC__ directives.
Diffstat (limited to 'libpthread/nptl/pthread_attr_setstacksize.c')
-rw-r--r-- | libpthread/nptl/pthread_attr_setstacksize.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libpthread/nptl/pthread_attr_setstacksize.c b/libpthread/nptl/pthread_attr_setstacksize.c index 7d847ef08..f84a9f68e 100644 --- a/libpthread/nptl/pthread_attr_setstacksize.c +++ b/libpthread/nptl/pthread_attr_setstacksize.c @@ -42,4 +42,34 @@ __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 (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 |