1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

Kernel: Make syscalls that take a buffer size use ssize_t instead of size_t.

Dealing with the unsigned overflow propagation here just seems unreasonably
error prone. Let's limit ourselves to 2GB buffer sizes instead.
This commit is contained in:
Andreas Kling 2019-02-25 21:19:57 +01:00
parent 5af4e622b9
commit beda478821
40 changed files with 144 additions and 136 deletions

View file

@ -77,11 +77,11 @@ static dword handle(RegisterDump& regs, dword function, dword arg1, dword arg2,
case Syscall::SC_open:
return current->sys$open((const char*)arg1, (int)arg2, (mode_t)arg3);
case Syscall::SC_write:
return current->sys$write((int)arg1, (const void*)arg2, (size_t)arg3);
return current->sys$write((int)arg1, (const byte*)arg2, (ssize_t)arg3);
case Syscall::SC_close:
return current->sys$close((int)arg1);
case Syscall::SC_read:
return current->sys$read((int)arg1, (void*)arg2, (size_t)arg3);
return current->sys$read((int)arg1, (byte*)arg2, (ssize_t)arg3);
case Syscall::SC_lseek:
return current->sys$lseek((int)arg1, (off_t)arg2, (int)arg3);
case Syscall::SC_kill: