shithub: scc

ref: 1fa53aab19efe6ccd1b521574a71fb6ce0e0f126
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);
}