aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-01-07 13:31:36 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-01-07 13:31:36 +0100
commit200fc24b9dd2360bc850fe71ed22410051426d96 (patch)
treef145db6774c8f9727e2debe9b9ac59fc9acee50c /sysdeps
parent8e13c51bb579d56b52e93a058c9efb0bbab35d1b (diff)
downloadglibc-200fc24b9dd2360bc850fe71ed22410051426d96.tar
glibc-200fc24b9dd2360bc850fe71ed22410051426d96.tar.gz
glibc-200fc24b9dd2360bc850fe71ed22410051426d96.tar.bz2
glibc-200fc24b9dd2360bc850fe71ed22410051426d96.zip
hurd: Fix pwritev*
This follows c45d78aac ('posix: Fix generic p{read,write}v buffer allocation (BZ#22457)'), which made pwritev to use __mmap instead of __posix_memalign, but didn't pass PROT_READ to it, while the pwrite() call does need to read the data we have just copied over. * sysdeps/posix/pwritev_common.c: Add PROT_READ to __mmap prot.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/posix/pwritev_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/posix/pwritev_common.c b/sysdeps/posix/pwritev_common.c
index bd0f5c5257..344ab4d61b 100644
--- a/sysdeps/posix/pwritev_common.c
+++ b/sysdeps/posix/pwritev_common.c
@@ -55,7 +55,7 @@ PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
but 1. it is system specific (not meant in generic implementation), and
2. it would make the implementation more complex, and 3. it will require
another syscall (fcntl). */
- void *buffer = __mmap (NULL, bytes, PROT_WRITE,
+ void *buffer = __mmap (NULL, bytes, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (__glibc_unlikely (buffer == MAP_FAILED))
return -1;