Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2000 23:53:23 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        "Yevmenkin, Maksim N, CSCIO" <myevmenkin@att.com>
Cc:        "'freebsd-current@freebsd.org'" <freebsd-current@FreeBSD.ORG>, "'freebsd-hackers@freebsd.org'" <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: BPF bug or not?
Message-ID:  <Pine.BSF.4.21.0001252351260.732-100000@alphplex.bde.org>
In-Reply-To: <E598F159668DD311B9C700902799EAF4473376@njb140po01.ems.att.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0001252351260.732-100000>