4 # define UNLOCKED_IO_H 1
6 # ifndef USE_UNLOCKED_IO
7 # define USE_UNLOCKED_IO 1
12 /* These are wrappers for functions/macros from GNU libc.
13 The standard I/O functions are thread-safe. These *_unlocked ones are
14 more efficient but not thread-safe. That they're not thread-safe is
15 fine since all of the applications in this package are single threaded. */
17 # if HAVE_DECL_CLEARERR_UNLOCKED
19 # define clearerr(x) clearerr_unlocked (x)
21 # if HAVE_DECL_FEOF_UNLOCKED
23 # define feof(x) feof_unlocked (x)
25 # if HAVE_DECL_FERROR_UNLOCKED
27 # define ferror(x) ferror_unlocked (x)
29 # if HAVE_DECL_FFLUSH_UNLOCKED
31 # define fflush(x) fflush_unlocked (x)
33 # if HAVE_DECL_FGETS_UNLOCKED
35 # define fgets(x,y,z) fgets_unlocked (x,y,z)
37 # if HAVE_DECL_FPUTC_UNLOCKED
39 # define fputc(x,y) fputc_unlocked (x,y)
41 # if HAVE_DECL_FPUTS_UNLOCKED
43 # define fputs(x,y) fputs_unlocked (x,y)
45 # if HAVE_DECL_FREAD_UNLOCKED
47 # define fread(w,x,y,z) fread_unlocked (w,x,y,z)
49 # if HAVE_DECL_FWRITE_UNLOCKED
51 # define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
53 # if HAVE_DECL_GETC_UNLOCKED
55 # define getc(x) getc_unlocked (x)
57 # if HAVE_DECL_GETCHAR_UNLOCKED
59 # define getchar() getchar_unlocked ()
61 # if HAVE_DECL_PUTC_UNLOCKED
63 # define putc(x,y) putc_unlocked (x,y)
65 # if HAVE_DECL_PUTCHAR_UNLOCKED
67 # define putchar(x) putchar_unlocked (x)
70 # endif /* USE_UNLOCKED_IO */
71 #endif /* UNLOCKED_IO_H */