From owner-freebsd-bugs Thu Aug 15 18:20:11 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D03DD37B400 for ; Thu, 15 Aug 2002 18:20:05 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3B1B43E6A for ; Thu, 15 Aug 2002 18:20:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7G1K4JU061019 for ; Thu, 15 Aug 2002 18:20:04 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7G1K4t1061017; Thu, 15 Aug 2002 18:20:04 -0700 (PDT) Date: Thu, 15 Aug 2002 18:20:04 -0700 (PDT) Message-Id: <200208160120.g7G1K4t1061017@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Lev Walkin Subject: Re: kern/36219: poll() behaves erratic on BPF file descriptors. Reply-To: Lev Walkin Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/36219; it has been noted by GNATS. From: Lev Walkin To: Nate Lawson Cc: freebsd-gnats-submit@FreeBSD.org, gad@freebsd.org, bde@freebsd.org Subject: Re: kern/36219: poll() behaves erratic on BPF file descriptors. Date: Thu, 15 Aug 2002 18:17:37 -0700 Nate Lawson wrote: > I looked over the current state of bpf.c and it seems like this PR can be > closed. Comments? > > if (events & (POLLIN | POLLRDNORM)) { > /* > * An imitation of the FIONREAD ioctl code. > * XXX not quite. An exact imitation: > *if (d->b_slen != 0 || > * (d->bd_hbuf != NULL && d->bd_hlen != 0) > */ > if (d->bd_hlen != 0 || > ((d->bd_immediate || d->bd_state == BPF_TIMED_OUT) && > d->bd_slen != 0)) Don't we want a POLLIN event to occur when the BPF_TIMED_OUT state is reached and there is still no data? This seems to be a timeout on waiting data, which should be reported up. > revents |= events & (POLLIN | POLLRDNORM); > else { > > -Nate > -- Lev Walkin vlm@netli.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message