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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message