source: azure_iot_hub/trunk/musl-1.1.18/src/stdio/__stdio_exit.c@ 390

Last change on this file since 390 was 390, checked in by coas-nagasima, 5 years ago

コードを整理

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 550 bytes
Line 
1#include "stdio_impl.h"
2
3static FILE *volatile dummy_file = 0;
4weak_alias(dummy_file, __stdin_used);
5weak_alias(dummy_file, __stdout_used);
6weak_alias(dummy_file, __stderr_used);
7
8static void close_file(FILE *f)
9{
10 if (!f) return;
11 FFINALLOCK(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);
14}
15
16void __stdio_exit(void)
17{
18 FILE *f;
19 for (f=*__ofl_lock(); f; f=f->next) close_file(f);
20 close_file(__stdin_used);
21 close_file(__stdout_used);
22}
23
24weak_alias(__stdio_exit, __stdio_exit_needed);
Note: See TracBrowser for help on using the repository browser.