Commit graph

3 commits

Author SHA1 Message Date
Laurent Montel
86c6238cfa Don't use QtTest => use QTest + missing include 2023-07-04 10:38:21 +00:00
Kai Uwe Broulik
1393f524ff test_utils: Test whether mmap PROT_WRITE fails
Writing is what our guard is supposed to prevent, let's try to mmap it
for writing. It seems FreeBSD still allows PROT_READ for sealed-for-writing
mmaps.
2022-10-24 19:02:36 +02:00
Kai Uwe Broulik
3646620430 utils: Introduce RamFile class for memfd
This class can be used to create an anonymous file, for instance
to pass data between compositor and clients, through means of a
file descriptor, as is done in various Wayland protocols, notably
the keymap exchange.

It also implements sealing the file, so that it can be shared
between multiple clients without them being able to modify it.

If supported, memfd_create is used, otherwise a `QTemporaryFile`
is used.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-08-19 15:26:22 +02:00