Skip to main content

readonly_memfd

Function readonly_memfd 

Source
fn readonly_memfd(name: &str, content: &[u8]) -> Result<i32, i32>
Expand description

A read-only descriptor on a memfd holding content.

The caller asked for a read-only file and a memfd is read-write, so the writable descriptor is re-opened read-only through /proc/self/fd and dropped, which keeps F_GETFL truthful.

ยงArguments

  • name - Name of the memfd, for diagnostics.
  • content - Bytes the file holds.