Fixed stdin/stdout/stderr declarations
This commit is contained in:
parent
887bd0b242
commit
8acc7de89c
|
@ -2,6 +2,6 @@
|
|||
|
||||
int main() {
|
||||
char hellostr[] = "Hello, World!\n";
|
||||
sys_write(0, hellostr, sizeof(hellostr));
|
||||
sys_write(stdout->fd, hellostr, sizeof(hellostr));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,23 @@
|
|||
#include <liblinux.h>
|
||||
#include <liblinux/syscall.h>
|
||||
|
||||
FILE *stdin = {0}; // FIXME
|
||||
FILE *stdout = {1};
|
||||
FILE *stderr = {2};
|
||||
FILE __stdin_FILE = {
|
||||
.fd = 0
|
||||
};
|
||||
|
||||
FILE *stdin = &__stdin_FILE;
|
||||
|
||||
FILE __stdout_FILE = {
|
||||
.fd = 1
|
||||
};
|
||||
|
||||
FILE *stdout = &__stdout_FILE;
|
||||
|
||||
FILE __stderr_FILE = {
|
||||
.fd = 2
|
||||
};
|
||||
|
||||
FILE *stderr = &__stderr_FILE;
|
||||
|
||||
_Noreturn void sys_exit(int status) {
|
||||
syscall(__NR_exit, status);
|
||||
|
|
Loading…
Reference in New Issue