shithub: scc

ref: 2d390f87f239823f51aa811504980688c24813cf
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);
}