freebsd-dev/lib/libc
Kyle Evans 8b8cf4ece6 memfd_create: simplify HUGETLB support a little bit
This also fixes a minor issue that was missed in the initial review; the
layout of the MFD_HUGE_* flags is actually not 1:1 bit:flag -- it instead
borrowed the Linux convention of how this is laid out since it was
originally implemented on Linux, the top 6 bits represent the shift required
for the requested page size.

This allows us to remove the flag <-> pgsize mapping table and simplify the
logic just prior to validation of the requested page size.

While we're here, fix two small nits:

- HUGETLB memfd shouldn't exhibit the SHM_GROW_ON_WRITE behavior. We can
  only grow largepage shm by appropriately aligned (i.e. requested pagesize)
  sizes, so it can't work in the typical/sane fashion. Furthermore, Linux
  does the same, so let's be compatible.

- We don't allow MFD_HUGETLB without specifying a pagesize, so no need to
  check for that later.

Reviewed by:	kib (slightly earlier version)
2020-09-11 02:02:15 +00:00
..
aarch64
amd64
arm
capability libcasper(3): Document HISTORY within the manpages 2020-06-16 16:48:52 +00:00
compat-43
db
gdtoa
gen getlogin_r: fix the type of len 2020-09-09 18:07:13 +00:00
gmon
i386
iconv
include Add pthread_getname_np() and pthread_setname_np() aliases for 2020-06-10 22:13:24 +00:00
inet
isc
locale setlocale(3): Add an EXAMPLES section and add LANG category 2020-08-07 17:25:56 +00:00
md
mips
nameser
net Add include missing from my last commit. 2020-06-21 23:47:27 +00:00
nls
posix1e
powerpc [PowerPC] Implement VDSO timebase access on powerpc* 2020-09-08 03:00:31 +00:00
powerpc64 [PowerPC] Implement VDSO timebase access on powerpc* 2020-09-08 03:00:31 +00:00
powerpcspe [PowerPC] Implement VDSO timebase access on powerpc* 2020-09-08 03:00:31 +00:00
quad
regex libregex: Implement a subset of the GNU extensions 2020-08-04 02:14:51 +00:00
resolv
riscv libc: Provide sub fp(s|g)etmask() implementations for RISC-V 2020-08-03 12:48:51 +00:00
rpc
secure
softfloat
stdio tmpnam(3): Also mention tmpfile in the ENVIRONMENT section 2020-08-07 16:20:07 +00:00
stdlib Follow-up r365371 by removing sentences which indicate the state of the 2020-09-06 09:08:06 +00:00
stdtime
string strtok(3): make it easier to find the RETURN VALUES section 2020-06-22 11:03:36 +00:00
sys memfd_create: simplify HUGETLB support a little bit 2020-09-11 02:02:15 +00:00
tests libc tests: dynthr_mod: fix some WARNS issues 2020-09-09 02:45:47 +00:00
uuid
x86
xdr
yp
libc_nossp.ldscript
libc.ldscript
Makefile Revert that! 2020-07-19 23:56:19 +00:00
Makefile.depend
Makefile.depend.options
Versions.def