fs/mmap/fs_mmap.c: MAP_PRIVATE or MAP_SHARED must be specified

MAP_PRIVATE or MAP_SHARED must be specified in flags according to standard

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz
2025-09-25 13:32:39 +02:00
committed by Xiang Xiao
parent a4c9fdc447
commit 729f2f890b

View File

@@ -82,6 +82,13 @@ static int file_mmap_(FAR struct file *filep, FAR void *start,
return -EINVAL;
}
/* MAP_PRIVATE or MAP_SHARED must be specified */
if (((flags & MAP_PRIVATE) == 0) && ((flags & MAP_SHARED) == 0))
{
return -EINVAL;
}
/* Fixed mappings and protections are not currently supported. These
* options could be supported in the KERNEL build with an MMU, but that
* logic is not in place.