musl/include/sys/mman.h, branch master musl - an implementation of the standard library for Linux-based systems remove LFS64 programming interfaces (macro-only) from _GNU_SOURCE 2022年10月19日T18:01:31+00:00 Rich Felker dalias@aerifal.cx 2022年09月27日T19:04:05+00:00 25e6fee27f4a293728dd15b659170e7b9c7db9bc these badly pollute the namespace with macros whenever _GNU_SOURCE is defined, which is always the case with g++, and especially tends to interfere with C++ constructs. as our implementation of these was macro-only, their removal cannot affect any existing binaries. at the source level, portable software should be prepared for them not to exist. for now, they are left in place with explicit _LARGEFILE64_SOURCE. this provides an easy temporary path for integrators/distributions to get packages building again right away if they break while working on a proper, upstreamable fix. the intent is that this be a very short-term measure and that the macros be removed entirely in the next release cycle.
these badly pollute the namespace with macros whenever _GNU_SOURCE is
defined, which is always the case with g++, and especially tends to
interfere with C++ constructs.
as our implementation of these was macro-only, their removal cannot
affect any existing binaries. at the source level, portable software
should be prepared for them not to exist.
for now, they are left in place with explicit _LARGEFILE64_SOURCE.
this provides an easy temporary path for integrators/distributions to
get packages building again right away if they break while working on
a proper, upstreamable fix. the intent is that this be a very
short-term measure and that the macros be removed entirely in the next
release cycle.
sys/mman.h: add MAP_HUGE_16KB from linux v5.10 2021年02月15日T14:16:06+00:00 Szabolcs Nagy nsz@port70.net 2020年12月19日T21:02:21+00:00 d7210f0c123c4de5110b80f26b8ea460b9799eeb see linux commit e47168f3d1b14af5281cf50c59561d59d28201f9 powerpc/8xx: Support 16k hugepages with 4k pages
see
 linux commit e47168f3d1b14af5281cf50c59561d59d28201f9
 powerpc/8xx: Support 16k hugepages with 4k pages
sys/mman.h: add MREMAP_DONTUNMAP from linux v5.7 2020年09月09日T21:20:54+00:00 Szabolcs Nagy nsz@port70.net 2020年07月13日T19:43:44+00:00 a6c302bec1d47903bfd455c0d8129cd618037672 it remaps anon mappings without unmapping the original. chromeos plans to use it with userfaultfd, see: linux commit e346b3813067d4b17383f975f197a9aa28a3b077 mm/mremap: add MREMAP_DONTUNMAP to mremap()
it remaps anon mappings without unmapping the original. chromeos plans
to use it with userfaultfd, see:
 linux commit e346b3813067d4b17383f975f197a9aa28a3b077
 mm/mremap: add MREMAP_DONTUNMAP to mremap()
sys/mman.h: add MADV_COLD and MADV_PAGEOUT from linux v5.4 2019年12月30日T23:14:08+00:00 Szabolcs Nagy nsz@port70.net 2019年12月22日T10:26:20+00:00 d95ead261e25282192e2291411740b94c2c76db3 These were mainly introduced so android can optimize the memory usage of unused apps. MADV_COLD hints that the memory range is currently not needed (unlike with MADV_FREE the content is not garbage, it needs to be swapped): linux commit 9c276cc65a58faf98be8e56962745ec99ab87636 mm: introduce MADV_COLD MADV_PAGEOUT hints that the memory range is not needed for a long time so it can be reclaimed immediately independently of memory pressure (unlike with MADV_DONTNEED the content is not garbage): linux commit 1a4e58cce84ee88129d5d49c064bd2852b481357 mm: introduce MADV_PAGEOUT
These were mainly introduced so android can optimize the memory usage
of unused apps.
MADV_COLD hints that the memory range is currently not needed (unlike
with MADV_FREE the content is not garbage, it needs to be swapped):
 linux commit 9c276cc65a58faf98be8e56962745ec99ab87636
 mm: introduce MADV_COLD
MADV_PAGEOUT hints that the memory range is not needed for a long time
so it can be reclaimed immediately independently of memory pressure
(unlike with MADV_DONTNEED the content is not garbage):
 linux commit 1a4e58cce84ee88129d5d49c064bd2852b481357
 mm: introduce MADV_PAGEOUT
