Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions linuxapi/sys/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,16 @@
#define MAP_NORESERVE 0
#define MAP_GROWSDOWN 0

/*
* Linux MAP_HUGE_* encodes the huge page size in mmap flags. FreeBSD
* has no equivalent reservation; MAP_ALIGNED(n) requests 2^n alignment
* so the VM may back the mapping with superpages.
*/
#ifndef MAP_HUGE_2MB
#define MAP_HUGE_2MB MAP_ALIGNED(21)
#endif
#ifndef MAP_HUGE_1GB
#define MAP_HUGE_1GB MAP_ALIGNED(30)
#endif

#endif
3 changes: 3 additions & 0 deletions tests/smoketest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#if !defined(MADV_DOFORK) || !defined(MAP_LOCKED)
#error linuxapi include failure
#endif
#if !defined(MAP_HUGETLB) || !defined(MAP_HUGE_1GB) || !defined(MAP_HUGE_2MB)
#error linuxapi include failure
#endif

#include <sys/sendfile.h>

Expand Down