aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix/preadv64v2.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-02-02 10:46:26 +0100
committerFlorian Weimer <fweimer@redhat.com>2018-02-02 10:46:26 +0100
commitd4b4a00a462348750bb18544eb30853ee6ac5d10 (patch)
treeede7a1a13907496496c48e436a5b5dc85be3ac2e /sysdeps/posix/preadv64v2.c
parent84c94d2fd90d84ae7e67657ee8e22c2d1b796f63 (diff)
downloadglibc-d4b4a00a462348750bb18544eb30853ee6ac5d10.tar
glibc-d4b4a00a462348750bb18544eb30853ee6ac5d10.tar.gz
glibc-d4b4a00a462348750bb18544eb30853ee6ac5d10.tar.bz2
glibc-d4b4a00a462348750bb18544eb30853ee6ac5d10.zip
preadv2/pwritev2: Handle offset == -1 [BZ #22753]
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/posix/preadv64v2.c')
-rw-r--r--sysdeps/posix/preadv64v2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/posix/preadv64v2.c b/sysdeps/posix/preadv64v2.c
index a4844b145c..f89ad08c54 100644
--- a/sysdeps/posix/preadv64v2.c
+++ b/sysdeps/posix/preadv64v2.c
@@ -30,7 +30,10 @@ preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
return -1;
}
- return preadv64 (fd, vector, count, offset);
+ if (offset == -1)
+ return __readv (fd, vector, count);
+ else
+ return preadv64 (fd, vector, count, offset);
}
#ifdef __OFF_T_MATCHES_OFF64_T