1 #include "stdio_impl.h"
3 static FILE *const dummy_file = 0;
4 weak_alias(dummy_file, __stdin_used);
5 weak_alias(dummy_file, __stdout_used);
6 weak_alias(dummy_file, __stderr_used);
8 static void close_file(FILE *f)
12 if (f->wpos > f->wbase) f->write(f, 0, 0);
13 if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
16 void __stdio_exit(void)
20 for (f=libc.ofl_head; f; f=f->next) close_file(f);
21 close_file(__stdin_used);
22 close_file(__stdout_used);