about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorChris Copeland <chris@chrisnc.net>2022-02-16 22:02:58 -0800
committerChris Copeland <chris@chrisnc.net>2022-02-20 21:27:36 -0800
commitb02698c7e6843d6feacc394cb7f83f3fc347c3e2 (patch)
tree421215188003253132cd99c83644672fd17bd20a /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parentf2ebd0a11fd7ed131d669fcac20fa3b8df642f39 (diff)
downloadrust-b02698c7e6843d6feacc394cb7f83f3fc347c3e2.tar.gz
rust-b02698c7e6843d6feacc394cb7f83f3fc347c3e2.zip
use `BOOL` for `TCP_NODELAY` `setsockopt` value on Windows
This issue was found by the Wine project and mitigated there [1].

Windows' documented interface for `setsockopt` expects a `BOOL` (a
`typedef` for `int`) for `TCP_NODELAY` [2]. Windows is forgiving and
will accept any positive length and interpret the first byte of
`*option_value` as the value, so this bug does not affect Windows
itself, but does affect systems implementing Windows' interface more
strictly, such as Wine. Wine was previously passing this through to the
host's `setsockopt`, where, e.g., Linux requires that `option_len` be
correct for the chosen option, and `TCP_NODELAY` expects an `int`.

[1]: https://source.winehq.org/git/wine.git/commit/d6ea38f32dfd3edbe107a255c37e9f7f3da06ae7
[2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-setsockopt
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions