16 #include <sys/ioctl.h>
27 #define FFINALLOCK(f) ((f)->lock>=0 ? __lockfile((f)) : 0)
28 #define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
29 #define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else
40 unsigned char *rpos, *rend;
42 unsigned char *wend, *wpos;
43 unsigned char *mustbezero_1;
45 size_t (*read)(FILE *, unsigned char *, size_t);
46 size_t (*write)(FILE *, const unsigned char *, size_t);
47 off_t (*seek)(FILE *, off_t, int);
67 size_t __stdio_read(FILE *, unsigned char *, size_t);
68 size_t __stdio_write(FILE *, const unsigned char *, size_t);
69 size_t __stdout_write(FILE *, const unsigned char *, size_t);
70 off_t __stdio_seek(FILE *, off_t, int);
71 int __stdio_close(FILE *);
73 size_t __string_read(FILE *, unsigned char *, size_t);
76 int __towrite(FILE *);
78 #if defined(__PIC__) && (100*__GNUC__+__GNUC_MINOR__ >= 303)
79 __attribute__((visibility("protected")))
81 int __overflow(FILE *, int), __uflow(FILE *);
83 int __fseeko(FILE *, off_t, int);
84 int __fseeko_unlocked(FILE *, off_t, int);
85 off_t __ftello(FILE *);
86 off_t __ftello_unlocked(FILE *);
87 size_t __fwritex(const unsigned char *, size_t, FILE *);
88 int __putc_unlocked(int, FILE *);
90 FILE *__fdopen(int, const char *);
91 int __fmodeflags(const char *);
93 #define OFLLOCK() LOCK(libc.ofl_lock)
94 #define OFLUNLOCK() UNLOCK(libc.ofl_lock)
96 #define feof(f) ((f)->flags & F_EOF)
97 #define ferror(f) ((f)->flags & F_ERR)
99 #define getc_unlocked(f) \
100 ( ((f)->rpos < (f)->rend) ? *(f)->rpos++ : __uflow((f)) )
102 #define putc_unlocked(c, f) ( ((c)!=(f)->lbf && (f)->wpos<(f)->wend) \
103 ? *(f)->wpos++ = (c) : __overflow((f),(c)) )
105 /* Caller-allocated FILE * operations */
106 FILE *__fopen_rb_ca(const char *, FILE *, unsigned char *, size_t);
107 int __fclose_ca(FILE *);