Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmap set offset = 4096 will fail #2374

Open
EdagrHW opened this issue Jan 21, 2025 · 2 comments
Open

mmap set offset = 4096 will fail #2374

EdagrHW opened this issue Jan 21, 2025 · 2 comments

Comments

@EdagrHW
Copy link

EdagrHW commented Jan 21, 2025

std::string fileData;
size_t fileSize = sysconf(_SC_PAGESIZE) * 100 + 10;
fileData.reserve(fileSize);
for (size_t i = 0; i < fileSize; i++) {
fileData.push_back(0xff & Random::rand32());
}

File f = File::temporary();
writeStringToFileOrDie(fileData, f.fd());
std::cout << "fileSize" << fileSize << std::endl;
MemoryMapping m(File(f.fd()), 4096, 8193);

@EdagrHW
Copy link
Author

EdagrHW commented Jan 21, 2025

@yfeldblum

@EdagrHW EdagrHW closed this as completed Jan 21, 2025
@EdagrHW EdagrHW reopened this Jan 21, 2025
@EdagrHW
Copy link
Author

EdagrHW commented Jan 21, 2025

@yfeldblum window pageSize is 64K, but use functionsysconf(_SC_PAGESIZE) get page size is 4K, so meet error;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant