| static int __fflush_unlocked(FILE* f) { |
| /* If writing, flush output */ |
| if (f->wpos > f->wbase) { |
| /* If reading, sync position, per POSIX */ |
| f->seek(f, f->rpos - f->rend, SEEK_CUR); |
| /* Clear read and write modes */ |
| f->wpos = f->wbase = f->wend = 0; |
| /* stdout.c will override this if linked */ |
| static FILE* volatile dummy = 0; |
| weak_alias(dummy, __stdout_used); |
| r = __fflush_unlocked(f); |
| r = __stdout_used ? fflush(__stdout_used) : 0; |
| for (f = *__ofl_lock(); f; f = f->next) { |
| r |= __fflush_unlocked(f); |
| weak_alias(__fflush_unlocked, fflush_unlocked); |