-/* stdout.c will override this if linked */
-static FILE *volatile dummy = 0;
-weak_alias(dummy, __stdout_used);
-
-int fflush(FILE *f)
-{
- int r;
-
- if (f) {
- FLOCK(f);
- r = __fflush_unlocked(f);
- FUNLOCK(f);
- return r;
- }
-
- r = __stdout_used ? fflush(__stdout_used) : 0;
-
- OFLLOCK();
- for (f=libc.ofl_head; f; f=f->next) {
- FLOCK(f);
- if (f->wpos > f->wbase) r |= __fflush_unlocked(f);
- FUNLOCK(f);
- }
- OFLUNLOCK();
-
- return r;
-}
-
-weak_alias(__fflush_unlocked, fflush_unlocked);