1 Commits

Author SHA1 Message Date
Dan Gohman 5cda795470 Fix the get/set-timeout getsockopt/getsockopt calls.
Qemu doesn't yet support `SO_RCVTIMEO_NEW`/`SO_SENDTIMEO_NEW`, and it
unfortunately returns a bogus int instead of properly failing. For now,
patch qemu to fail in this case. The qemu bug is now reported
upstream [here].

[here]: https://gitlab.com/qemu-project/qemu/-/issues/885

And, when converting from nanoseconds to microseconds for the `*_OLD`
calls, round up rather than rounding down, so that the resulting timeout
is at least as long as requested.

Make the time conversion in `set_socket_linger` round up.

And, add tests for `set_socket_linger` and several other sockopt calls.
2022-02-28 09:03:31 -08:00