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