John Polstra 81bda851db Make bpf's read timeout feature work more correctly with
select/poll, and therefore with pthreads.  I doubt there is any way
to make this 100% semantically identical to the way it behaves in
unthreaded programs with blocking reads, but the solution here
should do the right thing for all reasonable usage patterns.

The basic idea is to schedule a callout for the read timeout when a
select/poll is done.  When the callout fires, it ends the select if
it is still in progress, or marks the state as "timed out" if the
select has already ended for some other reason.  Additional logic in
bpfread then does the right thing in the case where the timeout has
fired.

Note, I co-opted the bd_state member of the bpf_d structure.  It has
been present in the structure since the initial import of 4.4-lite,
but as far as I can tell it has never been used.

PR:		kern/22063 and bin/31649
MFC after:	3 days
2001-12-14 22:17:54 +00:00
..
2001-12-14 19:28:06 +00:00
2001-12-14 19:28:06 +00:00
2001-09-26 23:50:17 +00:00
2001-09-26 23:50:17 +00:00
2001-12-14 19:32:47 +00:00
2001-12-14 19:32:47 +00:00
2001-09-12 08:38:13 +00:00
2001-09-12 08:38:13 +00:00
2001-09-12 08:38:13 +00:00
2001-06-11 12:39:29 +00:00
2001-12-14 19:32:47 +00:00
2001-12-14 19:32:47 +00:00
2001-12-14 17:56:12 +00:00
2001-06-11 12:39:29 +00:00
2001-12-14 17:56:12 +00:00
2001-06-11 12:39:29 +00:00
2001-09-12 08:38:13 +00:00
2001-09-12 08:38:13 +00:00
2001-11-28 16:15:52 +00:00