16 #include <sys/ioctl.h>
27 #define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
28 #define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else
39 unsigned char *rpos, *rend;
41 unsigned char *wend, *wpos;
42 unsigned char *mustbezero_1;
44 size_t (*read)(FILE *, unsigned char *, size_t);
45 size_t (*write)(FILE *, const unsigned char *, size_t);
46 off_t (*seek)(FILE *, off_t, int);
66 size_t __stdio_read(FILE *, unsigned char *, size_t);
67 size_t __stdio_write(FILE *, const unsigned char *, size_t);
68 size_t __stdout_write(FILE *, const unsigned char *, size_t);
69 off_t __stdio_seek(FILE *, off_t, int);
70 int __stdio_close(FILE *);
72 size_t __string_read(FILE *, unsigned char *, size_t);
75 int __towrite(FILE *);
77 int __overflow(FILE *, int);
80 int __underflow(FILE *);
82 int __fseeko(FILE *, off_t, int);
83 int __fseeko_unlocked(FILE *, off_t, int);
84 off_t __ftello(FILE *);
85 off_t __ftello_unlocked(FILE *);
86 size_t __fwritex(const unsigned char *, size_t, FILE *);
87 int __putc_unlocked(int, FILE *);
89 FILE *__fdopen(int, const char *);
91 #define OFLLOCK() LOCK(libc.ofl_lock)
92 #define OFLUNLOCK() UNLOCK(libc.ofl_lock)
94 #define feof(f) ((f)->flags & F_EOF)
95 #define ferror(f) ((f)->flags & F_ERR)
97 #define getc_unlocked(f) \
98 ( ((f)->rpos < (f)->rend) ? *(f)->rpos++ : __uflow((f)) )
100 #define putc_unlocked(c, f) ( ((c)!=(f)->lbf && (f)->wpos<(f)->wend) \
101 ? *(f)->wpos++ = (c) : __overflow((f),(c)) )
103 /* Caller-allocated FILE * operations */
104 FILE *__fopen_rb_ca(const char *, FILE *, unsigned char *, size_t);
105 int __fclose_ca(FILE *);