diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h index 83ecca47f..df7e45404 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -339,12 +339,13 @@ struct BUG_off_t_size_is_misdetected { | |||
339 | #endif | 339 | #endif |
340 | #endif | 340 | #endif |
341 | 341 | ||
342 | #if defined(__GLIBC__) | 342 | #if defined(errno) |
343 | /* glibc uses __errno_location() to get a ptr to errno */ | 343 | /* If errno is a define, assume it's "define errno (*__errno_location())" |
344 | /* We can just memorize it once - no multithreading in busybox :) */ | 344 | * and we will cache it's result in this variable */ |
345 | extern int *const bb_errno; | 345 | extern int *const bb_errno; |
346 | #undef errno | 346 | #undef errno |
347 | #define errno (*bb_errno) | 347 | #define errno (*bb_errno) |
348 | #define bb_cached_errno_ptr 1 | ||
348 | #endif | 349 | #endif |
349 | 350 | ||
350 | #if !(ULONG_MAX > 0xffffffff) | 351 | #if !(ULONG_MAX > 0xffffffff) |