aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-05-31 22:16:38 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-05-31 22:16:38 +0000
commitfad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd (patch)
treef2d3fe127fb6c3c1d3b919631de6e6ed7cbc1791 /include
parentc2f011aa031b8598422953d5e9a93ca008ad0867 (diff)
downloadbusybox-fad2b86c9e7eaadb973b50a1bc0e2accc1a96cfd.tar.gz
use "glibc errno" trick not only for ash, but for entire busybox
(add/remove: 1/1 grow/shrink: 37/37 up/down: 139/-228) Total: -89 bytes
Diffstat (limited to 'include')
-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