Date: Mon, 18 Oct 1999 12:23:58 +0930 (CST) From: Mark Newton <newton@internode.com.au> To: ak@freenet.co.uk (Alex) Cc: kurt@boolean.net, freebsd-emulation@FreeBSD.ORG, freebsd-current@FreeBSD.ORG Subject: Re: duplicate filenames under Linux emulation Message-ID: <199910180253.MAA73538@gizmo.internode.com.au> In-Reply-To: <380A9278.638D7FC2@freenet.co.uk> from "Alex" at Oct 18, 99 03:22:32 am
next in thread | previous in thread | raw e-mail | index | archive | help
Alex wrote:
> 444964 -rw-r--r-- 1 ak users 102042 Oct 17 20:23
> bxutils-c.c
> 444964 -rw-r--r-- 1 ak users 102042 Oct 17 20:23
> bxutils-c.c
For what it's worth, I have this bug in the to-do list for the
SVR4 emulator too. It's caused by the fact that dirent structures
for BSD and SysVR4 are of different sizes, so svr4_getdents()
(and svr4_getdents64(), its 64-bit counterpart) fetches a buffer
full of BSD dirent structures from disk (usually more than the number
which have actually been requested) with VOP_READDIR(), rewrites them
into another buffer full of svr4_dirent structures, and returns the
contents of the second buffer to userspace. Next time getdents() is
called the emulated version continues from where it left off in the
first buffer until it has been exhaused, at which point it issues another
VOP_READDIR() call to refresh it.
It looks like the duplicates are the entries which appear on the
boundaries of the buffer first buffer (i.e.: the last directory entry
in a buffer will be re-read into the beginning of the buffer when
VOP_READDIR() is called again).
I haven't had time to examine it in detail, but I suspect that
incrementing an offset parameter for VOP_READDIR() aio request will
fix this bug.
If it does, let me know and I'll fold the result into svr4_getdents()
as well :-)
- mark
----
Mark Newton Email: newton@internode.com.au (W)
Network Engineer Email: newton@atdot.dotat.org (H)
Internode Systems Pty Ltd Desk: +61-8-82232999
"Network Man" - Anagram of "Mark Newton" Mobile: +61-416-202-223
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910180253.MAA73538>
