LibC: Fix syscall SYS_READ and SYS_WRITE arguments

This commit is contained in:
Bananymous 2023-06-19 10:38:29 +03:00
parent 0d620f3e0f
commit d99e704728
1 changed files with 3 additions and 5 deletions

View File

@ -41,18 +41,16 @@ long syscall(long syscall, ...)
{ {
int fd = va_arg(args, int); int fd = va_arg(args, int);
void* buffer = va_arg(args, void*); void* buffer = va_arg(args, void*);
size_t offset = va_arg(args, size_t);
size_t bytes = va_arg(args, size_t); size_t bytes = va_arg(args, size_t);
ret = Kernel::syscall(SYS_READ, fd, (uintptr_t)buffer, offset, bytes); ret = Kernel::syscall(SYS_READ, fd, (uintptr_t)buffer, bytes);
break; break;
} }
case SYS_WRITE: case SYS_WRITE:
{ {
int fd = va_arg(args, int); int fd = va_arg(args, int);
const char* string = va_arg(args, const char*); const void* buffer = va_arg(args, const void*);
size_t offset = va_arg(args, size_t);
size_t bytes = va_arg(args, size_t); size_t bytes = va_arg(args, size_t);
ret = Kernel::syscall(SYS_WRITE, fd, (uintptr_t)string, offset, bytes); ret = Kernel::syscall(SYS_WRITE, fd, (uintptr_t)buffer, bytes);
break; break;
} }
case SYS_TERMID: case SYS_TERMID: