qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [7118] linux-user: prefer glibc over direct syscalls
Date: Thu, 16 Apr 2009 19:47:57 +0300	[thread overview]
Message-ID: <20090416164757.GA8341@kos.to> (raw)
In-Reply-To: <761ea48b0904160825r22ee47b6n9747118244e4fc30@mail.gmail.com>

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 <riku.voipio@iki.fi>
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 <riku.voipio@iki.fi>
---
 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 <sys/inotify.h>
 
 #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

  reply	other threads:[~2009-04-16 16:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 16:12 [Qemu-devel] [7118] linux-user: prefer glibc over direct syscalls Aurelien Jarno
2009-04-15 19:21 ` Stefan Weil
2009-04-15 19:48   ` Aurelien Jarno
2009-04-16 15:25 ` Laurent Desnogues
2009-04-16 16:47   ` Riku Voipio [this message]
2009-04-17 13:51     ` Aurelien Jarno
2009-04-17  0:16 ` Paul Brook
2009-04-17  8:03   ` Riku Voipio
2009-04-21  7:56 ` Laurent Desnogues
2009-04-21  8:36   ` Arnaud Patard
2009-04-21  8:35     ` Laurent Desnogues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090416164757.GA8341@kos.to \
    --to=riku.voipio@iki.fi \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).