Skip to main content

adopt_scm_fd

Function adopt_scm_fd 

Source
pub fn adopt_scm_fd(raw: RawFd) -> OwnedFd
Expand description

Adopt a raw descriptor received via SCM_RIGHTS into an owned handle.

The kernel duplicates ancillary-data descriptors into the receiving process on delivery, transferring their single reference — whoever calls this must adopt them (here) or close them (leak). This is the single audit point for that ownership transfer in this crate.