Skip to content

Commit 05aaa08

Browse files
committed
update from tracking issue
1 parent 3257f18 commit 05aaa08

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

library/std/src/os/unix/net/datagram.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -870,16 +870,27 @@ impl UnixDatagram {
870870
/// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
871871
///
872872
/// an empty name allows to remove this connection's filter
873+
#[cfg_attr(any(target_os = "freebsd", target_os = "netbsd"), doc = "```no_run")]
874+
#[cfg_attr(not(any(target_os = "freebsd", target_os = "netbsd")), doc = "```ignore")]
875+
/// #![feature(unix_set_mark)]
876+
/// use std::os::unix::net::UnixDatagram;
877+
///
878+
/// fn main() -> std::io::Result<()> {
879+
/// let sock = UnixDatagram::unbound()?;
880+
/// sock.set_acceptfilter(&c"data")?;
881+
/// Ok(())
882+
/// }
883+
/// ```
873884
#[cfg(any(doc, target_os = "netbsd", target_os = "freebsd"))]
874-
#[unstable(feature = "acceptfilter", issue = "none")]
885+
#[unstable(feature = "acceptfilter", issue = "121891")]
875886
pub fn set_acceptfilter(&self, name: &CStr) -> io::Result<()> {
876887
self.0.set_acceptfilter(name)
877888
}
878889

879890
/// Get a filter name if one had been set previously on the socket.
880891
///
881892
#[cfg(any(doc, target_os = "netbsd", target_os = "freebsd"))]
882-
#[unstable(feature = "acceptfilter", issue = "none")]
893+
#[unstable(feature = "acceptfilter", issue = "121891")]
883894
pub fn acceptfilter(&self) -> io::Result<&CStr> {
884895
self.0.acceptfilter()
885896
}

library/std/src/os/unix/net/stream.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,27 @@ impl UnixStream {
462462
/// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
463463
///
464464
/// an empty name allows to remove this connection's filter
465+
#[cfg_attr(any(target_os = "freebsd", target_os = "netbsd"), doc = "```no_run")]
466+
#[cfg_attr(not(any(target_os = "freebsd", target_os = "netbsd")), doc = "```ignore")]
467+
/// #![feature(unix_set_mark)]
468+
/// use std::os::unix::net::UnixStream;
469+
///
470+
/// fn main() -> std::io::Result<()> {
471+
/// let sock = UnixStream::connect("/tmp/sock")?;
472+
/// sock.set_acceptfilter(&c"http")?;
473+
/// Ok(())
474+
/// }
475+
/// ```
465476
#[cfg(any(doc, target_os = "netbsd", target_os = "freebsd"))]
466-
#[unstable(feature = "acceptfilter", issue = "none")]
477+
#[unstable(feature = "acceptfilter", issue = "121891")]
467478
pub fn set_acceptfilter(&self, name: &CStr) -> io::Result<()> {
468479
self.0.set_acceptfilter(name)
469480
}
470481

471482
/// Get a filter name if one had been set previously on the socket.
472483
///
473484
#[cfg(any(doc, target_os = "netbsd", target_os = "freebsd"))]
474-
#[unstable(feature = "acceptfilter", issue = "none")]
485+
#[unstable(feature = "acceptfilter", issue = "121891")]
475486
pub fn acceptfilter(&self) -> io::Result<&CStr> {
476487
self.0.acceptfilter()
477488
}

0 commit comments

Comments
 (0)