16 #include <sys/ioctl.h>
26 #define FLOCK(f) ((libc.lockfile && (f)->lock>=0) ? (libc.lockfile((f)),0) : 0)
27 #define FUNLOCK(f) ((f)->lockcount && (--(f)->lockcount || ((f)->lock=0)))
37 unsigned char *rpos, *rstop;
38 unsigned char *rend, *wend;
39 unsigned char *wpos, *wstop;
41 unsigned char *dummy01[3];
56 void **wide_data; /* must be NULL */
57 size_t (*read)(FILE *, unsigned char *, size_t);
58 size_t (*write)(FILE *, const unsigned char *, size_t);
59 off_t (*seek)(FILE *, off_t, int);
64 size_t __stdio_read(FILE *, unsigned char *, size_t);
65 size_t __stdio_write(FILE *, const unsigned char *, size_t);
66 off_t __stdio_seek(FILE *, off_t, int);
67 int __stdio_close(FILE *);
69 int __overflow(FILE *, int);
72 int __underflow(FILE *);
74 int __fseeko(FILE *, off_t, int);
75 int __fseeko_unlocked(FILE *, off_t, int);
76 off_t __ftello(FILE *);
77 off_t __ftello_unlocked(FILE *);
78 size_t __fwritex(const unsigned char *, size_t, FILE *);
79 int __putc_unlocked(int, FILE *);
81 FILE *__fdopen(int, const char *);
83 #define OFLLOCK() LOCK(&libc.ofl_lock)
84 #define OFLUNLOCK() UNLOCK(&libc.ofl_lock)
85 #define ofl_head (libc.ofl_head)
87 #define feof(f) ((f)->flags & F_EOF)
88 #define ferror(f) ((f)->flags & F_ERR)
90 /* Caller-allocated FILE * operations */
91 FILE *__fopen_rb_ca(const char *, FILE *, unsigned char *, size_t);
92 int __fclose_ca(FILE *);