On Mon, 24 Jan 2000, Yevmenkin, Maksim N, CSCIO wrote:

> All,
> 
> I've just found that read from /dev/bpfX never return EAGAIN/EWOULDBLOCK.
> It means that when you do a non blocking read and there is no data you will
> always get 0.
> 
> Does it suppose work this way?

I think it is a bug.  Perhaps applications depend on it.

Untested fix:

diff -c2 bpf.c~ bpf.c
*** bpf.c~      Sun Jan 16 15:50:59 2000
--- bpf.c       Tue Jan 25 23:44:32 2000
***************
*** 502,506 ****
                        if (d->bd_slen == 0) {
                                splx(s);
!                               return (0);
                        }
                        ROTATE_BUFFERS(d);
--- 504,508 ----
                        if (d->bd_slen == 0) {
                                splx(s);
!                               return (EWOULDBLOCK);
                        }
                        ROTATE_BUFFERS(d);

Bruce



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to