From 7efe2c6c973ee40e77c07402b6bf28e4d2d11384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 10 Mar 2020 18:01:01 +0100 Subject: [PATCH] shm: try to mmap with MAP_UNINITIALIZED This flag is expected to be ignored on most systems, but can't hurt to try. --- shm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shm.c b/shm.c index 71f964a8..ba88b361 100644 --- a/shm.c +++ b/shm.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -142,7 +143,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie) } } - mmapped = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, pool_fd, 0); + mmapped = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_UNINITIALIZED, pool_fd, 0); if (mmapped == MAP_FAILED) { LOG_ERRNO("failed to mmap SHM backing memory file"); goto err;