Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / errno / errno.c
blob384b07f2c41ff1234292dc6f258ec2ebd7e4d7ed
1 /* The errno variable is stored in the reentrancy structure. This
2 function returns its address for use by the macro errno defined in
3 errno.h. */
5 #include <errno.h>
6 #include <reent.h>
8 #ifdef _REENT_THREAD_LOCAL
9 _Thread_local int _tls_errno;
10 #else /* !_REENT_THREAD_LOCAL */
12 #ifndef _REENT_ONLY
14 int *
15 __errno ()
17 return &_REENT_ERRNO(_REENT);
20 #endif
22 #endif /* _REENT_THREAD_LOCAL */