mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +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
|
@ -28,20 +28,20 @@ bool Console::can_read(Process&) const
|
|||
return false;
|
||||
}
|
||||
|
||||
ssize_t Console::read(Process&, byte*, size_t)
|
||||
ssize_t Console::read(Process&, byte*, ssize_t)
|
||||
{
|
||||
// FIXME: Implement reading from the console.
|
||||
// Maybe we could use a ring buffer for this device?
|
||||
return 0;
|
||||
}
|
||||
|
||||
ssize_t Console::write(Process&, const byte* data, size_t size)
|
||||
ssize_t Console::write(Process&, const byte* data, ssize_t size)
|
||||
{
|
||||
if (!size)
|
||||
return 0;
|
||||
if (!m_implementation)
|
||||
return 0;
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
for (ssize_t i = 0; i < size; ++i)
|
||||
put_char(data[i]);
|
||||
return size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue