From owner-freebsd-current@FreeBSD.ORG Tue Jun 13 19:55:23 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C872316A41B; Tue, 13 Jun 2006 19:55:23 +0000 (UTC) (envelope-from mi+mx@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CC9E43D48; Tue, 13 Jun 2006 19:55:22 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by aldan.algebra.com (8.13.6/8.13.6) with ESMTP id k5DJtKZY018488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Jun 2006 15:55:21 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from [172.21.130.86] (mx-broadway [38.98.68.18]) by corbulon.video-collage.com (8.13.6/8.13.6) with ESMTP id k5DJtEnV054105 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Jun 2006 15:55:15 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: current@freebsd.org Date: Tue, 13 Jun 2006 15:55:08 -0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606131555.09143.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV 0.88/1536/Mon Jun 12 17:07:37 2006 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 X-Mailman-Approved-At: Tue, 13 Jun 2006 20:50:50 +0000 Cc: jmg@freebsd.org Subject: EVFILT_VNODE vs. fstat() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jun 2006 19:55:23 -0000 Hello! I have a program, that waits for the input file to be written to (using EVFILT_VNODE, fflags = NOTE_EXTEND) to process it. When kevent() returns upon the file's extension, the program calls fstat() to learn the new size of the file. Every once in a while, the fstat still reports the old size and my program goes into kevent() once again. Is this discrepancy "normal"? Thanks! -mi P.S. I would love to avoid having to call fstat() at all, but -- unlike EVFILT_READ -- the EVFILT_VNODE/NOTE_EXTEND does not place any additional results into the event's data :-( Using EVFILT_READ is not straigtforward either, because I mmap input, instead of read-ing it...