From owner-freebsd-hackers Fri Mar 23 14:45:13 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id DB0E537B71A for ; Fri, 23 Mar 2001 14:45:07 -0800 (PST) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id OAA07850; Fri, 23 Mar 2001 14:35:21 -0800 (PST) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.1/8.11.1) id f2NMYmf28390; Fri, 23 Mar 2001 14:34:48 -0800 (PST) (envelope-from archie) From: Archie Cobbs Message-Id: <200103232234.f2NMYmf28390@arch20m.dellroad.org> Subject: Re: question about BPF programming In-Reply-To: <99d8mo$2cbo$1@igloo.uran.net.ua> "from Andrey Simonenko at Mar 22, 2001 06:15:50 pm" To: Andrey Simonenko Date: Fri, 23 Mar 2001 14:34:48 -0800 (PST) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Andrey Simonenko writes: > I read bpf(4) man page and have one question about BPF. > Suppose I open one of free BPF devices /dev/bpf??. I can dup(2) > descriptor of opened BPF device and get so called shared interface. > > Can I setup different filters on each descriptor for opened BPF device? Nope. Quoting dup(2): The object referenced by the descriptor does not distinguish between oldd and newd in any way. Thus if newd and oldd are duplicate references to an open file, read(2), write(2) and lseek(2) calls all move a single pointer into the file, and append mode, non-blocking I/O and asynchronous I/O options are shared between the references. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message