]> git.ipfire.org Git - thirdparty/glibc.git/blob - include/errno.h
Enhance --enable-tunables to select tunables frontend at build time
[thirdparty/glibc.git] / include / errno.h
1 #ifndef _ERRNO_H
2
3 #include <stdlib/errno.h>
4
5 #if defined _ERRNO_H && !defined _ISOMAC && !defined __cplusplus
6
7 # if IS_IN (rtld)
8 # include <dl-sysdep.h>
9 # ifndef RTLD_PRIVATE_ERRNO
10 # error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
11 # endif
12 # else
13 # define RTLD_PRIVATE_ERRNO 0
14 # endif
15
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. */
20
21 # undef errno
22 # define errno rtld_errno
23 extern int rtld_errno attribute_hidden;
24
25 # elif IS_IN_LIB
26
27 # include <tls.h>
28
29 # undef errno
30 # if IS_IN (libc)
31 # define errno __libc_errno
32 # else
33 # define errno errno /* For #ifndef errno tests. */
34 # endif
35 extern __thread int errno attribute_tls_model_ie;
36
37 # endif /* IS_IN_LIB */
38
39 # define __set_errno(val) (errno = (val))
40
41 # ifndef __ASSEMBLER__
42 extern int *__errno_location (void) __THROW __attribute__ ((__const__))
43 # if RTLD_PRIVATE_ERRNO
44 attribute_hidden
45 # endif
46 ;
47 libc_hidden_proto (__errno_location)
48 # endif
49
50 #endif /* _ERRNO_H */
51
52 #endif /* ! _ERRNO_H */