mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 21:09:22 +08:00
f3b8138239
Add a _REENT_ERRNO() macro to encapsulate the access to the _errno member of struct reent. This will help to replace the structure member with a thread-local storage object in a follow up patch. Replace uses of __errno_r() with _REENT_ERRNO(). Keep __errno_r() macro for potential users outside of Newlib.
17 lines
275 B
C
17 lines
275 B
C
/* 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>
|
|
|
|
#ifndef _REENT_ONLY
|
|
|
|
int *
|
|
__errno ()
|
|
{
|
|
return &_REENT_ERRNO(_REENT);
|
|
}
|
|
|
|
#endif
|