Skip to content

Allow to borrow a file descriptor without taking ownership #29

@cmeissl

Description

@cmeissl

When operating on external provided file descriptors it would be useful if it was possible to create a Memfd that does not
take ownership of the file descriptor.

For example in a graphics pipeline the file descriptor is transported in a separate structure that has the ownership of the
file descriptor. Within the pipeline a filter wants to operate on the file descriptor using Memfd.

impl Filter for GraphicsPipeline {
  fn filter(&self, memory: &Memory) -> Result<(), Error> {
    let mfd = Memfd::try_borrow_from(memory.fd())?;
   ...
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions