mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-06 04:06:06 -05:00
shm: try to mmap with MAP_UNINITIALIZED
This flag is expected to be ignored on most systems, but can't hurt to try.
This commit is contained in:
parent
1581143b0b
commit
7efe2c6c97
1 changed files with 2 additions and 1 deletions
3
shm.c
3
shm.c
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <linux/mman.h>
|
||||
#include <linux/memfd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue