@@ -462,16 +462,27 @@ impl UnixStream {
462
462
/// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
463
463
///
464
464
/// 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
+ /// ```
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 set_acceptfilter ( & self , name : & CStr ) -> io:: Result < ( ) > {
468
479
self . 0 . set_acceptfilter ( name)
469
480
}
470
481
471
482
/// Get a filter name if one had been set previously on the socket.
472
483
///
473
484
#[ cfg( any( doc, target_os = "netbsd" , target_os = "freebsd" ) ) ]
474
- #[ unstable( feature = "acceptfilter" , issue = "none " ) ]
485
+ #[ unstable( feature = "acceptfilter" , issue = "121891 " ) ]
475
486
pub fn acceptfilter ( & self ) -> io:: Result < & CStr > {
476
487
self . 0 . acceptfilter ( )
477
488
}
0 commit comments