#shared-memory #ipc #file-descriptor #shm-anon #shm #memfd #file-io

shmemfdrs2

Creates anonymous shared memory file descriptors for IPC on Unix platforms, using memfd/SHM_ANON/shm_open

1 stable release

1.0.0 Feb 25, 2024

#1105 in Unix APIs

Download history 427/week @ 2024-11-15 120/week @ 2024-11-22 112/week @ 2024-11-29 158/week @ 2024-12-06 88/week @ 2024-12-13 95/week @ 2024-12-20 83/week @ 2024-12-27 162/week @ 2025-01-03 154/week @ 2025-01-10 137/week @ 2025-01-17 167/week @ 2025-01-24 130/week @ 2025-01-31 122/week @ 2025-02-07 142/week @ 2025-02-14 145/week @ 2025-02-21 106/week @ 2025-02-28

532 downloads per month
Used in 3 crates (via wayrs-utils)

MIT/Apache

8KB
51 lines

shmemfdrs2

Fork of shmemfdrs.

Provides a single function

pub fn create_shmem<T: AsRef<CStr>>(name: T) -> io::Result<File>;
  • On Linux memfd_create is used.
  • On FreeBSD shm_open with SHM_ANON is used.
  • Other platform use shm_open followed by shm_unlink.

License

Licensed under the Apache License, Version 2.0 < LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0 > or the MIT license < LICENSE-MIT or https://opensource.org/licenses/MIT >, at your option.

Dependencies

~43KB