mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Kernel: Use Process::require_promise() instead of REQUIRE_PROMISE()
This change lays the foundation for making the require_promise return an error hand handling the process abort outside of the syscall implementations, to avoid cases where we would leak resources. It also has the advantage that it makes removes a gs pointer read to look up the current thread, then process for every syscall. We can instead go through the Process this pointer in most cases.
This commit is contained in:
committed by
Andreas Kling
parent
c4f60844c5
commit
bad6d50b86
@@ -16,7 +16,7 @@ namespace Kernel {
|
||||
ErrorOr<FlatPtr> Process::sys$getrandom(Userspace<void*> buffer, size_t buffer_size, [[maybe_unused]] unsigned flags)
|
||||
{
|
||||
VERIFY_NO_PROCESS_BIG_LOCK(this);
|
||||
REQUIRE_PROMISE(stdio);
|
||||
require_promise(Pledge::stdio);
|
||||
if (buffer_size > NumericLimits<ssize_t>::max())
|
||||
return EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user