summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/net/socket.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/rustix/src/net/socket.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/net/socket.rs')
-rw-r--r--vendor/rustix/src/net/socket.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/rustix/src/net/socket.rs b/vendor/rustix/src/net/socket.rs
index 8727ca53b..fe7439562 100644
--- a/vendor/rustix/src/net/socket.rs
+++ b/vendor/rustix/src/net/socket.rs
@@ -453,6 +453,44 @@ pub fn connect_unix<Fd: AsFd>(sockfd: Fd, addr: &SocketAddrUnix) -> io::Result<(
backend::net::syscalls::connect_unix(sockfd.as_fd(), addr)
}
+/// `connect(sockfd, {.sa_family = AF_UNSPEC}, sizeof(struct sockaddr))`
+/// — Dissolve the socket's association.
+///
+/// On UDP sockets, BSD platforms report [`Errno::AFNOSUPPORT`] or
+/// [`Errno::INVAL`] even if the disconnect was successful.
+///
+/// # References
+/// - [Beej's Guide to Network Programming]
+/// - [POSIX]
+/// - [Linux]
+/// - [Apple]
+/// - [Winsock2]
+/// - [FreeBSD]
+/// - [NetBSD]
+/// - [OpenBSD]
+/// - [DragonFly BSD]
+/// - [illumos]
+/// - [glibc]
+///
+/// [Beej's Guide to Network Programming]: https://beej.us/guide/bgnet/html/split/system-calls-or-bust.html#connect
+/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html
+/// [Linux]: https://man7.org/linux/man-pages/man2/connect.2.html
+/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/connect.2.html
+/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=connect&sektion=2
+/// [NetBSD]: https://man.netbsd.org/connect.2
+/// [OpenBSD]: https://man.openbsd.org/connect.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=connect&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/connect
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Connecting.html
+/// [`Errno::AFNOSUPPORT`]: io::Errno::AFNOSUPPORT
+/// [`Errno::INVAL`]: io::Errno::INVAL
+#[inline]
+#[doc(alias = "connect")]
+pub fn connect_unspec<Fd: AsFd>(sockfd: Fd) -> io::Result<()> {
+ backend::net::syscalls::connect_unspec(sockfd.as_fd())
+}
+
/// `listen(fd, backlog)`—Enables listening for incoming connections.
///
/// # References