about summary refs log tree commit diff
path: root/library/std/src/sys/unix/ext/net/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-02 17:36:29 +0000
committerbors <bors@rust-lang.org>2020-12-02 17:36:29 +0000
commitaf69066aa6afa7bff771a6ee9548b2b84a02a88a (patch)
treee27f9b8edb3821be445081b430bf38d06704eaaf /library/std/src/sys/unix/ext/net/mod.rs
parenta094ff9590b83c8f94d898f92c2964a5803ded06 (diff)
parent8983752c12c65e598dff704502ad1b0334d1daaa (diff)
downloadrust-af69066aa6afa7bff771a6ee9548b2b84a02a88a.tar.gz
rust-af69066aa6afa7bff771a6ee9548b2b84a02a88a.zip
Auto merge of #69864 - LinkTed:master, r=Amanieu
unix: Extend UnixStream and UnixDatagram to send and receive file descriptors

Add the functions `recv_vectored_fds` and `send_vectored_fds` to `UnixDatagram` and `UnixStream`. With this functions `UnixDatagram` and `UnixStream` can send and receive file descriptors, by using `recvmsg` and `sendmsg` system call.
Diffstat (limited to 'library/std/src/sys/unix/ext/net/mod.rs')
-rw-r--r--library/std/src/sys/unix/ext/net/mod.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/ext/net/mod.rs b/library/std/src/sys/unix/ext/net/mod.rs
new file mode 100644
index 00000000000..3088ffb5e5c
--- /dev/null
+++ b/library/std/src/sys/unix/ext/net/mod.rs
@@ -0,0 +1,54 @@
+//! Unix-specific networking functionality
+
+#![stable(feature = "unix_socket", since = "1.10.0")]
+
+mod addr;
+#[doc(cfg(any(
+    target_os = "android",
+    target_os = "dragonfly",
+    target_os = "emscripten",
+    target_os = "freebsd",
+    target_os = "linux",
+    target_os = "netbsd",
+    target_os = "openbsd",
+)))]
+#[cfg(any(
+    doc,
+    target_os = "android",
+    target_os = "dragonfly",
+    target_os = "emscripten",
+    target_os = "freebsd",
+    target_os = "linux",
+    target_os = "netbsd",
+    target_os = "openbsd",
+))]
+mod ancillary;
+mod datagram;
+mod listener;
+mod raw_fd;
+mod stream;
+#[cfg(all(test, not(target_os = "emscripten")))]
+mod tests;
+
+#[stable(feature = "unix_socket", since = "1.10.0")]
+pub use self::addr::*;
+#[cfg(any(
+    doc,
+    target_os = "android",
+    target_os = "dragonfly",
+    target_os = "emscripten",
+    target_os = "freebsd",
+    target_os = "linux",
+    target_os = "netbsd",
+    target_os = "openbsd",
+))]
+#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
+pub use self::ancillary::*;
+#[stable(feature = "unix_socket", since = "1.10.0")]
+pub use self::datagram::*;
+#[stable(feature = "unix_socket", since = "1.10.0")]
+pub use self::listener::*;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::raw_fd::*;
+#[stable(feature = "unix_socket", since = "1.10.0")]
+pub use self::stream::*;