1 #define _GNU_SOURCE 2 #include "stdio_impl.h" 3 #include <stdio_ext.h> 4 _flushlbf(void)5void _flushlbf(void) 6 { 7 fflush(0); 8 } 9 __fsetlocking(FILE * f,int type)10int __fsetlocking(FILE *f, int type) 11 { 12 return 0; 13 } 14 __fwriting(FILE * f)15int __fwriting(FILE *f) 16 { 17 return (f->flags & F_NORD) || f->wend; 18 } 19 __freading(FILE * f)20int __freading(FILE *f) 21 { 22 return (f->flags & F_NOWR) || f->rend; 23 } 24 __freadable(FILE * f)25int __freadable(FILE *f) 26 { 27 return !(f->flags & F_NORD); 28 } 29 __fwritable(FILE * f)30int __fwritable(FILE *f) 31 { 32 return !(f->flags & F_NOWR); 33 } 34 __flbf(FILE * f)35int __flbf(FILE *f) 36 { 37 return f->lbf >= 0; 38 } 39 __fbufsize(FILE * f)40size_t __fbufsize(FILE *f) 41 { 42 return f->buf_size; 43 } 44 __fpending(FILE * f)45size_t __fpending(FILE *f) 46 { 47 return f->wend ? f->wpos - f->wbase : 0; 48 } 49 __fpurge(FILE * f)50int __fpurge(FILE *f) 51 { 52 f->wpos = f->wbase = f->wend = 0; 53 f->rpos = f->rend = 0; 54 return 0; 55 } 56 57 weak_alias(__fpurge, fpurge); 58