This system call performs the same task as the readv 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 readv 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 0815f30..10b2552 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9894,6 +9894,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, } } break; +#if defined(TARGET_NR_preadv) && defined(CONFIG_PREADV) + case TARGET_NR_preadv: + { + struct iovec *vec = lock_iovec(VERIFY_WRITE, arg2, arg3, 0); + if (vec != NULL) { + ret = get_errno(preadv(arg1, vec, arg3, arg4)); + unlock_iovec(vec, arg2, arg3, 1); + } else { + ret = -host_to_target_errno(errno); + } + } + break; +#endif case TARGET_NR_getsid: ret = get_errno(getsid(arg1)); break; -- 1.9.1
