[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] add inotify syscalls
From: |
Riku Voipio |
Subject: |
Re: [Qemu-devel] [PATCH] add inotify syscalls |
Date: |
Fri, 19 Sep 2008 14:37:45 +0300 |
User-agent: |
Mutt/1.5.11+cvs20060126 |
On Fri, Sep 19, 2008 at 11:08:07AM +0300, Kirill A. Shutemov wrote:
> On Wed, Sep 17, 2008 at 10:45:50PM +0300, Riku Voipio wrote:
> > Inotify syscall implementation lifted from scratchbox.
> >
> > Signed-off-by: Riku Voipio <address@hidden>
> > --
> > "rm -rf" only sounds scary if you don't have backups
>
> > Index: trunk/linux-user/syscall.c
> > ===================================================================
> > --- trunk.orig/linux-user/syscall.c 2008-09-17 22:08:51.000000000 +0300
> > +++ trunk/linux-user/syscall.c 2008-09-17 22:12:04.000000000 +0300
> > @@ -29,6 +29,7 @@
> > #include <time.h>
> > #include <limits.h>
> > #include <sys/types.h>
> > +#include <sys/inotify.h>
> > #include <sys/ipc.h>
> > #include <sys/msg.h>
> > #include <sys/wait.h>
> > @@ -5821,7 +5822,23 @@
> > ret = do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
> > break;
> > #endif
> > -
> > +#ifdef TARGET_NR_inotify_init
> > + case TARGET_NR_inotify_init:
> > + ret = get_errno(inotify_init());
> > + break;
> > +#endif
> > +#ifdef TARGET_NR_inotify_add_watch
> > + case TARGET_NR_inotify_add_watch:
> > + p = lock_user_string(arg2);
> > + ret = get_errno(inotify_add_watch(arg1, path(p), arg3));
> > + unlock_user(p, arg2, 0);
> > + break;
> > +#endif
> > +#ifdef TARGET_NR_inotify_rm_watch
> > + case TARGET_NR_inotify_rm_watch:
> > + ret = get_errno(inotify_rm_watch(arg1, arg2));
> > + break;
> > +#endif
> > default:
> > unimplemented:
> > gemu_log("qemu: Unsupported syscall: %d\n", num);
>
>
> This syscalls like *at introduced in glibc 2.4. So you should use
> _syscall* macros for backward compatible.
Right, will fix in a moment
--
"rm -rf" only sounds scary if you don't have backups