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 *);
73 int __towrite(FILE *);
75 int __overflow(FILE *, int);
78 int __underflow(FILE *);
80 int __fseeko(FILE *, off_t, int);
81 int __fseeko_unlocked(FILE *, off_t, int);
82 off_t __ftello(FILE *);
83 off_t __ftello_unlocked(FILE *);
84 size_t __fwritex(const unsigned char *, size_t, FILE *);
85 int __putc_unlocked(int, FILE *);
87 FILE *__fdopen(int, const char *);
89 #define OFLLOCK() LOCK(&libc.ofl_lock)
90 #define OFLUNLOCK() UNLOCK(&libc.ofl_lock)
92 #define feof(f) ((f)->flags & F_EOF)
93 #define ferror(f) ((f)->flags & F_ERR)
95 #define getc_unlocked(f) \
96 ( ((f)->rpos < (f)->rend) ? *(f)->rpos++ : __uflow((f)) )
98 #define putc_unlocked(c, f) ( ((c)!=(f)->lbf && (f)->wpos<(f)->wend) \
99 ? *(f)->wpos++ = (c) : __overflow((f),(c)) )
101 /* Caller-allocated FILE * operations */
102 FILE *__fopen_rb_ca(const char *, FILE *, unsigned char *, size_t);
103 int __fclose_ca(FILE *);