From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NckrW-0004sc-Ep for qemu-devel@nongnu.org; Wed, 03 Feb 2010 14:26:06 -0500 Received: from [199.232.76.173] (port=43078 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NckrW-0004sU-35 for qemu-devel@nongnu.org; Wed, 03 Feb 2010 14:26:06 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NckrV-00076O-DN for qemu-devel@nongnu.org; Wed, 03 Feb 2010 14:26:05 -0500 Received: from qw-out-1920.google.com ([74.125.92.147]:3731) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NckrV-00076I-4n for qemu-devel@nongnu.org; Wed, 03 Feb 2010 14:26:05 -0500 Received: by qw-out-1920.google.com with SMTP id 14so24468qwa.4 for ; Wed, 03 Feb 2010 11:26:03 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <2e320c2d1002031008y7a01880ay7d17d419b38fb089@mail.gmail.com> References: <2e320c2d1002031003i36bc3848hbb4b030a6dfd4156@mail.gmail.com> <2e320c2d1002031008y7a01880ay7d17d419b38fb089@mail.gmail.com> From: Mulyadi Santosa Date: Thu, 4 Feb 2010 02:25:43 +0700 Message-ID: Subject: Re: [Qemu-devel] [Please discard the previous mail] System call from a Guest Linux Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jong Chun Park Cc: qemu-devel@nongnu.org Hi Jong (Sorry, I am not sure how to politely call a Korean name...so apologize if it turns out to be rude...) On Thu, Feb 4, 2010 at 1:08 AM, Jong Chun Park wrote: > after compilation in the guest OS: > int main() { > =A0=A0 int fd; > =A0=A0 if (access("hello.txt", R_OK) !=3D 0) { > =A0=A0 =A0 exit(0); > =A0=A0 } > =A0=A0 fd=3Dopen("hello.txt", O_RDONLY); > =A0=A0 close(fd); > =A0=A0 return 0; > } > > For this simple sequence of system calls, acess() -> open() -> close(), Q= EMU > goes through disas_insn() and helper_sysenter() more than 3 times. This > makes me really confused because I believed those should be called 3 time= s, > though. It'd be greatly appreciated in advance if someone helps me out th= is. > Thanks a lot, > Jong Try to run that compile and run that code under strace (without using Qemu, I mean), then you'll understand how many system calls are executed. clues: opening certain libraries, doing mmap() s and so on --=20 regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com