File tree 3 files changed +21
-6
lines changed
3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -1404,11 +1404,22 @@ impl Socket {
1404
1404
impl Socket {
1405
1405
/// Get the value of the `TCP_KEEPIDLE` option on this socket.
1406
1406
///
1407
- /// This returns the value of `SO_KEEPALIVE` on OpenBSD and Haiku,
1408
- /// `TCP_KEEPALIVE` on macOS and iOS, and `TCP_KEEPIDLE` on all other Unix
1409
- /// operating systems.
1410
- #[ cfg( any( doc, all( feature = "all" , not( windows) ) ) ) ]
1411
- #[ cfg_attr( docsrs, doc( cfg( all( feature = "all" , not( windows) ) ) ) ) ]
1407
+ /// This returns the value of `TCP_KEEPALIVE` on macOS and iOS and `TCP_KEEPIDLE` on all other
1408
+ /// supported Unix operating systems.
1409
+ #[ cfg( any(
1410
+ doc,
1411
+ all(
1412
+ feature = "all" ,
1413
+ not( any( windows, target_os = "haiku" , target_os = "openbsd" ) )
1414
+ )
1415
+ ) ) ]
1416
+ #[ cfg_attr(
1417
+ docsrs,
1418
+ doc( cfg( all(
1419
+ feature = "all" ,
1420
+ not( any( windows, target_os = "haiku" , target_os = "openbsd" ) )
1421
+ ) ) )
1422
+ ) ]
1412
1423
pub fn keepalive_time ( & self ) -> io:: Result < Duration > {
1413
1424
sys:: keepalive_time ( self . as_raw ( ) )
1414
1425
}
Original file line number Diff line number Diff line change @@ -866,6 +866,7 @@ fn into_timeval(duration: Option<Duration>) -> libc::timeval {
866
866
}
867
867
868
868
#[ cfg( feature = "all" ) ]
869
+ #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" ) ) ) ]
869
870
pub ( crate ) fn keepalive_time ( fd : Socket ) -> io:: Result < Duration > {
870
871
unsafe {
871
872
getsockopt :: < c_int > ( fd, IPPROTO_TCP , KEEPALIVE_TIME )
Original file line number Diff line number Diff line change @@ -729,7 +729,10 @@ fn tcp_keepalive() {
729
729
// Set the parameters.
730
730
socket. set_tcp_keepalive ( & params) . unwrap ( ) ;
731
731
732
- #[ cfg( all( feature = "all" , not( windows) ) ) ]
732
+ #[ cfg( all(
733
+ feature = "all" ,
734
+ not( any( windows, target_os = "haiku" , target_os = "openbsd" ) )
735
+ ) ) ]
733
736
assert_eq ! ( socket. keepalive_time( ) . unwrap( ) , Duration :: from_secs( 200 ) ) ;
734
737
735
738
#[ cfg( all(
You can’t perform that action at this time.
0 commit comments