shithub: scc

ref: 628b7eaeb3daa2e2fa05171e399149bb3b804ad0
dir: /lib/c/freopen.c/

View raw version
#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);
}