(__pthread_lock): Force lock->__status to be read from memory on every spin.
[glibc.git] / linuxthreads / errno.c
blobbd9584f80e167ea82c922eee5ac9296a3e97abb6
1 /* Linuxthreads - a simple clone()-based implementation of Posix */
2 /* threads for Linux. */
3 /* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
4 /* */
5 /* This program is free software; you can redistribute it and/or */
6 /* modify it under the terms of the GNU Library General Public License */
7 /* as published by the Free Software Foundation; either version 2 */
8 /* of the License, or (at your option) any later version. */
9 /* */
10 /* This program is distributed in the hope that it will be useful, */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
13 /* GNU Library General Public License for more details. */
15 /* Define the location of errno for the remainder of the C library */
17 #include <errno.h>
18 #include <netdb.h>
19 #include "pthread.h"
20 #include "internals.h"
22 int * __errno_location()
24 pthread_descr self = thread_self();
25 return THREAD_GETMEM (self, p_errnop);
28 int * __h_errno_location()
30 pthread_descr self = thread_self();
31 return THREAD_GETMEM (self, p_h_errnop);
34 /* Return thread specific resolver state. */
35 struct __res_state * __res_state()
37 pthread_descr self = thread_self();
38 return THREAD_GETMEM (self, p_resp);