Subject: Re: bpf, block versus nonblock?
To: Stephen M. Jones <firstname.lastname@example.org>
From: Andrew Brown <email@example.com>
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" >-----|
firstname.lastname@example.org * "ah! i see you have the internet
email@example.com (Andrew Brown) that goes *ping*!"
firstname.lastname@example.org * "information is power -- share the wealth."