From 1da530b630cdecb5a3b51c49eb6eeec8f0a65830 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 12 Jan 2023 13:10:10 -0800 Subject: [PATCH] Use `memfd_create` on FreeBSD Fixes https://github.com/Smithay/client-toolkit/issues/292. --- src/shm/raw.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shm/raw.rs b/src/shm/raw.rs index a3e0821008..e29a138921 100644 --- a/src/shm/raw.rs +++ b/src/shm/raw.rs @@ -171,7 +171,7 @@ impl io::Seek for RawPool { impl RawPool { fn create_shm_fd() -> io::Result { - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "freebsd"))] { match RawPool::create_memfd() { Ok(fd) => return Ok(fd), @@ -227,7 +227,7 @@ impl RawPool { } } - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "freebsd"))] fn create_memfd() -> nix::Result { use std::ffi::CStr;