shithub: scc

ref: 4dd43534558d8e24534d263a3bc1ca748052af9a
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);
}