aboutsummaryrefslogtreecommitdiff
path: root/include/util/shm.h
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-10-26 18:38:23 +0200
committeremersion <contact@emersion.fr>2018-10-28 22:39:54 +0100
commit346ec21c4c9007e98c84b67e4f5e4b9a67bbbce7 (patch)
tree12574c950607634c72be6a00204772d25bc4c78b /include/util/shm.h
parentf668e49faeeb06bf71e8b0d21f745e0f68aab4ba (diff)
util: use shm_open for in-memory files
shm_open is a POSIX function creating an in-memory file. Using it simplifies the code and removes the dependency on XDG_RUNTIME_DIR. The only downside is that we need to generate a random name for the shm file.
Diffstat (limited to 'include/util/shm.h')
-rw-r--r--include/util/shm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/util/shm.h b/include/util/shm.h
new file mode 100644
index 00000000..fb67b711
--- /dev/null
+++ b/include/util/shm.h
@@ -0,0 +1,7 @@
+#ifndef UTIL_SHM_H
+#define UTIL_SHM_H
+
+int create_shm_file(void);
+int allocate_shm_file(size_t size);
+
+#endif