#include "stdio_impl.h"
+#include <fcntl.h>
+#include <unistd.h>
/* The basic idea of this implementation is to open a new FILE,
* hack the necessary parts of the new FILE into the old one, then
* lock, via flockfile or otherwise, when freopen is called, and in that
* case, freopen cannot act until the lock is released. */
-int __dup3(int, int, int);
-
FILE *freopen(const char *restrict filename, const char *restrict mode, FILE *restrict f)
{
int fl = __fmodeflags(mode);
fclose(f2);
}
+ f->mode = 0;
+ f->locale = 0;
FUNLOCK(f);
return f;
fclose(f);
return NULL;
}
-
-LFS64(freopen);