am 60fb6833
: Merge "mmap: Remove madvise() workaround"
* commit '60fb68338b7541b6022fc343857b90c088c399cd': mmap: Remove madvise() workaround
This commit is contained in:
commit
3960fb602c
@ -34,17 +34,10 @@ extern void* __mmap2(void*, size_t, int, int, int, size_t);
|
||||
#define MMAP2_SHIFT 12
|
||||
void* mmap(void *addr, size_t size, int prot, int flags, int fd, long offset)
|
||||
{
|
||||
void *ret;
|
||||
|
||||
if (offset & ((1UL << MMAP2_SHIFT)-1)) {
|
||||
errno = EINVAL;
|
||||
return MAP_FAILED;
|
||||
}
|
||||
|
||||
ret = __mmap2(addr, size, prot, flags, fd, (size_t)offset >> MMAP2_SHIFT);
|
||||
|
||||
if (ret && (flags & (MAP_PRIVATE | MAP_ANONYMOUS)))
|
||||
madvise(ret, size, MADV_MERGEABLE);
|
||||
|
||||
return ret;
|
||||
return __mmap2(addr, size, prot, flags, fd, (size_t)offset >> MMAP2_SHIFT);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user