Fix timeout handling in _hurd_select
authorRichard Braun <rbraun@sceen.net>
Mon, 29 Oct 2018 20:36:01 +0000 (20:36 +0000)
committerSamuel Thibault <sthibault@debian.org>
Mon, 29 Oct 2018 20:36:01 +0000 (20:36 +0000)
commited523214d28edd41d51f18c603eda5bca2b66ca9
treeeca86b77a869d446ee444fb2fd17df223913e1a8
parent3720be210b4f7924a5e531ea316707277d3497bd
Fix timeout handling in _hurd_select

Rely on servers to implement timeouts, so that very short values (including
0) don't make mach_msg return before valid replies can be received. The
purpose of this scheme is to guarantee a full client-server round-trip,
whatever the timeout value.

This change depends on the new io_select_timeout RPC being implemented by
servers.

* hurd/Makefile (user-interfaces): Add io_reply and io_request.
* hurd/hurdselect.c: Include <sys/time.h>, <hurd/io_request.h> and <limits.h>.
(_hurd_select): Replace the call to __io_select with either __io_select_request
or __io_select_timeout_request, depending on the timeout. Count the number of
ready descriptors (replies for which at least one type bit is set). Implement
the timeout locally when there is no file descriptor.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name tg-io_select_timeout.diff
hurd/Makefile
hurd/hurdselect.c