2002-08-02 03:32:24 +00:00
|
|
|
#ifndef _ERRNO_H
|
|
|
|
|
|
2002-07-20 01:14:41 +00:00
|
|
|
#include <stdlib/errno.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2002-08-02 19:58:24 +00:00
|
|
|
#if defined _ERRNO_H && !defined _ISOMAC
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2002-10-11 10:52:20 +00:00
|
|
|
# ifdef IS_IN_rtld
|
|
|
|
|
# include <dl-sysdep.h>
|
|
|
|
|
# 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
|
|
|
|
|
# define errno errno /* For #ifndef errno tests. */
|
2002-10-11 10:52:20 +00:00
|
|
|
extern int errno attribute_hidden;
|
|
|
|
|
|
2002-08-02 03:32:24 +00:00
|
|
|
# else
|
2002-10-11 10:52:20 +00:00
|
|
|
|
|
|
|
|
# include <tls.h> /* Defines USE_TLS. */
|
|
|
|
|
|
|
|
|
|
# if USE___THREAD
|
|
|
|
|
# undef errno
|
2002-10-15 22:50:43 +00:00
|
|
|
# ifndef NOT_IN_libc
|
|
|
|
|
# define errno __libc_errno
|
|
|
|
|
# else
|
|
|
|
|
# define errno errno /* For #ifndef errno tests. */
|
|
|
|
|
# endif
|
|
|
|
|
extern __thread int errno attribute_tls_model_ie;
|
2002-10-11 10:52:20 +00:00
|
|
|
# endif
|
|
|
|
|
|
|
|
|
|
# endif /* RTLD_PRIVATE_ERRNO */
|
2002-08-02 03:32:24 +00:00
|
|
|
|
2002-11-25 00:14:23 +00:00
|
|
|
# define __set_errno(val) (errno = (val))
|
|
|
|
|
|
2002-12-31 20:46:11 +00:00
|
|
|
# ifndef __ASSEMBLER__
|
|
|
|
|
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
|
|
|
|
|
libc_hidden_proto (__errno_location)
|
|
|
|
|
# endif
|
|
|
|
|
|
2002-08-02 03:32:24 +00:00
|
|
|
#endif /* _ERRNO_H */
|
|
|
|
|
|
|
|
|
|
#endif /* ! _ERRNO_H */
|