mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
Kernel: Use Userspace<T> for sys$read() and sys$stat()
Add validation helper overloads as needed.
This commit is contained in:
parent
e39a410546
commit
314dbc10d4
5 changed files with 67 additions and 7 deletions
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
ssize_t Process::sys$read(int fd, u8* buffer, ssize_t size)
|
||||
ssize_t Process::sys$read(int fd, Userspace<u8*> buffer, ssize_t size)
|
||||
{
|
||||
REQUIRE_PROMISE(stdio);
|
||||
if (size < 0)
|
||||
|
@ -56,7 +56,8 @@ ssize_t Process::sys$read(int fd, u8* buffer, ssize_t size)
|
|||
return -EAGAIN;
|
||||
}
|
||||
}
|
||||
return description->read(buffer, size);
|
||||
// FIXME: We should have a read() that takes a Userspace<u8*>
|
||||
return description->read((u8*)buffer.ptr(), size);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue