Commit Graph

13 Commits

Author SHA1 Message Date
Szabolcs Nagy d578c74e67 add MADV_FREE madvise command from linux v4.5
allows the os to free the marked pages lazily on memory pressure.
expected to increase malloc performance.
new in linux commit 854e9ed09dedf0c19ac8640e91bcc74bc3f9e5c9
2016-03-19 11:31:24 -04:00
Szabolcs Nagy e9f1c7981a deduplicate bits/mman.h
currently five targets use the same mman.h constants and the rest
share most constants too, so move them to sys/mman.h before the
bits/mman.h include where the differences can be corrected by
redefinition of the macros.

this fixes two minor bugs: POSIX_MADV_DONTNEED was wrong on most
targets (it should be the same as MADV_DONTNEED), and sh defined
the x86-only MAP_32BIT mmap flag.
2016-03-18 22:40:28 -04:00
Szabolcs Nagy 789ff6a9f8 add MCL_ONFAULT and MLOCK_ONFAULT mlockall and mlock2 flags
they lock faulted pages into memory (useful when a small part of a
large mapped file needs efficient access), new in linux v4.4, commit
b0f205c2a3082dd9081f9a94e50658c5fa906ff1

MLOCK_* is not in the POSIX reserved namespace for sys/mman.h
2016-01-26 18:31:05 -05:00
Trutz Behn 2d67ae923d move MREMAP_MAYMOVE and MREMAP_FIXED out of bits
the definitions are generic for all kernel archs. exposure of these
macros now only occurs on the same feature test as for the function
accepting them, which is believed to be more correct.
2015-01-30 22:02:23 -05:00
Rich Felker 74998fbec1 fix signedness of pgoff argument to remap_file_pages
both the kernel and glibc agree that this argument is unsigned; the
incorrect type ssize_t came from erroneous man pages.
2014-01-07 02:58:28 -05:00
Rich Felker 662da62eb7 add clock_adjtime, remap_file_pages, and syncfs syscall wrappers
patch by Justin Cormack, with slight modification
2012-09-16 22:26:23 -04:00
Rich Felker a660180c6a mincore syscall wrapper 2012-09-09 16:37:19 -04:00
Rich Felker c1a9658bd1 default features: make musl usable without feature test macros
the old behavior of exposing nothing except plain ISO C can be
obtained by defining __STRICT_ANSI__ or using a compiler option (such
as -std=c99) that predefines it. the new default featureset is POSIX
with XSI plus _BSD_SOURCE. any explicit feature test macros will
inhibit the default.

installation docs have also been updated to reflect this change.
2012-09-07 23:13:55 -04:00
Rich Felker 3b94daba71 _GNU_SOURCE is supposed to imply _LARGEFILE64_SOURCE
this is ugly and stupid, but now that the *64 symbol names exist, a
lot of broken GNU software detects them in configure, then either
breaks during build due to missing off64_t definition, or attempts to
compile without function declarations/prototypes. "fixing" it here is
easier than telling everyone to add yet another feature test macro to
their builds.
2012-06-04 08:03:56 -04:00
Rich Felker 419ae6d5c9 support _BSD_SOURCE feature test macro
patch by Isaac Dunham. matched closely (maybe not exact) to glibc's
idea of what _BSD_SOURCE should make visible.
2012-05-22 21:52:08 -04:00
Rich Felker f0b85fd926 add *64 junk for sys/*.h headers 2012-05-04 00:31:25 -04:00
Rich Felker a53d2f3425 namespace cleanup in sys/mman.h 2011-03-03 00:32:15 -05:00
Rich Felker 0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00