summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-02-20 09:40:51 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-02-20 09:40:51 +0000
commitf4718c033bfef80933bf3d1d5d6d35f8fae8b11d (patch)
treec93eab3dee6b3506b00c456d1d5db26dc0f94230 /linux-user/syscall.c
parentafd3397a8149d8b645004e459bf2002d78f5e267 (diff)
parentb44316fb3610972e40849ec5710aeb42dfeba19d (diff)
downloadfocaccia-qemu-f4718c033bfef80933bf3d1d5d6d35f8fae8b11d.tar.gz
focaccia-qemu-f4718c033bfef80933bf3d1d5d6d35f8fae8b11d.zip
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging
# gpg: Signature made Tue 20 Feb 2018 09:16:18 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-2.12-pull-request:
  linux-user: Remove THREAD macro
  linux-user: Fix sched_getaffinity mask size
  linux-user: Fix register used for 6th and 7th syscall argument on aarch64
  linux-user: Implement ioctl cmd TIOCGPTPEER

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 82b35a6bdf..e24f43c4a2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5636,6 +5636,15 @@ static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp,
     return get_errno(safe_ioctl(fd, ie->host_cmd, sig));
 }
 
+#ifdef TIOCGPTPEER
+static abi_long do_ioctl_tiocgptpeer(const IOCTLEntry *ie, uint8_t *buf_temp,
+                                     int fd, int cmd, abi_long arg)
+{
+    int flags = target_to_host_bitmask(arg, fcntl_flags_tbl);
+    return get_errno(safe_ioctl(fd, ie->host_cmd, flags));
+}
+#endif
+
 static IOCTLEntry ioctl_entries[] = {
 #define IOCTL(cmd, access, ...) \
     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
@@ -10493,7 +10502,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
                     ret = arg2;
                 }
 
-                ret = host_to_target_cpu_mask(mask, mask_size, arg3, arg2);
+                if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
+                    goto efault;
+                }
             }
         }
         break;