10 static struct _open_close_stub_ctrl {
11 int fopen_fd_returned;
16 } open_close_stub_ctrl;
18 static int SSCANF_ERROR;
20 static void stub_stdio_init()
23 open_close_stub_ctrl.fopen_fd_returned = 1;
24 open_close_stub_ctrl.fclose_error = 0;
25 open_close_stub_ctrl.fclose_colled = 0;
26 open_close_stub_ctrl.close_error = 0;
27 open_close_stub_ctrl.close_colled = 0;
30 static int stub_sscanf(const char *buf, const char *format, ...)
43 #define O_RDWR 02 /* copy from <bits/fcntl-linux.h>*/
46 #define O_CLOEXEC 02000000 /* copy from <bits/fcntl-linux.h>*/
49 static FILE *stub_fopen (const char *filename, const char *modes)
57 static int stub_fclose (FILE *__stream)
59 if (open_close_stub_ctrl.fclose_error)
64 open_close_stub_ctrl.fclose_colled = 1;
68 static int stub_fflush (FILE *__stream)
73 static int stub_fileno (FILE *__stream)
78 static int stub_setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n)
83 static size_t stub_fwrite (const void * ptr, size_t size,
92 #define fopen stub_fopen
93 #define fclose stub_fclose
94 #define fflush stub_fflush
95 #define fileno stub_fileno
96 #define setvbuf stub_setvbuf
97 #define sscanf stub_sscanf
98 #define fwrite stub_fwrite
105 #endif // STUB_STDIO_H