-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdlib.h>
int
-__pthread_setspecific (key, value)
- pthread_key_t key;
- const void *value;
+__pthread_setspecific (pthread_key_t key, const void *value)
{
struct pthread *self;
unsigned int idx1st;
/* Special case access to the first 2nd-level block. This is the
usual case. */
- if (__builtin_expect (key < PTHREAD_KEY_2NDLEVEL_SIZE, 1))
+ if (__glibc_likely (key < PTHREAD_KEY_2NDLEVEL_SIZE))
{
/* Verify the key is sane. */
if (KEY_UNUSED ((seq = __pthread_keys[key].seq)))
}
else
{
- if (KEY_UNUSED ((seq = __pthread_keys[key].seq))
- || key >= PTHREAD_KEYS_MAX)
+ if (key >= PTHREAD_KEYS_MAX
+ || KEY_UNUSED ((seq = __pthread_keys[key].seq)))
/* Not valid. */
return EINVAL;
return 0;
}
-strong_alias (__pthread_setspecific, pthread_setspecific)
-strong_alias (__pthread_setspecific, __pthread_setspecific_internal)
+weak_alias (__pthread_setspecific, pthread_setspecific)
+hidden_def (__pthread_setspecific)