scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

freopen.c (256B)


      1 #include <stdio.h>
      2 
      3 #include "../syscall.h"
      4 #include "../libc.h"
      5 #undef freopen
      6 
      7 FILE *
      8 freopen(const char * restrict name, const char * restrict mode,
      9         FILE * restrict fp)
     10 {
     11 	if (fclose(fp) == EOF)
     12 		return NULL;
     13 	return _fpopen(name, mode, fp);
     14 }