Make stdin/out/err FILE pointers
This commit is contained in:
parent
7d453fd06b
commit
9d1eed8437
10
libc/stdio.c
10
libc/stdio.c
@ -10,9 +10,19 @@
|
||||
|
||||
|
||||
static uint32_t box;
|
||||
FILE* __stdio_stdin;
|
||||
FILE* __stdio_stdout;
|
||||
FILE* __stdio_stderr;
|
||||
|
||||
|
||||
void __stdio_init() {
|
||||
box=mailbox_new(16);
|
||||
__stdio_stdin=malloc(sizeof(FILE*));
|
||||
*__stdio_stdin=0;
|
||||
__stdio_stdout=malloc(sizeof(FILE*));
|
||||
*__stdio_stdout=1;
|
||||
__stdio_stderr=malloc(sizeof(FILE*));
|
||||
*__stdio_stderr=2;
|
||||
}
|
||||
|
||||
static vfs_message* make_msg(vfs_message_type type,const char* mode,const char* path, uint32_t fd, int data) {
|
||||
|
@ -11,10 +11,13 @@
|
||||
#define SEEK_SET 3
|
||||
#define EOF -1
|
||||
|
||||
#define stdin 0
|
||||
#define stdout 1
|
||||
#define stderr 2
|
||||
#define stdin __stdio_stdin
|
||||
#define stdout __stdio_stdout
|
||||
#define stderr __stdio_stderr
|
||||
|
||||
extern FILE* __stdio_stdin;
|
||||
extern FILE* __stdio_stdout;
|
||||
extern FILE* __stdio_stderr;
|
||||
|
||||
FILE* fopen(char* filename,char* mode);
|
||||
int fgetc(FILE* stream);
|
||||
|
Loading…
Reference in New Issue
Block a user