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);
6 weak_alias(dummy, __stderr_used);
12 if (__stdout_used) r |= fflush(__stdout_used);
13 if (__stderr_used) r |= fflush(__stderr_used);
15 for (f=*__ofl_lock(); f; f=f->next) {
17 if (f->wpos != f->wbase) r |= fflush(f);
27 /* If writing, flush output */
28 if (f->wpos != f->wbase) {
36 /* If reading, sync position, per POSIX */
37 if (f->rpos != f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
39 /* Clear read and write modes */
40 f->wpos = f->wbase = f->wend = 0;
41 f->rpos = f->rend = 0;
47 weak_alias(fflush, fflush_unlocked);