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