[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/3] linux-user: added support for pwritev() system
From: |
Dejan Jovicevic |
Subject: |
[Qemu-devel] [PATCH 3/3] linux-user: added support for pwritev() system call. |
Date: |
Thu, 6 Oct 2016 15:59:31 +0200 |
This system call performs the same task as the writev system call,
with the exception of having the fourth argument, offset, which
specifes the file offset at which the input operation is to be performed.
This implementation is based on the existing writev implementation.
Signed-off-by: Dejan Jovicevic <address@hidden>
---
linux-user/syscall.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 10b2552..9f72a2c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9907,6 +9907,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
}
break;
#endif
+#if defined(TARGET_NR_pwritev) && defined(CONFIG_PWRITEV)
+ case TARGET_NR_pwritev:
+ {
+ struct iovec *vec = lock_iovec(VERIFY_READ, arg2, arg3, 1);
+ if (vec != NULL) {
+ ret = get_errno(pwritev(arg1, vec, arg3, arg4));
+ unlock_iovec(vec, arg2, arg3, 0);
+ } else {
+ ret = -host_to_target_errno(errno);
+ }
+ }
+ break;
+#endif
case TARGET_NR_getsid:
ret = get_errno(getsid(arg1));
break;
--
1.9.1