shithub: scc

ref: 1fcd39f3a818478f4d7da9bb333e02d06531ddd4
dir: /lib/c/freopen.c/

View raw version

#include <stdio.h>

#include "syscall.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);
}