mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
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.
This commit is contained in:
parent
f668e49fae
commit
346ec21c4c
8 changed files with 80 additions and 164 deletions
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef UTIL_OS_COMPATIBILITY_H
|
||||
#define UTIL_OS_COMPATIBILITY_H
|
||||
|
||||
int os_fd_set_cloexec(int fd);
|
||||
int set_cloexec_or_close(int fd);
|
||||
int create_tmpfile_cloexec(char *tmpname);
|
||||
int os_create_anonymous_file(off_t size);
|
||||
|
||||
#endif
|
||||
7
include/util/shm.h
Normal file
7
include/util/shm.h
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue