@@ -454,16 +454,27 @@ impl UnixStream {
454
454
/// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
455
455
///
456
456
/// an empty name allows to remove this connection's filter
457
+ #[ cfg_attr( any( target_os = "freebsd" , target_os = "netbsd" ) , doc = "```no_run" ) ]
458
+ #[ cfg_attr( not( any( target_os = "freebsd" , target_os = "netbsd" ) ) , doc = "```ignore" ) ]
459
+ /// #![feature(unix_set_mark)]
460
+ /// use std::os::unix::net::UnixStream;
461
+ ///
462
+ /// fn main() -> std::io::Result<()> {
463
+ /// let sock = UnixStream::connect("/tmp/sock")?;
464
+ /// sock.set_acceptfilter(&c"http")?;
465
+ /// Ok(())
466
+ /// }
467
+ /// ```
457
468
#[ cfg( any( doc, target_os = "netbsd" , target_os = "freebsd" ) ) ]
458
- #[ unstable( feature = "acceptfilter" , issue = "none " ) ]
469
+ #[ unstable( feature = "acceptfilter" , issue = "121891 " ) ]
459
470
pub fn set_acceptfilter ( & self , name : & CStr ) -> io:: Result < ( ) > {
460
471
self . 0 . set_acceptfilter ( name)
461
472
}
462
473
463
474
/// Get a filter name if one had been set previously on the socket.
464
475
///
465
476
#[ cfg( any( doc, target_os = "netbsd" , target_os = "freebsd" ) ) ]
466
- #[ unstable( feature = "acceptfilter" , issue = "none " ) ]
477
+ #[ unstable( feature = "acceptfilter" , issue = "121891 " ) ]
467
478
pub fn acceptfilter ( & self ) -> io:: Result < & CStr > {
468
479
self . 0 . acceptfilter ( )
469
480
}
0 commit comments