From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LuUks-0000yt-Tp for qemu-devel@nongnu.org; Thu, 16 Apr 2009 12:48:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LuUkq-0000xg-OZ for qemu-devel@nongnu.org; Thu, 16 Apr 2009 12:48:01 -0400 Received: from [199.232.76.173] (port=51679 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuUkq-0000xd-H2 for qemu-devel@nongnu.org; Thu, 16 Apr 2009 12:48:00 -0400 Received: from naru.obs2.net ([84.20.150.76]:48019) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LuUkp-0004Zv-WF for qemu-devel@nongnu.org; Thu, 16 Apr 2009 12:48:00 -0400 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id 63F3C3274004 for ; Thu, 16 Apr 2009 19:47:57 +0300 (EEST) Date: Thu, 16 Apr 2009 19:47:57 +0300 From: Riku Voipio Subject: Re: [Qemu-devel] [7118] linux-user: prefer glibc over direct syscalls Message-ID: <20090416164757.GA8341@kos.to> References: <761ea48b0904160825r22ee47b6n9747118244e4fc30@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <761ea48b0904160825r22ee47b6n9747118244e4fc30@mail.gmail.com> 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 Thu, Apr 16, 2009 at 05:25:25PM +0200, Laurent Desnogues wrote: > > #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? It is broken. Try this. >>From 448cfe737b614ec44a8c4a9a4d8c2542c3eac165 Mon Sep 17 00:00:00 2001 From: Riku Voipio Date: Thu, 16 Apr 2009 19:38:14 +0300 Subject: linux-user: fix inotify syscalls Configure test was broken, so the breakage of the #ifdef'd code was not noticed. Signed-off-by: Riku Voipio --- configure | 2 +- linux-user/syscall.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 5b705a0..251d271 100755 --- a/configure +++ b/configure @@ -1200,7 +1200,7 @@ int main(void) { /* try to start inotify */ - return inotify_init(void); + return inotify_init(); } EOF if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 898f58c..c94efe6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -480,6 +480,7 @@ _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, #endif /* CONFIG_ATFILE */ #ifdef CONFIG_INOTIFY +#include #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init) static int sys_inotify_init(void) @@ -496,7 +497,7 @@ static int sys_inotify_add_watch(int fd,const char *pathname, int32_t mask) #if defined(TARGET_NR_inotify_rm_watch) && defined(__NR_inotify_rm_watch) static int sys_inotify_rm_watch(int fd, int32_t wd) { - return (inotify_rm_watch(fd,pathname, wd)); + return (inotify_rm_watch(fd, wd)); } #endif #else -- 1.6.2.1 -- "rm -rf" only sounds scary if you don't have backups