From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6OU6-0005kQ-BC for qemu-devel@nongnu.org; Tue, 19 May 2009 08:31:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6OU2-0005jX-GK for qemu-devel@nongnu.org; Tue, 19 May 2009 08:31:53 -0400 Received: from [199.232.76.173] (port=54506 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6OU2-0005jQ-80 for qemu-devel@nongnu.org; Tue, 19 May 2009 08:31:50 -0400 Received: from mailgw3.cms.com ([202.75.200.223]:11672 helo=cms.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6OU0-00076K-5x for qemu-devel@nongnu.org; Tue, 19 May 2009 08:31:49 -0400 Subject: Re: [Qemu-devel] [PATCH ] linux-user: add tee systemcall support From: vibi sreenivasan In-Reply-To: <20090519113635.GA11400@kos.to> References: <1242478961.2167.7.camel@system> <1242720723.2188.13.camel@system> <20090519113635.GA11400@kos.to> Content-Type: text/plain Date: Tue, 19 May 2009 18:06:14 +0530 Message-Id: <1242736574.2188.32.camel@system> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Resent-Message-Id: Reply-To: vibi_sreenivasan@cms.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: qemu-devel@nongnu.org hi , thanks for looking into my code. On Tue, 2009-05-19 at 14:36 +0300, Riku Voipio wrote: > On Tue, May 19, 2009 at 01:42:03PM +0530, vibi sreenivasan wrote: > > hi all, > > > >Subject: [Qemu-devel] [PATCH ] linux-user: add tee systemcall support > > > Is there any thing wrong with this patch. Please give some feedback > > So if there is anything wrong i will be able to correct it. > > The implementation of tee appears fine. However, the tee testcases > I found all also used splice. What did you use to test this i used a small test code ---------------------------------------------------------------------------------------- #define _GNU_SOURCE #include #include #include #include #define die(X) do { perror(#X);exit(EXIT_FAILURE); } while(0) #define SZ 255 #define TEST_STRING "This is a test to check the presence of tee system call\n\ This print states that tee system call is present\n" int main(void) { int pipe1[2], pipe2[2],strln = strlen(TEST_STRING); char data[SZ] = {0}; if (pipe(pipe1) || pipe(pipe2)) die("perror"); if (write(pipe1[1], TEST_STRING, strln) < 0) die("write"); if(tee(pipe1[0], pipe2[1], strln, SPLICE_F_MOVE) != strln) die("tee"); if(read(pipe2[0], data, SZ - 1) < 0) die("read"); printf("%s",data); fflush(stdout); } ---------------------------------------------------------------------------------------------- > , or do > you plan to implement splice too? > yes i am plannig to implement splice & vmsplice. Also i have a plan to look in to adding support for unimplemented syscalls (got that idea from TODO),if any. Before that i was trying to make sure that i am going in the right path. thanks & regards vibi sreenivasan > > > > Thanks & Regards > > vibi sreenivasan > > > > >Signed-off-by: vibi > > >--- > > >linux-user/syscall.c | 8 ++++++++ > > >1 files changed, 8 insertions(+), 0 deletions(-) > > > > >diff --git a/linux-user/syscall.c b/linux-user/syscall.c > > >index 76f0c95..f2f87c3 100644 > > >--- a/linux-user/syscall.c > > >+++ b/linux-user/syscall.c > > >@@ -6580,6 +6580,14 @@ abi_long do_syscall(void *cpu_env, int num, > > >abi_long arg1, > > break; > > >#endif > > > > >+#ifdef TARGET_NR_tee > > >+ case TARGET_NR_tee: > > >+ { > > >+ ret = get_errno(tee(arg1,arg2,arg3,arg4)); > > >+ } > > >+ break; > > >+#endif > > >+ > > > default: > > > unimplemented: > > > gemu_log("qemu: Unsupported syscall: %d\n", num); > > > > > > > > > > > >