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 <[email protected]>
---
 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


Reply via email to