]>
Commit | Line | Data |
---|---|---|
c2afe833 | 1 | #ifndef _ERRNO_H |
739d440d | 2 | #include <stdlib/errno.h> |
fd860eaa | 3 | #if !defined _ISOMAC && !defined __ASSEMBLER__ |
28f540f4 | 4 | |
a3848485 | 5 | # if IS_IN (rtld) |
ce460d04 | 6 | # include <dl-sysdep.h> |
498a2233 RM |
7 | # ifndef RTLD_PRIVATE_ERRNO |
8 | # error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!" | |
9 | # endif | |
10 | # else | |
11 | # define RTLD_PRIVATE_ERRNO 0 | |
ce460d04 RM |
12 | # endif |
13 | ||
14 | # if RTLD_PRIVATE_ERRNO | |
15 | /* The dynamic linker uses its own private errno variable. | |
16 | All access to errno inside the dynamic linker is serialized, | |
17 | so a single (hidden) global variable is all it needs. */ | |
c2afe833 | 18 | |
c2afe833 | 19 | # undef errno |
96c82b3f RM |
20 | # define errno rtld_errno |
21 | extern int rtld_errno attribute_hidden; | |
ce460d04 | 22 | |
7d6e30b4 | 23 | # elif IS_IN_LIB && !IS_IN (rtld) && !defined LIBC_NONSHARED |
ce460d04 | 24 | |
d063d164 | 25 | # undef errno |
4f41c682 | 26 | # if IS_IN (libc) |
d063d164 UD |
27 | # define errno __libc_errno |
28 | # else | |
29 | # define errno errno /* For #ifndef errno tests. */ | |
ce460d04 | 30 | # endif |
d063d164 | 31 | extern __thread int errno attribute_tls_model_ie; |
ce460d04 | 32 | |
4f41c682 | 33 | # endif /* IS_IN_LIB */ |
c2afe833 | 34 | |
983d597e RM |
35 | # define __set_errno(val) (errno = (val)) |
36 | ||
b4971123 | 37 | extern int *__errno_location (void) __THROW __attribute_const__ |
5ca3d19c UD |
38 | # if RTLD_PRIVATE_ERRNO |
39 | attribute_hidden | |
40 | # endif | |
41 | ; | |
a4baf360 | 42 | libc_hidden_proto (__errno_location) |
28f540f4 | 43 | |
fd860eaa ZW |
44 | #endif /* !_ISOMAC && !__ASSEMBLER__ */ |
45 | #endif /* !_ERRNO_H */ |