newlib-cygwin/newlib/libc/errno/errno.c

23 lines
400 B
C
Raw Normal View History

2000-02-18 03:39:52 +08:00
/* The errno variable is stored in the reentrancy structure. This
function returns its address for use by the macro errno defined in
errno.h. */
#include <errno.h>
#include <reent.h>
#ifdef _REENT_THREAD_LOCAL
_Thread_local int _tls_errno;
#else /* !_REENT_THREAD_LOCAL */
2000-02-18 03:39:52 +08:00
#ifndef _REENT_ONLY
int *
__errno ()
{
return &_REENT_ERRNO(_REENT);
2000-02-18 03:39:52 +08:00
}
#endif
#endif /* _REENT_THREAD_LOCAL */