qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] add inotify syscalls


From: Kirill A. Shutemov
Subject: Re: [Qemu-devel] [PATCH] add inotify syscalls
Date: Fri, 19 Sep 2008 11:08:07 +0300
User-agent: Mutt/1.5.18 (2008-05-29)

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.

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.com/

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]