From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LuTSz-0004c2-Oa for qemu-devel@nongnu.org; Thu, 16 Apr 2009 11:25:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LuTSy-0004Zx-Is for qemu-devel@nongnu.org; Thu, 16 Apr 2009 11:25:29 -0400 Received: from [199.232.76.173] (port=41540 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuTSy-0004Zo-6A for qemu-devel@nongnu.org; Thu, 16 Apr 2009 11:25:28 -0400 Received: from fg-out-1718.google.com ([72.14.220.157]:17016) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LuTSx-0005KN-RJ for qemu-devel@nongnu.org; Thu, 16 Apr 2009 11:25:28 -0400 Received: by fg-out-1718.google.com with SMTP id e21so154400fga.8 for ; Thu, 16 Apr 2009 08:25:25 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 16 Apr 2009 17:25:25 +0200 Message-ID: <761ea48b0904160825r22ee47b6n9747118244e4fc30@mail.gmail.com> Subject: Re: [Qemu-devel] [7118] linux-user: prefer glibc over direct syscalls From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, Apr 15, 2009 at 6:12 PM, Aurelien Jarno wrote: > Revision: 7118 > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7118 > Author: aurel32 > Date: 2009-04-15 16:12:13 +0000 (Wed, 15 Apr 2009) > Log Message: > ----------- > linux-user: prefer glibc over direct syscalls > > The openat/*at syscalls are incredibly common with modern coreutils, > calling them directly via syscalls breaks for example fakeroot. Use > glibc stubs whenever directly available and provide old syscall > calling for people still using older libc. > > Patch originally from Mika Westerberg, Adapted to > apply to current trunk and cleaned up by Riku Voipio. > > Signed-off-by: Riku Voipio > Signed-off-by: Aurelien Jarno > > Modified Paths: > -------------- > trunk/configure > trunk/linux-user/syscall.c [...] > Modified: trunk/linux-user/syscall.c > =================================================================== > --- trunk/linux-user/syscall.c 2009-04-15 16:12:06 UTC (rev 7117) > +++ trunk/linux-user/syscall.c 2009-04-15 16:12:13 UTC (rev 7118) [...] > @@ -285,22 +482,37 @@ > _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, > const struct timespec *,tsp,int,flags) > #endif > + > +#endif /* CONFIG_ATFILE */ > + > +#ifdef CONFIG_INOTIFY > + > #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init) > -_syscall0(int,sys_inotify_init) > +static int sys_inotify_init(void) > +{ > + return (inotify_init()); > +} > #endif > #if defined(TARGET_NR_inotify_add_watch) && defined(__NR_inotify_add_watch) > -_syscall3(int,sys_inotify_add_watch,int,fd,const char *,pathname,uint32_t,mask) > +static int sys_inotify_add_watch(int fd,const char *pathname, int32_t mask) > +{ > + return (inotify_add_watch(fd, pathname, mask)); > +} > #endif > #if defined(TARGET_NR_inotify_rm_watch) && defined(__NR_inotify_rm_watch) > -_syscall2(int,sys_inotify_rm_watch,int,fd,uint32_t,wd) > +static int sys_inotify_rm_watch(int fd, int32_t wd) > +{ > + return (inotify_rm_watch(fd,pathname, wd)); Isn't pathname spurious? Laurent