diff mbox

[PULL,v2,09/22] linux-user: add kcmp() syscall

Message ID d0018e4f6a7adca0a670afbff1aa449dbda37c7a.1476796525.git.riku.voipio@linaro.org
State Accepted
Commit 2f14788c542fcdc7fc2eb4a93db7facb39c43463
Headers show

Commit Message

Riku Voipio Oct. 18, 2016, 1:21 p.m. UTC
From: Laurent Vivier <laurent@vivier.eu>


Signed-off-by: Laurent Vivier <laurent@vivier.eu>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

---
 linux-user/syscall.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.1.4
diff mbox

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3396d4b..e005401 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -306,6 +306,11 @@  _syscall3(int, ioprio_set, int, which, int, who, int, ioprio)
 _syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags)
 #endif
 
+#if defined(TARGET_NR_kcmp) && defined(__NR_kcmp)
+_syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type,
+          unsigned long, idx1, unsigned long, idx2)
+#endif
+
 static bitmask_transtbl fcntl_flags_tbl[] = {
   { TARGET_O_ACCMODE,   TARGET_O_WRONLY,    O_ACCMODE,   O_WRONLY,    },
   { TARGET_O_ACCMODE,   TARGET_O_RDWR,      O_ACCMODE,   O_RDWR,      },
@@ -12099,6 +12104,11 @@  abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(unshare(arg1));
         break;
 #endif
+#if defined(TARGET_NR_kcmp) && defined(__NR_kcmp)
+    case TARGET_NR_kcmp:
+        ret = get_errno(kcmp(arg1, arg2, arg3, arg4, arg5));
+        break;
+#endif
 
     default:
     unimplemented: