mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
Kernel+LibC: Turn errno codes into a strongly typed enum
..and allow implicit creation of KResult and KResultOr from ErrnoCode. This means that kernel functions that return those types can finally do "return EINVAL;" and it will just work. There's a handful of functions that still deal with signed integers that should be converted to return KResults.
This commit is contained in:
parent
e279b45aed
commit
19d3f8cab7
48 changed files with 591 additions and 506 deletions
|
@ -55,12 +55,12 @@ KResultOr<Region*> MBVGADevice::mmap(Process& process, FileDescription&, Virtual
|
|||
{
|
||||
REQUIRE_PROMISE(video);
|
||||
if (!shared)
|
||||
return KResult(-ENODEV);
|
||||
return ENODEV;
|
||||
ASSERT(offset == 0);
|
||||
ASSERT(size == framebuffer_size_in_bytes());
|
||||
auto vmobject = AnonymousVMObject::create_for_physical_range(m_framebuffer_address, framebuffer_size_in_bytes());
|
||||
if (!vmobject)
|
||||
return KResult(-ENOMEM);
|
||||
return ENOMEM;
|
||||
return process.allocate_region_with_vmobject(
|
||||
preferred_vaddr,
|
||||
framebuffer_size_in_bytes(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue