mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
Kernel: Make sys$anon_create() fail if size == 0
An empty anonymous file is useless since it cannot be resized anyway, so let's not support creating it.
This commit is contained in:
parent
02cca92763
commit
f5d916a881
1 changed files with 3 additions and 0 deletions
|
@ -35,6 +35,9 @@ int Process::sys$anon_create(size_t size, int options)
|
||||||
{
|
{
|
||||||
REQUIRE_PROMISE(stdio);
|
REQUIRE_PROMISE(stdio);
|
||||||
|
|
||||||
|
if (!size)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (size % PAGE_SIZE)
|
if (size % PAGE_SIZE)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue