Subject: Re: bpf, block versus nonblock?
To: Stephen M. Jones <email@example.com>
From: Andrew Brown <firstname.lastname@example.org>
Date: 05/14/2002 13:09:49
>Has anyone successfully used a bpf in nonblock mode? The manpage
>states that an ioctl BIOCIMMEDIATE is necessary to switch from
>block (default behaviour) to nonblock.
BIOCIMMEDIATE doesn't switch from blocking to non-blocking, it
switches the bpf from "return as much data as possible to each read()"
to "return a packet as soon as it arrives". they both block, but one
returns immediately after the receipt of a packet.
>The ioctl in the code I'm working with seems perform the switch without
>error, however when I go to use the device I get
>EAGAIN errno 35 resource temporarily unavailable
that seems to make sense to me. if there's nothing to read, but you
expect something at some point, it's "temporarily unavailable".
|-----< "CODE WARRIOR" >-----|
email@example.com * "ah! i see you have the internet
firstname.lastname@example.org (Andrew Brown) that goes *ping*!"
email@example.com * "information is power -- share the wealth."