mirror of
https://github.com/RGBCube/serenity
synced 2025-06-29 01:52:12 +00:00
Kernel: "Succeed" quietly for zero-length read() and write().
This commit is contained in:
parent
8bce4b3f42
commit
679ac386eb
1 changed files with 4 additions and 0 deletions
|
@ -822,6 +822,8 @@ ssize_t Process::sys$write(int fd, const byte* data, ssize_t size)
|
|||
{
|
||||
if (size < 0)
|
||||
return -EINVAL;
|
||||
if (size == 0)
|
||||
return 0;
|
||||
if (!validate_read(data, size))
|
||||
return -EFAULT;
|
||||
#ifdef DEBUG_IO
|
||||
|
@ -876,6 +878,8 @@ ssize_t Process::sys$read(int fd, byte* buffer, ssize_t size)
|
|||
{
|
||||
if (size < 0)
|
||||
return -EINVAL;
|
||||
if (size == 0)
|
||||
return 0;
|
||||
if (!validate_write(buffer, size))
|
||||
return -EFAULT;
|
||||
#ifdef DEBUG_IO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue