Changed sys_write back to use int fd

This commit is contained in:
g1n 2021-12-28 19:02:48 +02:00
parent 36afdfe1c4
commit cfa290cfe9
4 changed files with 4 additions and 4 deletions

View File

@ -2,6 +2,6 @@
int main() {
char hellostr[] = "Hello, World!\n";
sys_write(stdout, hellostr, sizeof(hellostr));
sys_write(0, hellostr, sizeof(hellostr));
return 0;
}

View File

@ -3,6 +3,6 @@
int main() {
char str[10];
sys_read(2, str, 10);
sys_write(stdout, str, sizeof(str));
sys_write(0, str, sizeof(str));
return 0;
}

View File

@ -22,7 +22,7 @@ extern FILE *stderr;
void sys_exit(int status); // FIXME: noreturn
int sys_open(const char *pathname, int flags);
int sys_close(int fd);
ssize_t sys_write(FILE *fd, const void *buf, size_t count);
ssize_t sys_write(int fd, const void *buf, size_t count);
ssize_t sys_read(int fd, void *buf, size_t count);
void *sys_mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);
int sys_munmap(void *addr, size_t len);

View File

@ -17,7 +17,7 @@ int sys_close(int fd) {
return syscall(__NR_close, fd);
}
ssize_t sys_write(FILE *fd, const void *buf, size_t count) {
ssize_t sys_write(int fd, const void *buf, size_t count) {
return syscall(__NR_write, fd, buf, count);
}