Skip to content

Commit

Permalink
Use memfd_create on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Jan 12, 2023
1 parent 327f9cd commit 1da530b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shm/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl io::Seek for RawPool {

impl RawPool {
fn create_shm_fd() -> io::Result<RawFd> {
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
{
match RawPool::create_memfd() {
Ok(fd) => return Ok(fd),
Expand Down Expand Up @@ -227,7 +227,7 @@ impl RawPool {
}
}

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
fn create_memfd() -> nix::Result<RawFd> {
use std::ffi::CStr;

Expand Down

0 comments on commit 1da530b

Please sign in to comment.