Skip to content

Commit

Permalink
Fix build on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
OBrezhniev committed Jan 11, 2024
1 parent 68721bc commit b1c2e91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/binfile_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ BinFile::BinFile(std::string fileName, std::string _type, uint32_t maxVersion) {

size = sb.st_size;

addr = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE | MAP_POPULATE, fd, 0);
addr = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (addr == MAP_FAILED) {
close(fd);
throw std::system_error(errno, std::generic_category(), "mmap failed");
}
madvise(addr, size, MADV_SEQUENTIAL);

type.assign((const char *)addr, 4);
pos = 4;
Expand Down

0 comments on commit b1c2e91

Please sign in to comment.