Remove i486 subdirectory
[glibc.git] / include / errno.h
blob7df41dfc3166ef90e0cd6822b215732945bf1e71
1 #ifndef _ERRNO_H
3 #include <stdlib/errno.h>
5 #if defined _ERRNO_H && !defined _ISOMAC && !defined __cplusplus
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
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. */
21 # undef errno
22 # define errno rtld_errno
23 extern int rtld_errno attribute_hidden;
25 # elif IS_IN_LIB
27 # include <tls.h>
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;
37 # endif /* IS_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
44 attribute_hidden
45 # endif
47 libc_hidden_proto (__errno_location)
48 # endif
50 #endif /* _ERRNO_H */
52 #endif /* ! _ERRNO_H */