#shared-memory #ipc #memfd #file-descriptor #shm-anon #shm #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

#1076 in Unix APIs

Download history 143/week @ 2024-08-26 129/week @ 2024-09-02 121/week @ 2024-09-09 105/week @ 2024-09-16 121/week @ 2024-09-23 115/week @ 2024-09-30 245/week @ 2024-10-07 170/week @ 2024-10-14 144/week @ 2024-10-21 100/week @ 2024-10-28 103/week @ 2024-11-04 403/week @ 2024-11-11 131/week @ 2024-11-18 112/week @ 2024-11-25 131/week @ 2024-12-02 133/week @ 2024-12-09

554 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