Mem: Use sysconf to get the page size instead of the PAGE_SIZE macro.

This commit is contained in:
Gabe Black 2011-06-08 00:57:50 -07:00
parent ab3704170e
commit 1f7a627401

View file

@ -90,7 +90,7 @@ PhysicalMemory::PhysicalMemory(const Params *p)
int fd = open(params()->file.c_str(), O_RDONLY);
_size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
pmemAddr = (uint8_t *)mmap(NULL, roundUp(size(), PAGE_SIZE),
pmemAddr = (uint8_t *)mmap(NULL, roundUp(size(), sysconf(_SC_PAGESIZE)),
PROT_READ | PROT_WRITE, map_flags, fd, 0);
}