Skip to content

Commit 82873d4

Browse files
committed
[Wayland] Use read-only anonymous file abstraction for wayland-keymap sharing
Add ro_anonymous_file, an abstraction around anonymous read-only files. Files can be created by calling os_ro_anonymous_file_create(), passing the data of the file. Subsequent calls to os_ro_anonymous_file_get_fd() return a fd that's ready to be send over the socket. Use this new abstraction in meta-wayland-keyboard for sending keymap data to the clients without having to copy it unnecessarily.
1 parent f902ccb commit 82873d4

File tree

11 files changed

+775
-73
lines changed

11 files changed

+775
-73
lines changed

config.h.meson

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,12 @@
7676

7777
/* Whether the Xwayland supports +/-byteswappedclients */
7878
#mesondefine HAVE_XWAYLAND_BYTE_SWAPPED_CLIENTS
79+
80+
/* Whether the mkostemp function exists */
81+
#mesondefine HAVE_MKOSTEMP
82+
83+
/* Whether the posix_fallocate function exists */
84+
#mesondefine HAVE_POSIX_FALLOCATE
85+
86+
/* Whether the memfd_create function exists */
87+
#mesondefine HAVE_MEMFD_CREATE

meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,20 @@ if cc.has_header_symbol('sys/prctl.h', 'prctl')
375375
cdata.set('HAVE_SYS_PRCTL', 1)
376376
endif
377377

378+
optional_functions = [
379+
'mkostemp',
380+
'posix_fallocate',
381+
'memfd_create',
382+
]
383+
384+
foreach function : optional_functions
385+
if cc.has_function(function)
386+
cdata.set('HAVE_' + function.to_upper(), 1)
387+
else
388+
message('Optional function ' + function + ' missing')
389+
endif
390+
endforeach
391+
378392
have_xwayland_initfd = false
379393
have_xwayland_listenfd = false
380394

0 commit comments

Comments
 (0)