File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,7 @@ pub(crate) fn accept(fd: SysSocket) -> io::Result<(SysSocket, SockAddr)> {
331
331
} )
332
332
}
333
333
334
+ /// Unix only API.
334
335
impl crate :: Socket {
335
336
/// Accept a new incoming connection from this listener.
336
337
///
@@ -381,8 +382,12 @@ impl crate::Socket {
381
382
fcntl_add ( self . inner , libc:: FD_CLOEXEC )
382
383
}
383
384
384
- /// Sets `SO_NOSIGPIPE` to one.
385
- #[ cfg( target_vendor = "apple" ) ]
385
+ /// Sets `SO_NOSIGPIPE` on the socket.
386
+ ///
387
+ /// # Notes
388
+ ///
389
+ /// Only supported on Apple platforms (`target_vendor = "apple"`).
390
+ #[ cfg( all( feature = "all" , target_vendor = "apple" ) ) ]
386
391
pub fn set_nosigpipe ( & self ) -> io:: Result < ( ) > {
387
392
unsafe { setsockopt ( self . inner , libc:: SOL_SOCKET , libc:: SO_NOSIGPIPE , 1i32 ) }
388
393
}
@@ -399,7 +404,7 @@ fn fcntl_add(fd: SysSocket, flag: c_int) -> io::Result<()> {
399
404
}
400
405
}
401
406
402
- #[ cfg( target_vendor = "apple" ) ]
407
+ #[ cfg( all ( feature = "all" , target_vendor = "apple" ) ) ]
403
408
unsafe fn setsockopt < T > ( fd : SysSocket , opt : c_int , val : c_int , payload : T ) -> io:: Result < ( ) >
404
409
where
405
410
T : Copy ,
You can’t perform that action at this time.
0 commit comments