aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 5e0b438be..385b30f16 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -165,6 +165,14 @@
#endif
+#if defined(__GLIBC__)
+/* glibc uses __errno_location() to get a ptr to errno */
+/* We can just memorize it once - no multithreading in busybox :) */
+extern int *const bb_errno;
+#undef errno
+#define errno (*bb_errno)
+#endif
+
#if defined(__GLIBC__) && __GLIBC__ < 2
int vdprintf(int d, const char *format, va_list ap);
#endif