mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #155284 - RalfJung:net-nonblocking, r=Mark-Simulacrum
net::tcp/udp: fix docs about how set_nonblocking is implemented `fcntl` `FIONBIO` doesn't even make sense, it should be `fcntl` `F_SETFL`. However, for some reason we are using `ioctl` by default -- except on Solaris where this doesn't seem to work very well. Honestly what I would have expected is that we just always use `FileDesc::set_nonblocking` also for network sockets, but for some reason we don't and there are no comments explaining this choice. Cc @nikarh (for "vita") @joboet
This commit is contained in:
@@ -582,8 +582,8 @@ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
|
||||
/// to be retried, an error with kind [`io::ErrorKind::WouldBlock`] is
|
||||
/// returned.
|
||||
///
|
||||
/// On Unix platforms, calling this method corresponds to calling `fcntl`
|
||||
/// `FIONBIO`. On Windows calling this method corresponds to calling
|
||||
/// On most Unix platforms, calling this method corresponds to calling `ioctl`
|
||||
/// `FIONBIO`. On Windows, calling this method corresponds to calling
|
||||
/// `ioctlsocket` `FIONBIO`.
|
||||
///
|
||||
/// # Examples
|
||||
@@ -988,8 +988,8 @@ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
|
||||
/// IO operation could not be completed and needs to be retried, an error
|
||||
/// with kind [`io::ErrorKind::WouldBlock`] is returned.
|
||||
///
|
||||
/// On Unix platforms, calling this method corresponds to calling `fcntl`
|
||||
/// `FIONBIO`. On Windows calling this method corresponds to calling
|
||||
/// On most Unix platforms, calling this method corresponds to calling `ioctl`
|
||||
/// `FIONBIO`. On Windows, calling this method corresponds to calling
|
||||
/// `ioctlsocket` `FIONBIO`.
|
||||
///
|
||||
/// # Examples
|
||||
|
||||
@@ -786,8 +786,8 @@ pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
/// and needs to be retried, an error with kind
|
||||
/// [`io::ErrorKind::WouldBlock`] is returned.
|
||||
///
|
||||
/// On Unix platforms, calling this method corresponds to calling `fcntl`
|
||||
/// `FIONBIO`. On Windows calling this method corresponds to calling
|
||||
/// On most Unix platforms, calling this method corresponds to calling `ioctl`
|
||||
/// `FIONBIO`. On Windows, calling this method corresponds to calling
|
||||
/// `ioctlsocket` `FIONBIO`.
|
||||
///
|
||||
/// # Examples
|
||||
|
||||
Reference in New Issue
Block a user