mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48: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:
parent
5af4e622b9
commit
beda478821
40 changed files with 144 additions and 136 deletions
|
@ -144,10 +144,10 @@ bool PS2MouseDevice::can_read(Process&) const
|
|||
return !m_queue.is_empty();
|
||||
}
|
||||
|
||||
ssize_t PS2MouseDevice::read(Process&, byte* buffer, size_t size)
|
||||
ssize_t PS2MouseDevice::read(Process&, byte* buffer, ssize_t size)
|
||||
{
|
||||
ssize_t nread = 0;
|
||||
while ((size_t)nread < size) {
|
||||
while (nread < size) {
|
||||
if (m_queue.is_empty())
|
||||
break;
|
||||
// FIXME: Don't return partial data frames.
|
||||
|
@ -156,7 +156,7 @@ ssize_t PS2MouseDevice::read(Process&, byte* buffer, size_t size)
|
|||
return nread;
|
||||
}
|
||||
|
||||
ssize_t PS2MouseDevice::write(Process&, const byte*, size_t)
|
||||
ssize_t PS2MouseDevice::write(Process&, const byte*, ssize_t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue