ref: 03f8c7437ba2ebab0071e163525bdc03770ec082
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);
}