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:
Andreas Kling 2021-01-25 09:35:25 +01:00
parent 02cca92763
commit f5d916a881

View file

@ -35,6 +35,9 @@ int Process::sys$anon_create(size_t size, int options)
{
REQUIRE_PROMISE(stdio);
if (!size)
return -EINVAL;
if (size % PAGE_SIZE)
return -EINVAL;