From 07c004bf3cf7fcb6e875bddb1a7fb0793377ebfb Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 24 Feb 2020 17:39:40 +1100 Subject: Changed read() and write() calls to now accept an integer file descriptor as their first parameter. read()/write() calls to descriptors other than stdin/stdout respectively, are currently discared as the file table has yet to be fully implemented. --- lib/stdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/stdio.c b/lib/stdio.c index b1c00ba..9fbf7fe 100644 --- a/lib/stdio.c +++ b/lib/stdio.c @@ -5,14 +5,14 @@ #include _syscall1(int, ctty, int, ctty); -_syscall2(ssize_t, read, void*, buf, size_t, len); -_syscall2(ssize_t, write, void*, buf, size_t, len); +_syscall3(ssize_t, read, int, fd, void*, buf, size_t, len); +_syscall3(ssize_t, write, int, fd, void*, buf, size_t, len); int puts(char *s) { size_t len = strlen(s); ssize_t ret; - ret = write(s, len); + ret = write(STDOUT_FILENO, s, len); if(ret < 0) return EOF; -- cgit v1.3