]> git.ipfire.org Git - thirdparty/glibc.git/blame - include/errno.h
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483,...
[thirdparty/glibc.git] / include / errno.h
CommitLineData
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
18extern int rtld_errno attribute_hidden;
ce460d04 19
c2afe833 20# else
ce460d04 21
11bf311e 22# include <tls.h>
ce460d04
RM
23
24# if USE___THREAD
25# undef errno
9b21e6bc
RM
26# ifndef NOT_IN_libc
27# define errno __libc_errno
28# else
29# define errno errno /* For #ifndef errno tests. */
30# endif
31extern __thread int errno attribute_tls_model_ie;
ce460d04
RM
32# endif
33
34# endif /* RTLD_PRIVATE_ERRNO */
c2afe833 35
983d597e
RM
36# define __set_errno(val) (errno = (val))
37
a4baf360 38# ifndef __ASSEMBLER__
5ca3d19c
UD
39extern int *__errno_location (void) __THROW __attribute__ ((__const__))
40# if RTLD_PRIVATE_ERRNO
41 attribute_hidden
42# endif
43;
a4baf360
UD
44libc_hidden_proto (__errno_location)
45# endif
46
c2afe833 47#endif /* _ERRNO_H */
28f540f4 48
c2afe833 49#endif /* ! _ERRNO_H */