sys/mman.h: add new hugetlb mmap flags from linux v4.19 2019年03月13日T16:32:14+00:00 Szabolcs Nagy nsz@port70.net 2018年11月10日T21:00:06+00:00 db8b53f20733923ab3bb0dd71d31beb37e1e9ad3 aarch64 supports 32MB and 512MB hugetlb page sizes too. added in linux commit 20916d4636a9b3c1bf562b305f91d126771edaf9
aarch64 supports 32MB and 512MB hugetlb page sizes too.
added in linux commit 20916d4636a9b3c1bf562b305f91d126771edaf9
add memfd_create syscall wrapper 2018年06月21日T01:36:04+00:00 Szabolcs Nagy nsz@port70.net 2018年06月19日T20:28:03+00:00 38f2fa3d0207b8060302129c6464662751d4f2d3 memfd_create was added in linux v3.17 and glibc has api for it.
memfd_create was added in linux v3.17 and glibc has api for it.
add mlock2 linux syscall wrapper 2018年06月21日T01:35:45+00:00 Szabolcs Nagy nsz@port70.net 2018年04月28日T17:25:41+00:00 b64d66d0b04fde0af63c3a292be423736294dca9 mlock2 syscall was added in linux v4.4 and glibc has api for it. It falls back to mlock in case of flags==0, so that case works even on older kernels. MLOCK_ONFAULT is moved under _GNU_SOURCE following glibc.
mlock2 syscall was added in linux v4.4 and glibc has api for it.
It falls back to mlock in case of flags==0, so that case works
even on older kernels.
MLOCK_ONFAULT is moved under _GNU_SOURCE following glibc.
add MAP_FIXED_NOREPLACE from linux v4.17 2018年06月19日T17:26:00+00:00 Szabolcs Nagy nsz@port70.net 2018年06月09日T20:39:35+00:00 156a3bedb22b38bc771b755700dca0cab9d1a787 to map at a fixed address without unmapping underlying mappings (fails with EEXIST unlike MAP_FIXED), new in linux commits 4ed28639519c7bad5f518e70b3284c6e0763e650 and a4ff8e8620d3f4f50ac4b41e8067b7d395056843.
to map at a fixed address without unmapping underlying mappings
(fails with EEXIST unlike MAP_FIXED), new in linux commits
4ed28639519c7bad5f518e70b3284c6e0763e650 and
a4ff8e8620d3f4f50ac4b41e8067b7d395056843.
add MAP_SYNC and MAP_SHARED_VALIDATE from linux v4.15 2018年02月22日T23:48:58+00:00 Szabolcs Nagy nsz@port70.net 2018年02月02日T20:10:09+00:00 9b57db3f958d9adc3b1c7371b5c6723aaee448b7 for synchronous page faults, new in linux commit 1c9725974074a047f6080eecc62c50a8e840d050 and b6fb293f2497a9841d94f6b57bd2bb2cd222da43 note that only targets that use asm-generic/mman.h have this new flag defined, so undef it on other targets (mips*, powerpc*).
for synchronous page faults, new in linux commit
1c9725974074a047f6080eecc62c50a8e840d050 and
b6fb293f2497a9841d94f6b57bd2bb2cd222da43
note that only targets that use asm-generic/mman.h have this new
flag defined, so undef it on other targets (mips*, powerpc*).
sys/{mman,shm}.h: add {MAP,SHM}_HUGE_ macros from linux uapi 2018年02月22日T23:48:12+00:00 Szabolcs Nagy nsz@port70.net 2017年11月26日T23:58:25+00:00 abdaba8616c29b0814a4dbe726224b6f2c9f8604 *_HUGE_SHIFT, *_HUGE_2MB, *_HUGE_1GB are documented in the man page, so add all of the *_HUGE_* macros from linux uapi. if MAP_HUGETLB is set, top bits of the mmap flags encode the page size. see the linux commit aafd4562dfee81a40ba21b5ea3cf5e06664bc7f6 if SHM_HUGETLB is set, top bits of the shmget flags encode the page size. see the linux commit 4da243ac1cf6aeb30b7c555d56208982d66d6d33 *_HUGE_16GB is defined unsigned to avoid signed left shift ub.
*_HUGE_SHIFT, *_HUGE_2MB, *_HUGE_1GB are documented in the man page,
so add all of the *_HUGE_* macros from linux uapi.
if MAP_HUGETLB is set, top bits of the mmap flags encode the page size.
see the linux commit aafd4562dfee81a40ba21b5ea3cf5e06664bc7f6
if SHM_HUGETLB is set, top bits of the shmget flags encode the page size.
see the linux commit 4da243ac1cf6aeb30b7c555d56208982d66d6d33
*_HUGE_16GB is defined unsigned to avoid signed left shift ub.

AltStyle によって変換されたページ (->オリジナル) /