-static int __fflush_unlocked(FILE *f)
-{
- /* If writing, flush output. */
- if (f->wpos > f->buf && __oflow(f)) return -1;
-
- /* If reading, sync position, per POSIX */
- if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
- f->rpos = f->rend;
-
- /* Hook for special behavior on flush */
- if (f->flush) f->flush(f);
-
- return (f->flags & F_ERR) ? EOF : 0;
-}
-