about summary refs log tree commit diff
path: root/library/std/src/os
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2022-04-23 11:05:31 +0100
committerDavid Carlier <devnexen@gmail.com>2022-07-06 19:52:56 +0100
commit14d288fe125813b130a6571bbf2ae49c5f247174 (patch)
tree4b271d0ff15c82c02d92d6f911d933244138b909 /library/std/src/os
parent5fb8a3926619a18a2e31627e4cdf05f16530b0eb (diff)
socket `set_mark` addition.
to be able to set a marker/id on the socket for network filtering
 (iptables/ipfw here) purpose.
Diffstat (limited to 'library/std/src/os')
-rw-r--r--library/std/src/os/unix/net/stream.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/std/src/os/unix/net/stream.rs b/library/std/src/os/unix/net/stream.rs
index 1d6083e66e1..7eb06be3e09 100644
--- a/library/std/src/os/unix/net/stream.rs
+++ b/library/std/src/os/unix/net/stream.rs
@@ -424,6 +424,12 @@ impl UnixStream {
         self.0.passcred()
     }
 
+    #[cfg(any(doc, target_os = "linux", target_os = "freebsd",))]
+    #[unstable(feature = "unix_set_mark", issue = "none")]
+    pub fn set_mark(&self, mark: u32) -> io::Result<()> {
+        self.0.set_mark(mark)
+    }
+
     /// Returns the value of the `SO_ERROR` option.
     ///
     /// # Examples