Unverified Commit 7040a77e by Stéphane Graber Committed by GitHub

Merge pull request #2667 from brauner/2018-10-02/prefault_mmaped_config_file

parse: prefault config file with MAP_POPULATE
parents 907e1332 2291ea4a
...@@ -88,7 +88,8 @@ int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback, ...@@ -88,7 +88,8 @@ int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback,
return 0; return 0;
} }
buf = lxc_strmmap(NULL, st.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); buf = lxc_strmmap(NULL, st.st_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_POPULATE, fd, 0);
if (buf == MAP_FAILED) { if (buf == MAP_FAILED) {
close(fd); close(fd);
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment