From owner-freebsd-emulation@FreeBSD.ORG Mon Feb 25 09:02:01 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976CA16A40E for ; Mon, 25 Feb 2008 09:02:01 +0000 (UTC) (envelope-from samflanker@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 221C113C4D3 for ; Mon, 25 Feb 2008 09:02:00 +0000 (UTC) (envelope-from samflanker@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so1174005fgg.35 for ; Mon, 25 Feb 2008 01:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; bh=yqEejgGgpNMHTC2rMGSqlBHCqeRY1nRrGiJrIc9Wy0Q=; b=OQuow6ZdwJXYj+o9KVK/gYvUyAcBkJlZCtF5gmObndTaIvmKdpVuGXrnMl4lgr2tqTi/Ev9y6jpW6K7BfmoX4jl8SpROlmjdfX9r3jyGcnQUoLIbPxmZ+N938nkaU4o29MvfEy3YCw4exUiR4V1qkVKXfKc+NRpKef3rVfcCttY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=OOuAqjBpEOmK7klMpUlwsQcI3fQqv1OSEzTn6gaip9q1SeAu2/Bg9mKPi4HNy2ql5fRwO77E0JPC8Yl2TudpBQznceeXBvH4JJjkyYnEDbDCvzcQc0WBeLGtG9SMrjn9obsITF+QdvQuTo7CjT1buLNzKqMFFiDRPnQ9Zl5+yC4= Received: by 10.86.81.14 with SMTP id e14mr2621372fgb.42.1203928564857; Mon, 25 Feb 2008 00:36:04 -0800 (PST) Received: from ?192.168.12.92? ( [217.74.44.57]) by mx.google.com with ESMTPS id e20sm5928248fga.1.2008.02.25.00.36.03 (version=SSLv3 cipher=RC4-MD5); Mon, 25 Feb 2008 00:36:04 -0800 (PST) Message-ID: <47C27DF2.8060509@gmail.com> Date: Mon, 25 Feb 2008 11:36:02 +0300 From: sam User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: freebsd-emulation@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: info for discussion of syscall getdents() kern/117010 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 09:02:01 -0000 hi all links to similar problems: http://mail-index.netbsd.org/current-users/2005/11/13/0011.html > bug (+fix) in getdents + readdir > o We're not sure what the Linux kernel intended to place in this field, > but our experience shows that on "real" file systems (that actually > reside on some disk) the offset seems to be a simple (not necessarily > continuous) counter: e.g. first entry may have d_off=1, second: d_off=2, > third: d_off=4096, fourth=d_off=4097 etc. We conjecture this is the > serial of the dirent record within the directory (and so, this is indeed > the "offset", but counted in records out of which some were already > removed). > - In such an "overflow" situation, getdents() tries to lseek (the > directory-fd) to the end of the last-legal-dirent that getdents() > has successfully read. > This offset is supposedly held by the local variable `last_offset'. > But, since `last_offset' is assigned with `d_off' on each iteration, > and since as mentioned above `d_off' usually holds an incorrect value, > the lseek is not performed to the correct place. > getdents() then returns the number of bytes successfully read. http://sources.redhat.com/ml/libc-alpha/2004-02/msg00013.html /Vladimir Ermakov