Problem with select(2) in single threaded runtime.

Herbert Valerio Riedel hvriedel at gmail.com
Tue Nov 4 08:34:48 UTC 2014


On 2014-11-04 at 07:42:11 +0100, Merijn Verstraaten wrote:
> Worse, it appears the maximum size of time_t is unrelated to the
> maximum value accepted by select(2). 

Fwiw, I found the following on
http://pubs.opengroup.org/onlinepubs/009695399/functions/pselect.html

,----
| Implementations may place limitations on the maximum timeout interval
| supported. All implementations shall support a maximum timeout interval
| of at least 31 days. If the timeout argument specifies a timeout
| interval greater than the implementation-defined maximum value, the
| maximum value shall be used as the actual timeout value. Implementations
| may also place limitations on the granularity of timeout intervals. If
| the requested timeout interval requires a finer granularity than the
| implementation supports, the actual timeout interval shall be rounded up
| to the next supported value.
`----

So I'm a bit surprised you get an EINVAL instead of the timeout being
capped to the implementation's max supported value.

Was the passed `timeval` structure valid? I.e. is the tv_usec value inside
the [0,1e6-1] range? and was tv_sec>=0 ?


More information about the ghc-devs mailing list