Subject: Re: bpf, block versus nonblock?
To: Stephen M. Jones <smj@cirr.com>
From: Andrew Brown <atatat@atatdot.net>
List: port-alpha
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" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."