3 #include <stdlib/errno.h>
5 #if defined _ERRNO_H && !defined _ISOMAC && !defined __cplusplus
8 # include <dl-sysdep.h>
9 # ifndef RTLD_PRIVATE_ERRNO
10 # error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
13 # define RTLD_PRIVATE_ERRNO 0
16 # if RTLD_PRIVATE_ERRNO
17 /* The dynamic linker uses its own private errno variable.
18 All access to errno inside the dynamic linker is serialized,
19 so a single (hidden) global variable is all it needs. */
22 # define errno rtld_errno
23 extern int rtld_errno attribute_hidden
;
25 # elif !defined NOT_IN_libc || defined IN_LIB
31 # define errno __libc_errno
33 # define errno errno /* For #ifndef errno tests. */
35 extern __thread
int errno attribute_tls_model_ie
;
37 # endif /* !NOT_IN_libc || IN_LIB */
39 # define __set_errno(val) (errno = (val))
41 # ifndef __ASSEMBLER__
42 extern int *__errno_location (void) __THROW
__attribute__ ((__const__
))
43 # if RTLD_PRIVATE_ERRNO
47 libc_hidden_proto (__errno_location
)
52 #endif /* ! _ERRNO_H */