#memfd #shared-memory #shm #ipc

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

#956 in Unix APIs

Download history 162/week @ 2024-07-21 148/week @ 2024-07-28 182/week @ 2024-08-04 141/week @ 2024-08-11 113/week @ 2024-08-18 126/week @ 2024-08-25 149/week @ 2024-09-01 129/week @ 2024-09-08 96/week @ 2024-09-15 121/week @ 2024-09-22 117/week @ 2024-09-29 232/week @ 2024-10-06 177/week @ 2024-10-13 148/week @ 2024-10-20 104/week @ 2024-10-27 112/week @ 2024-11-03

573 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

~44KB