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

Function bind

src/backend/libc/net/syscalls.rs:138–148  ·  view source on GitHub ↗
(sockfd: BorrowedFd<'_>, addr: &impl SocketAddrArg)

Source from the content-addressed store, hash-verified

136}
137
138pub(crate) fn bind(sockfd: BorrowedFd<'_>, addr: &impl SocketAddrArg) -> io::Result<()> {
139 unsafe {
140 addr.with_sockaddr(|addr_ptr, addr_len| {
141 ret(c::bind(
142 borrowed_fd(sockfd),
143 addr_ptr.cast(),
144 bitcast!(addr_len),
145 ))
146 })
147 }
148}
149
150pub(crate) fn connect(sockfd: BorrowedFd<'_>, addr: &impl SocketAddrArg) -> io::Result<()> {
151 unsafe {

Callers

nothing calls this directly

Calls 3

borrowed_fdFunction · 0.85
retFunction · 0.50
with_sockaddrMethod · 0.45

Tested by

no test coverage detected