Date: Fri, 14 Dec 2001 14:17:54 -0800 (PST) From: John Polstra <jdp@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/net bpf.c bpfdesc.h Message-ID: <200112142217.fBEMHsh68476@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
jdp 2001/12/14 14:17:54 PST
Modified files:
sys/net bpf.c bpfdesc.h
Log:
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
Revision Changes Path
1.86 +53 -6 src/sys/net/bpf.c
1.19 +8 -1 src/sys/net/bpfdesc.h
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112142217.fBEMHsh68476>
