1 #include "stdio_impl.h"
3 /* stdout.c will override this if linked */
4 static FILE *volatile dummy = 0;
5 weak_alias(dummy, __stdout_used);
10 int r = __stdout_used ? fflush(__stdout_used) : 0;
12 for (f=*__ofl_lock(); f; f=f->next)
13 if (f->wpos > f->wbase) r |= fflush(f);
21 /* If writing, flush output */
22 if (f->wpos > f->wbase) {
30 /* If reading, sync position, per POSIX */
31 if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
33 /* Clear read and write modes */
34 f->wpos = f->wbase = f->wend = 0;
35 f->rpos = f->rend = 0;
41 weak_alias(fflush, fflush_unlocked);