[v3] Update mmap() flags and errors lists

Florian Weimer fweimer@redhat.com
Fri Jun 14 08:21:46 GMT 2024


* DJ Delorie:

> +@item MAP_32BIT
> +Require addresses that can be accessed with a 32 bit pointer, i.e.,
> +within the first 4 GiB.  Ignored if MAP_FIXED is specified.

Isn't MAP_32BIT mapping within  the first 2 GiB?

> +@item MAP_FIXED_NOREPLACE
> +Similar to @code{MAP_FIXED} except the call will fail with
> +@code{EEXIST} if the new mapping would overwrite an existing mapping.

Maybe note that if the kernel does not support MAP_FIXED_NOREPLACE,
the mapping can result at a different address, with no overlap?

> +@item MAP_POPULATE
> +@itemx MAP_NONBLOCK
> +These two are opposites.  @code{MAP_POPULATE} is a hint that requests
> +that the kernel read-ahead a file-backed mapping, causing more pages
> +to be mapped before they're needed.  @code{MAP_NONBLOCK} is a hint
> +that requests that the kernel @emph{not} attempt such, only mapping
> +pages when they're actually needed.

Maybe mention that even with mlockall or MAP_LOCK, MAP_POPULATE does not
avoid future page faults, and mlock still needs to be used?

> +@code{/proc/sys/vm/max_map_count}.

Either use @file{/proc/sys/vm/max_map_count}, or something like the “the
@code{vm.max_map_count} sysctl setting”.

Thanks,
Florian



More information about the Libc-alpha mailing list