summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/net/send_recv.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/net/send_recv.rs')
-rw-r--r--vendor/rustix/src/net/send_recv.rs112
1 files changed, 112 insertions, 0 deletions
diff --git a/vendor/rustix/src/net/send_recv.rs b/vendor/rustix/src/net/send_recv.rs
index 041077266..439711727 100644
--- a/vendor/rustix/src/net/send_recv.rs
+++ b/vendor/rustix/src/net/send_recv.rs
@@ -11,15 +11,29 @@ pub use backend::net::send_recv::{RecvFlags, SendFlags};
/// `recv(fd, buf, flags)`—Reads data from a socket.
///
/// # 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#sendrecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html
/// [Linux]: https://man7.org/linux/man-pages/man2/recv.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recv.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=recv&sektion=2
+/// [NetBSD]: https://man.netbsd.org/recv.2
+/// [OpenBSD]: https://man.openbsd.org/recv.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=recv&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/recv
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Receiving-Data.html
#[inline]
pub fn recv<Fd: AsFd>(fd: Fd, buf: &mut [u8], flags: RecvFlags) -> io::Result<usize> {
backend::net::syscalls::recv(fd.as_fd(), buf, flags)
@@ -28,15 +42,29 @@ pub fn recv<Fd: AsFd>(fd: Fd, buf: &mut [u8], flags: RecvFlags) -> io::Result<us
/// `send(fd, buf, flags)`—Writes data to a socket.
///
/// # 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#sendrecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html
/// [Linux]: https://man7.org/linux/man-pages/man2/send.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/send.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-send
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=send&sektion=2
+/// [NetBSD]: https://man.netbsd.org/send.2
+/// [OpenBSD]: https://man.openbsd.org/send.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=send&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/send
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Sending-Data.html
#[inline]
pub fn send<Fd: AsFd>(fd: Fd, buf: &[u8], flags: SendFlags) -> io::Result<usize> {
backend::net::syscalls::send(fd.as_fd(), buf, flags)
@@ -46,15 +74,29 @@ pub fn send<Fd: AsFd>(fd: Fd, buf: &[u8], flags: SendFlags) -> io::Result<usize>
/// returns the sender address.
///
/// # 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#sendtorecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html
/// [Linux]: https://man7.org/linux/man-pages/man2/recvfrom.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recvfrom.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recvfrom
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=recvfrom&sektion=2
+/// [NetBSD]: https://man.netbsd.org/recvfrom.2
+/// [OpenBSD]: https://man.openbsd.org/recvfrom.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=recvfrom&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/recvfrom
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Receiving-Datagrams.html
#[inline]
pub fn recvfrom<Fd: AsFd>(
fd: Fd,
@@ -68,15 +110,29 @@ pub fn recvfrom<Fd: AsFd>(
/// address.
///
/// # 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#sendtorecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2
+/// [NetBSD]: https://man.netbsd.org/sendto.2
+/// [OpenBSD]: https://man.openbsd.org/sendto.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendto&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/sendto
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Sending-Datagrams.html
pub fn sendto<Fd: AsFd>(
fd: Fd,
buf: &[u8],
@@ -102,15 +158,29 @@ fn _sendto(
/// address.
///
/// # 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#sendtorecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2
+/// [NetBSD]: https://man.netbsd.org/sendto.2
+/// [OpenBSD]: https://man.openbsd.org/sendto.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendto&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/sendto
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Sending-Datagrams.html
pub fn sendto_any<Fd: AsFd>(
fd: Fd,
buf: &[u8],
@@ -138,15 +208,29 @@ fn _sendto_any(
/// a socket to a specific IPv4 address.
///
/// # 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#sendtorecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2
+/// [NetBSD]: https://man.netbsd.org/sendto.2
+/// [OpenBSD]: https://man.openbsd.org/sendto.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendto&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/sendto
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Sending-Datagrams.html
#[inline]
#[doc(alias = "sendto")]
pub fn sendto_v4<Fd: AsFd>(
@@ -162,15 +246,29 @@ pub fn sendto_v4<Fd: AsFd>(
/// to a socket to a specific IPv6 address.
///
/// # 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#sendtorecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2
+/// [NetBSD]: https://man.netbsd.org/sendto.2
+/// [OpenBSD]: https://man.openbsd.org/sendto.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendto&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/sendto
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Sending-Datagrams.html
#[inline]
#[doc(alias = "sendto")]
pub fn sendto_v6<Fd: AsFd>(
@@ -186,15 +284,29 @@ pub fn sendto_v6<Fd: AsFd>(
/// a socket to a specific Unix-domain socket address.
///
/// # 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#sendtorecv
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=sendto&sektion=2
+/// [NetBSD]: https://man.netbsd.org/sendto.2
+/// [OpenBSD]: https://man.openbsd.org/sendto.2
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sendto&section=2
+/// [illumos]: https://illumos.org/man/3SOCKET/sendto
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Sending-Datagrams.html
#[cfg(unix)]
#[inline]
#[doc(alias = "sendto")]