X-Git-Url: http://git.lttng.org/?p=lttng-ust.git;a=blobdiff_plain;f=libringbuffer%2Fshm.c;h=909991ed27c6f1ada4a04426e396d232d126df8e;hp=10b3bcef110a979ce2169ccf10417e470e122ba9;hb=4d4838bad480d48424bddc686f5ad0089e28ac94;hpb=61e520fbc01329423ff3f80be7171eb48cabd085 diff --git a/libringbuffer/shm.c b/libringbuffer/shm.c index 10b3bcef..909991ed 100644 --- a/libringbuffer/shm.c +++ b/libringbuffer/shm.c @@ -40,6 +40,7 @@ #endif #include #include +#include "mmap.h" /* * Ensure we have the required amount of space available by writing 0 @@ -154,7 +155,7 @@ struct shm_object *_shm_object_table_alloc_shm(struct shm_object_table *table, /* memory_map: mmap */ memory_map = mmap(NULL, memory_map_size, PROT_READ | PROT_WRITE, - MAP_SHARED, shmfd, 0); + MAP_SHARED | LTTNG_MAP_POPULATE, shmfd, 0); if (memory_map == MAP_FAILED) { PERROR("mmap"); goto error_mmap; @@ -341,7 +342,7 @@ struct shm_object *shm_object_table_append_shm(struct shm_object_table *table, /* memory_map: mmap */ memory_map = mmap(NULL, memory_map_size, PROT_READ | PROT_WRITE, - MAP_SHARED, shm_fd, 0); + MAP_SHARED | LTTNG_MAP_POPULATE, shm_fd, 0); if (memory_map == MAP_FAILED) { PERROR("mmap"); goto error_mmap;