From owner-freebsd-current Wed Jan 26 7:18:22 2000 Delivered-To: freebsd-current@freebsd.org Received: from ckmso1.proxy.att.com (ckmso1.att.com [12.20.58.69]) by hub.freebsd.org (Postfix) with ESMTP id 9822314ECA; Wed, 26 Jan 2000 07:18:15 -0800 (PST) (envelope-from myevmenkin@att.com) Received: from njb140r1.ems.att.com ([135.65.202.58]) by ckmso1.proxy.att.com (AT&T IPNS/MSO-2.2) with ESMTP id KAA13574; Wed, 26 Jan 2000 10:18:02 -0500 (EST) Received: from njb140bh1.ems.att.com by njb140r1.ems.att.com (8.8.8+Sun/ATTEMS-1.4.1 sol2) id KAA13673; Wed, 26 Jan 2000 10:17:28 -0500 (EST) Received: by njb140bh1.ems.att.com with Internet Mail Service (5.5.2448.0) id ; Wed, 26 Jan 2000 10:18:01 -0500 Message-ID: From: "Yevmenkin, Maksim N, CSCIO" To: "'Bruce Evans'" Cc: "'freebsd-current@freebsd.org'" , "'freebsd-hackers@freebsd.org'" Subject: RE: BPF bug or not? Date: Wed, 26 Jan 2000 10:17:53 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Bruce, [...] > > 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: [ untested fix removed :) ] Yes, it works. But it returns EAGAIN for both O_RDONLY|O_NONBLOCK and O_RDWR|O_NONBLOCK open modes. In the same time pipe returns 0 for O_RDONLY|O_NONBLOCK mode and EAGAIN for O_RDWR|O_NONBLOCK. It there any specs for "read" system call? I have small problem with blocking read in pthreads under 3.X. Since blocking read implemented as non-blocking inside pthread (libc_r to be honest), returning 0 instead of EAGAIN from read confuses libc_r. It expects EAGAIN. BTW such "blocking" read inside thread gives almost 100% CPU utilization :( thanks, emax To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message