MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / associate_fd

Function associate_fd

src/event/port.rs:90–103  ·  view source on GitHub ↗
(
    port: Fd,
    object: RawFd,
    events: PollFlags,
    userdata: *mut ffi::c_void,
)

Source from the content-addressed store, hash-verified

88/// [illumos]: https://illumos.org/man/3C/port_associate
89#[doc(alias = "port_associate")]
90pub unsafe fn associate_fd<Fd: AsFd, RawFd: AsRawFd>(
91 port: Fd,
92 object: RawFd,
93 events: PollFlags,
94 userdata: *mut ffi::c_void,
95) -> io::Result<()> {
96 syscalls::port_associate(
97 port.as_fd(),
98 c::PORT_SOURCE_FD,
99 object.as_raw_fd() as _,
100 events.bits() as _,
101 userdata.cast(),
102 )
103}
104
105/// `port_dissociate(_, PORT_SOURCE_FD, _)`—Dissociates a file descriptor
106/// from a port.

Callers 1

mainFunction · 0.85

Calls 3

port_associateFunction · 0.85
as_fdMethod · 0.45
as_raw_fdMethod · 0.45

Tested by

no test coverage detected