aboutsummaryrefslogtreecommitdiff
path: root/src/port/preadv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/port/preadv.c')
-rw-r--r--src/port/preadv.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/port/preadv.c b/src/port/preadv.c
index aa7537503fb..48b64d4593d 100644
--- a/src/port/preadv.c
+++ b/src/port/preadv.c
@@ -8,33 +8,19 @@
* IDENTIFICATION
* src/port/preadv.c
*
- * Note that this implementation changes the current file position, unlike
- * the POSIX-like function, so we use the name pg_preadv().
- *
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#ifdef WIN32
-#include <windows.h>
-#else
#include <unistd.h>
-#endif
#include "port/pg_iovec.h"
ssize_t
-pg_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
+preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
{
-#ifdef HAVE_READV
- if (iovcnt == 1)
- return pread(fd, iov[0].iov_base, iov[0].iov_len, offset);
- if (lseek(fd, offset, SEEK_SET) < 0)
- return -1;
- return readv(fd, iov, iovcnt);
-#else
ssize_t sum = 0;
ssize_t part;
@@ -54,5 +40,4 @@ pg_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
return sum;
}
return sum;
-#endif
}