mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:25:07 +00:00
Kernel: mmap() should fail with ENODEV for directories
This commit is contained in:
parent
3f35cd2f7d
commit
50056d1d84
2 changed files with 19 additions and 0 deletions
|
@ -339,6 +339,8 @@ void* Process::sys$mmap(const Syscall::SC_mmap_params* user_params)
|
|||
auto description = file_description(fd);
|
||||
if (!description)
|
||||
return (void*)-EBADF;
|
||||
if (description->is_directory())
|
||||
return (void*)-ENODEV;
|
||||
if ((prot & PROT_READ) && !description->is_readable())
|
||||
return (void*)-EACCES;
|
||||
if ((prot & PROT_WRITE) && !description->is_writable())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue