summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/errno/__errno_location.c2
-rw-r--r--src/include/errno.h11
2 files changed, 13 insertions, 0 deletions
diff --git a/src/errno/__errno_location.c b/src/errno/__errno_location.c
index ad9f9241..7f9d6027 100644
--- a/src/errno/__errno_location.c
+++ b/src/errno/__errno_location.c
@@ -5,3 +5,5 @@ int *__errno_location(void)
{
return &__pthread_self()->errno_val;
}
+
+weak_alias(__errno_location, ___errno_location);
diff --git a/src/include/errno.h b/src/include/errno.h
new file mode 100644
index 00000000..54a38ff4
--- /dev/null
+++ b/src/include/errno.h
@@ -0,0 +1,11 @@
+#ifndef ERRNO_H
+#define ERRNO_H
+
+#include "../../include/errno.h"
+
+hidden int *___errno_location(void);
+
+#undef errno
+#define errno (*___errno_location())
+
+#endif