about summary refs log tree commit diff
path: root/nptl/pthread_attr_setstack.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-11 19:32:43 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-11 19:33:17 +0200
commitb855e52bae0f754150fbad78c76d363b6eb2e53c (patch)
tree7d4997134e6c2ffbdecae8a6bf1bd19ff5f58a25 /nptl/pthread_attr_setstack.c
parentda069d171482032231e1472f8b256f3c043e585f (diff)
downloadglibc-b855e52bae0f754150fbad78c76d363b6eb2e53c.tar.gz
glibc-b855e52bae0f754150fbad78c76d363b6eb2e53c.tar.xz
glibc-b855e52bae0f754150fbad78c76d363b6eb2e53c.zip
nptl: Move pthread_attr_setstack into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/pthread_attr_setstack.c')
-rw-r--r--nptl/pthread_attr_setstack.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c
index 357f633f0e..41d6b4d789 100644
--- a/nptl/pthread_attr_setstack.c
+++ b/nptl/pthread_attr_setstack.c
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <limits.h>
 #include "pthreadP.h"
+#include <shlib-compat.h>
 
 
 #ifndef NEW_VERNUM
@@ -53,16 +54,21 @@ __pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,
 
   return 0;
 }
+versioned_symbol (libc, __pthread_attr_setstack, pthread_attr_setstack,
+		  GLIBC_2_34);
 
 #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,
-		  NEW_VERNUM);
-
-# if SHLIB_COMPAT(libpthread, GLIBC_2_2, NEW_VERNUM)
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+compat_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack,
+	       GLIBC_2_2);
+# endif
+#else /* PTHREAD_STACK_MIN != 16384 */
+# if OTHER_SHLIB_COMPAT (libpthread, NEW_VERNUM, GLIBC_2_34)
+compat_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack,
+	       NEW_VERNUM);
+# endif
 
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, NEW_VERNUM)
 int
 __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,
 			     size_t stacksize)
@@ -80,11 +86,11 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,
 #  endif
 
   iattr->stacksize = stacksize;
-#if _STACK_GROWS_DOWN
+#  if _STACK_GROWS_DOWN
   iattr->stackaddr = (char *) stackaddr + stacksize;
-#else
+#  else
   iattr->stackaddr = (char *) stackaddr;
-#endif
+#  endif
   iattr->flags |= ATTR_FLAG_STACKADDR;
 
   return 0;
@@ -92,6 +98,5 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,
 
 compat_symbol (libpthread, __old_pthread_attr_setstack, pthread_attr_setstack,
 	       GLIBC_2_2);
-# endif
-
-#endif
+# endif /* OTHER_SHLIB_COMPAT */
+#endif /* PTHREAD_STACK_MIN != 16384 */