Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/errno/errno.c')
-rw-r--r--newlib/libc/errno/errno.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/newlib/libc/errno/errno.c b/newlib/libc/errno/errno.c
new file mode 100644
index 000000000..fd1743d73
--- /dev/null
+++ b/newlib/libc/errno/errno.c
@@ -0,0 +1,16 @@
+/* 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;
+}
+
+#endif