Skip to contentSkip to conversation

linux-user: add kcmp() syscall

PATCH In review Laurent Vivier 2 participants 2 messages Oct 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: add kcmp() syscall

---
 linux-user/syscall.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
linux-user/syscall.c +10 -0
index d21d901..a32386e 100644
@@ -304,6 +304,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,      },
@@ -11943,6 +11948,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:
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Laurent Vivier
---
 linux-user/syscall.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
linux-user/syscall.c +5 -0
index d21d901..a32386e 100644
@@ -304,6 +304,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,      },
@@ -11943,6 +11948,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(unshare(arg1));

linux-user/syscall.c abi_long do_syscall(void *cpu_env, int num, abi_long arg1, · line 11958

Quoted 10 lines
linux-user/syscall.c +5 -0
         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:

thanks
-- PMM