aboutsummaryrefslogtreecommitdiff
path: root/include/util
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-08-07 13:46:38 +0200
committerKenny Levinsen <kl@kl.wtf>2021-09-05 22:06:25 +0200
commit55ca93469cfaa5ca1d9b6e4c164b23ef55763eb5 (patch)
tree158288ab6e0fc11a01e4eb98ed6716954ed36101 /include/util
parent38cd1b4f4fa8f82944fb0d378bcde3242e0a69ff (diff)
util/shm: add allocate_shm_file_pair
This function behaves like allocate_shm_file, except it also returns a read-only FD. This is useful to share the same segment of memory with many Wayland clients.
Diffstat (limited to 'include/util')
-rw-r--r--include/util/shm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/util/shm.h b/include/util/shm.h
index fb67b711..331532fc 100644
--- a/include/util/shm.h
+++ b/include/util/shm.h
@@ -1,7 +1,10 @@
#ifndef UTIL_SHM_H
#define UTIL_SHM_H
+#include <stdbool.h>
+
int create_shm_file(void);
int allocate_shm_file(size_t size);
+bool allocate_shm_file_pair(size_t size, int *rw_fd, int *ro_fd);
#endif