2002-08-02 03:32:24 +00:00
|
|
|
#ifndef _ERRNO_H
|
2002-07-20 01:14:41 +00:00
|
|
|
#include <stdlib/errno.h>
|
2017-03-21 16:30:53 -04:00
|
|
|
#if !defined _ISOMAC && !defined __ASSEMBLER__
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2014-11-20 21:09:43 +05:30
|
|
|
# if IS_IN (rtld)
|
2002-10-11 10:52:20 +00:00
|
|
|
# include <dl-sysdep.h>
|
2014-03-14 10:44:34 -07:00
|
|
|
# ifndef RTLD_PRIVATE_ERRNO
|
|
|
|
|
# error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
|
|
|
|
|
# endif
|
|
|
|
|
# else
|
|
|
|
|
# define RTLD_PRIVATE_ERRNO 0
|
2002-10-11 10:52:20 +00:00
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# if RTLD_PRIVATE_ERRNO
|
|
|
|
|
/* The dynamic linker uses its own private errno variable.
|
|
|
|
|
All access to errno inside the dynamic linker is serialized,
|
|
|
|
|
so a single (hidden) global variable is all it needs. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2002-08-02 03:32:24 +00:00
|
|
|
# undef errno
|
2004-10-04 20:59:38 +00:00
|
|
|
# define errno rtld_errno
|
|
|
|
|
extern int rtld_errno attribute_hidden;
|
2002-10-11 10:52:20 +00:00
|
|
|
|
2018-03-25 00:48:01 +01:00
|
|
|
# elif IS_IN_LIB && !IS_IN (rtld)
|
2002-10-11 10:52:20 +00:00
|
|
|
|
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483, BZ #3493, BZ #3514, BZ #3515, BZ #3664, BZ #3673, BZ #3674]
2007-01-11 21:51:07 +00:00
|
|
|
# include <tls.h>
|
2002-10-11 10:52:20 +00:00
|
|
|
|
2011-09-10 16:50:28 -04:00
|
|
|
# undef errno
|
2014-11-24 15:03:45 +05:30
|
|
|
# if IS_IN (libc)
|
2011-09-10 16:50:28 -04:00
|
|
|
# define errno __libc_errno
|
|
|
|
|
# else
|
|
|
|
|
# define errno errno /* For #ifndef errno tests. */
|
2002-10-11 10:52:20 +00:00
|
|
|
# endif
|
2011-09-10 16:50:28 -04:00
|
|
|
extern __thread int errno attribute_tls_model_ie;
|
2002-10-11 10:52:20 +00:00
|
|
|
|
2014-11-24 15:03:45 +05:30
|
|
|
# endif /* IS_IN_LIB */
|
2002-08-02 03:32:24 +00:00
|
|
|
|
2002-11-25 00:14:23 +00:00
|
|
|
# define __set_errno(val) (errno = (val))
|
|
|
|
|
|
2017-06-09 09:37:55 -04:00
|
|
|
extern int *__errno_location (void) __THROW __attribute_const__
|
2004-10-14 16:18:09 +00:00
|
|
|
# if RTLD_PRIVATE_ERRNO
|
|
|
|
|
attribute_hidden
|
|
|
|
|
# endif
|
|
|
|
|
;
|
2002-12-31 20:46:11 +00:00
|
|
|
libc_hidden_proto (__errno_location)
|
|
|
|
|
|
2017-03-21 16:30:53 -04:00
|
|
|
#endif /* !_ISOMAC && !__ASSEMBLER__ */
|
|
|
|
|
#endif /* !_ERRNO_H */
|