ports/graphics/qt5-wayland/files/patch-src_client_qwaylandshmbackingstore.cpp
Adriaan de Groot fc9d9b0c38 graphics/qt5-wayland: use memfd_create() on 13+
On 13+, the memfd_create() syscall can create anonymous shared-
memory areas that behaves like a file. This is used upstream
(not in Qt, but in KDE) when possible. Use it when relevant,
since it avoids creating temporary files.

While here, freshen-up the other patches.

PR:		259035
2022-08-18 10:23:58 +02:00

11 lines
442 B
C++

--- src/client/qwaylandshmbackingstore.cpp.orig 2022-06-20 20:17:21 UTC
+++ src/client/qwaylandshmbackingstore.cpp
@@ -76,6 +76,8 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *
#ifdef SYS_memfd_create
fd = syscall(SYS_memfd_create, "wayland-shm", MFD_CLOEXEC);
+#elif defined(__FreeBSD__) && __FreeBSD_version >= 1300048
+ fd = memfd_create("wayland-shm", MFD_CLOEXEC);
#endif
QScopedPointer<QFile> filePointer;