#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

#919 in Unix APIs

Download history 83/week @ 2024-03-11 96/week @ 2024-03-18 63/week @ 2024-03-25 61/week @ 2024-04-01 41/week @ 2024-04-08 149/week @ 2024-04-15 52/week @ 2024-04-22 202/week @ 2024-04-29 83/week @ 2024-05-06 48/week @ 2024-05-13 57/week @ 2024-05-20 55/week @ 2024-05-27 57/week @ 2024-06-03 52/week @ 2024-06-10 62/week @ 2024-06-17 59/week @ 2024-06-24

241 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