Mem: Use sysconf to get the page size instead of the PAGE_SIZE macro.
This commit is contained in:
parent
ab3704170e
commit
1f7a627401
1 changed files with 1 additions and 1 deletions
|
@ -90,7 +90,7 @@ PhysicalMemory::PhysicalMemory(const Params *p)
|
||||||
int fd = open(params()->file.c_str(), O_RDONLY);
|
int fd = open(params()->file.c_str(), O_RDONLY);
|
||||||
_size = lseek(fd, 0, SEEK_END);
|
_size = lseek(fd, 0, SEEK_END);
|
||||||
lseek(fd, 0, SEEK_SET);
|
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);
|
PROT_READ | PROT_WRITE, map_flags, fd, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue