ref: 25bc36bff00d311a5d3fd681ecf20b707df455a4
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);
}