ref: 22bcaee6b85ae9fd458b5b5717847d00b7b8599f
dir: /lib/c/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);
}