Skip to content

Commit 5a503e7

Browse files
committed
update from tracking issue
1 parent 44102a8 commit 5a503e7

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
@@ -875,16 +875,27 @@ impl UnixDatagram {
875875
/// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
876876
///
877877
/// an empty name allows to remove this connection's filter
878+
#[cfg_attr(any(target_os = "freebsd", target_os = "netbsd"), doc = "```no_run")]
879+
#[cfg_attr(not(any(target_os = "freebsd", target_os = "netbsd")), doc = "```ignore")]
880+
/// #![feature(unix_set_mark)]
881+
/// use std::os::unix::net::UnixDatagram;
882+
///
883+
/// fn main() -> std::io::Result<()> {
884+
/// let sock = UnixDatagram::unbound()?;
885+
/// sock.set_acceptfilter(&c"data")?;
886+
/// Ok(())
887+
/// }
888+
/// ```
878889
#[cfg(any(doc, target_os = "netbsd", target_os = "freebsd"))]
879-
#[unstable(feature = "acceptfilter", issue = "none")]
890+
#[unstable(feature = "acceptfilter", issue = "121891")]
880891
pub fn set_acceptfilter(&self, name: &CStr) -> io::Result<()> {
881892
self.0.set_acceptfilter(name)
882893
}
883894

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

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,27 @@ impl UnixStream {
452452
/// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
453453
///
454454
/// an empty name allows to remove this connection's filter
455+
#[cfg_attr(any(target_os = "freebsd", target_os = "netbsd"), doc = "```no_run")]
456+
#[cfg_attr(not(any(target_os = "freebsd", target_os = "netbsd")), doc = "```ignore")]
457+
/// #![feature(unix_set_mark)]
458+
/// use std::os::unix::net::UnixStream;
459+
///
460+
/// fn main() -> std::io::Result<()> {
461+
/// let sock = UnixStream::connect("/tmp/sock")?;
462+
/// sock.set_acceptfilter(&c"http")?;
463+
/// Ok(())
464+
/// }
465+
/// ```
455466
#[cfg(any(doc, target_os = "netbsd", target_os = "freebsd"))]
456-
#[unstable(feature = "acceptfilter", issue = "none")]
467+
#[unstable(feature = "acceptfilter", issue = "121891")]
457468
pub fn set_acceptfilter(&self, name: &CStr) -> io::Result<()> {
458469
self.0.set_acceptfilter(name)
459470
}
460471

461472
/// Get a filter name if one had been set previously on the socket.
462473
///
463474
#[cfg(any(doc, target_os = "netbsd", target_os = "freebsd"))]
464-
#[unstable(feature = "acceptfilter", issue = "none")]
475+
#[unstable(feature = "acceptfilter", issue = "121891")]
465476
pub fn acceptfilter(&self) -> io::Result<&CStr> {
466477
self.0.acceptfilter()
467478
}

0 commit comments

Comments
 (0)