From 228f80f471a6aac4a4c41ef71a5360e9d3385365 Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 5 Nov 2000 07:31:17 +0000 Subject: Fix getdents syscall. The offset field in struct dirent was set to the offset of the next dirent in rev 1.36. The offset was calculated from the current offset and the record length. This offset does not necessarily match the real offset when we are using cookies. Therefore, also use the cookies to set the offset field in struct dirent if we're using cookies to iterate through the dirents. --- sys/compat/linux/linux_file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/compat') diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 8fe7978..7b121bd 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -508,7 +508,10 @@ again: linux_dirent.doff = (linux_off_t) linuxreclen; linux_dirent.dreclen = (u_short) bdp->d_namlen; } else { - linux_dirent.doff = (linux_off_t)(off + reclen); + if (cookiep) + linux_dirent.doff = (linux_off_t)*cookiep; + else + linux_dirent.doff = (linux_off_t)(off + reclen); linux_dirent.dreclen = (u_short) linuxreclen; } strcpy(linux_dirent.dname, bdp->d_name); -- cgit v1.1