tinycc/bootstrap/libc/src/cstdio.c

19 lines
354 B
C

#include "syscalls.h"
// File definition
typedef void FILE;
// Values TODO: Make it correct
//FILE* stdout = 0;
//FILE* stderr = 1;
//FILE* stdin = 2;
// Base file writer
FILE* fopen(const char* filename, const char* mode) {
int inode = open(filename, 0, 0x1a4);
if(inode < 0) {
return NULL;
}
return (FILE*) (size_t) inode;
}