aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-06-20 10:06:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-06-20 10:06:28 +0200
commit06448912e6af33a1ac95f985448f83cbd39bac44 (patch)
tree822eea2ea50f9c23cbf13816ef0129c4fa05515b
parentadcabf3235a13e77a32ff2a7b7cf80be8ee3dfe3 (diff)
downloadbusybox-w32-06448912e6af33a1ac95f985448f83cbd39bac44.tar.gz
busybox-w32-06448912e6af33a1ac95f985448f83cbd39bac44.tar.bz2
busybox-w32-06448912e6af33a1ac95f985448f83cbd39bac44.zip
libbb: use _unlocked variants of stdio I/O.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/libbb.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 953bec334..963ae1e47 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -160,6 +160,44 @@ int sysinfo(struct sysinfo* info);
160#endif 160#endif
161 161
162 162
163/* Busybox does not use threads, we can speed up stdio.
164 * But don't define foo to foo_unlocked if foo_unlocked
165 * is a macro (it might be defined back to foo!).
166 */
167#ifndef getc_unlocked
168# undef getc
169# define getc(stream) getc_unlocked(stream)
170#endif
171#ifndef getchar_unlocked
172# undef getchar
173# define getchar() getchar_unlocked()
174#endif
175#ifndef putc_unlocked
176# undef putc
177# define putc(c, stream) putc_unlocked(c, stream)
178#endif
179#ifndef putchar_unlocked
180# undef putchar
181# define putchar(c) putchar_unlocked(c)
182#endif
183#ifndef fgetc_unlocked
184# undef fgetc
185# define fgetc(stream) fgetc_unlocked(stream)
186#endif
187#ifndef fputc_unlocked
188# undef fputc
189# define fputc(c, stream) fputc_unlocked(c, stream)
190#endif
191#ifndef fgets_unlocked
192# undef fgets
193# define fgets(s, n, stream) fgets_unlocked(s, n, stream)
194#endif
195#ifndef fputs_unlocked
196# undef fputs
197# define fputs(s, stream) fputs_unlocked(s, stream)
198#endif
199
200
163/* Make all declarations hidden (-fvisibility flag only affects definitions) */ 201/* Make all declarations hidden (-fvisibility flag only affects definitions) */
164/* (don't include system headers after this until corresponding pop!) */ 202/* (don't include system headers after this until corresponding pop!) */
165PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN 203PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN