about summary refs log tree commit diff
path: root/src/errno/__errno_location.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/errno/__errno_location.c')
-rw-r--r--src/errno/__errno_location.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/errno/__errno_location.c b/src/errno/__errno_location.c
new file mode 100644
index 00000000..0a220b63
--- /dev/null
+++ b/src/errno/__errno_location.c
@@ -0,0 +1,11 @@
+#include <errno.h>
+#include "libc.h"
+
+#undef errno
+int errno;
+
+int *__errno_location(void)
+{
+	if (libc.errno_location) return libc.errno_location();
+	return &errno;
+}