From owner-freebsd-emulation@FreeBSD.ORG Tue Sep 18 16:44:54 2007 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 A230316A420; Tue, 18 Sep 2007 16:44:54 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from mail.ipt.ru (mail.ipt.ru [194.62.233.102]) by mx1.freebsd.org (Postfix) with ESMTP id 4C52513C4A3; Tue, 18 Sep 2007 16:44:54 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from srv.sem.ipt.ru ([192.168.12.1] helo=ipt.ru) by mail.ipt.ru with esmtp (Exim 4.62 (FreeBSD)) (envelope-from ) id 1IXgBu-000KZS-3L; Tue, 18 Sep 2007 20:44:50 +0400 Received: from bsam by ipt.ru with local (Exim 4.63 (FreeBSD)) (envelope-from ) id 1IXgDM-000C1n-9O; Tue, 18 Sep 2007 20:46:20 +0400 To: Roman Divacky References: <64815375@srv.sem.ipt.ru> <46EF62C5.5090704@gmail.com> <00483937@srv.sem.ipt.ru> <46EF7E05.5040405@gmail.com> <20070918074332.GA30053@freebsd.org> <88000019@srv.sem.ipt.ru> <20070918082119.GA30932@freebsd.org> <89768331@srv.sem.ipt.ru> <20070918111743.GA37861@freebsd.org> <89761386@srv.sem.ipt.ru> <20070918135744.GA43757@freebsd.org> From: Boris Samorodov Date: Tue, 18 Sep 2007 20:46:20 +0400 In-Reply-To: <20070918135744.GA43757@freebsd.org> (Roman Divacky's message of "Tue\, 18 Sep 2007 15\:57\:44 +0200") Message-ID: <07670131@srv.sem.ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.99 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, sam Subject: Re: linuxolator problem on i386 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: Tue, 18 Sep 2007 16:44:54 -0000 On Tue, 18 Sep 2007 15:57:44 +0200 Roman Divacky wrote: > On Tue, Sep 18, 2007 at 05:38:45PM +0400, Boris Samorodov wrote: > > On Tue, 18 Sep 2007 13:17:43 +0200 Roman Divacky wrote: > > > > > also.. please tell me the value of the "count" argument to the > > > getdents() syscall that the program emits and possibly alter the > > > getdents.c to use the same value ;) > > > > Roman, didn't understand that. Can you elaborate, please? > instead of > while ((error = getdents(fd, buf, MAX*sizeof(struct dirent))) > 0) { > put there > while ((error = getdents(fd, buf, 4096)) > 0) { OK. I used 1024. With 4096 the whole directory is readed by one iteration. Here are the results: ----- [...] 9861 getdents CALL munmap(0x28064000,0x40) 9861 getdents RET munmap 0 9861 getdents CALL linux_stat64(0x80486e4,0xbfbfd9d4,0x281a3ff4) 9861 getdents NAMI "." 9861 getdents RET linux_stat64 0 9861 getdents CALL linux_open(0x80486e4,0,0) 9861 getdents NAMI "." 9861 getdents RET linux_open 3 9861 getdents CALL linux_getdents(0x3,0xbfbfdb00,0x400) 9861 getdents RET linux_getdents 1020/0x3fc 9861 getdents CALL linux_fstat64(0x1,0xbfbfd350,0x281a3ff4) 9861 getdents RET linux_fstat64 0 9861 getdents CALL linux_mmap2(0,0x1000,0x3,0x22,0xffffffff,0) 9861 getdents RET linux_mmap2 671498240/0x28064000 9861 getdents CALL linux_getdents(0x3,0xbfbfdb00,0x400) 9861 getdents RET linux_getdents 632/0x278 9861 getdents CALL linux_getdents(0x3,0xbfbfdb00,0x400) 9861 getdents RET linux_getdents 1004/0x3ec 9861 getdents CALL linux_getdents(0x3,0xbfbfdb00,0x400) 9861 getdents RET linux_getdents 648/0x288 9861 getdents CALL linux_getdents(0x3,0xbfbfdb00,0x400) 9861 getdents RET linux_getdents 1000/0x3e8 9861 getdents CALL linux_getdents(0x3,0xbfbfdb00,0x400) 9861 getdents RET linux_getdents 300/0x12c 9861 getdents CALL linux_getdents(0x3,0xbfbfdb00,0x400) 9861 getdents RET linux_getdents 0 9861 getdents CALL close(0x3) 9861 getdents RET close 0 9861 getdents CALL write(0x1,0x28064000,0xa4c) 9861 getdents GIO fd 1 wrote 2636 bytes ". .. ak47-1.wav ak47-2.wav [...] ----- The result is 2636 bytes long (including . and .. I didn't took them into consideration last lime). Your program seems to work as expected. Are those numbers for getdents() 632, 1004, etc. have sense? BTW, seems the real programm deals with full paths though. WBR -- Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone & Internet SP FreeBSD committer, http://www.FreeBSD.org The Power To Serve