ref: ae0d87a19f53e5e8690e4a41536b5a825a3d9787
dir: /src/libc/stdio/freopen.c/
#include <stdio.h>
#include "../syscall.h"
#include "../libc.h"
#undef freopen
FILE *
freopen(const char * restrict name, const char * restrict mode,
FILE * restrict fp)
{
if (fclose(fp) == EOF)
return NULL;
return _fpopen(name, mode, fp);
}