All of lore.kernel.org
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] add inotify syscalls
Date: Wed, 17 Sep 2008 22:45:50 +0300	[thread overview]
Message-ID: <20080917194550.GD21187@kos.to> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 166 bytes --]

Inotify syscall implementation lifted from scratchbox.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
-- 
"rm -rf" only sounds scary if you don't have backups

[-- Attachment #1.2: 97_inotify.patch --]
[-- Type: text/plain, Size: 1139 bytes --]

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);

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2008-09-17 19:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17 19:45 Riku Voipio [this message]
2008-09-19  8:08 ` [Qemu-devel] [PATCH] add inotify syscalls Kirill A. Shutemov
2008-09-19 11:37   ` Riku Voipio

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=20080917194550.GD21187@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.