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