@@ -452,16 +452,27 @@ impl UnixStream {
452
452
/// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
453
453
///
454
454
/// 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
+ /// ```
455
466
#[ cfg( any( doc, target_os = "netbsd" , target_os = "freebsd" ) ) ]
456
- #[ unstable( feature = "acceptfilter" , issue = "none " ) ]
467
+ #[ unstable( feature = "acceptfilter" , issue = "121891 " ) ]
457
468
pub fn set_acceptfilter ( & self , name : & CStr ) -> io:: Result < ( ) > {
458
469
self . 0 . set_acceptfilter ( name)
459
470
}
460
471
461
472
/// Get a filter name if one had been set previously on the socket.
462
473
///
463
474
#[ cfg( any( doc, target_os = "netbsd" , target_os = "freebsd" ) ) ]
464
- #[ unstable( feature = "acceptfilter" , issue = "none " ) ]
475
+ #[ unstable( feature = "acceptfilter" , issue = "121891 " ) ]
465
476
pub fn acceptfilter ( & self ) -> io:: Result < & CStr > {
466
477
self . 0 . acceptfilter ( )
467
478
}
0 commit comments