mmap: Check if size exceeds available memory when MAP_HUGETLB

If size exceeds, mmap fails and set -ENOMEM

Change-Id: I4f0d6e18ee3a7c8e32e251b7ed07ee9f76305603
Refs: #1183
This commit is contained in:
Ken Sato
2019-07-02 15:42:13 +09:00
committed by Masamichi Takagi
parent 2dd8687974
commit 8efced7bf7
11 changed files with 542 additions and 0 deletions

17
test/issues/1183/Makefile Normal file
View File

@@ -0,0 +1,17 @@
CC = gcc
TARGET=hugemap
CPPFLAGS =
LDFLAGS =
all: $(TARGET)
hugemap: hugemap.c
$(CC) -o $@ $^ $(LDFLAGS)
test: all
@sh ./C1183.sh
clean:
rm -f $(TARGET) *.o