From 5e8581f15bc308454846cb79c772083dab66b04f Mon Sep 17 00:00:00 2001
From: root <root>
Date: Fri, 10 Jun 2011 06:50:42 +0000
Subject: *** empty log message ***

---
 Changes | 3 +++
 eio.c   | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/Changes b/Changes
index 7449b04..4e0f88a 100644
--- a/Changes
+++ b/Changes
@@ -42,3 +42,6 @@ TODO: fadvise request
           combination EIO_READDIR_STAT_ORDER | EIO_READDIR_DIRS_FIRST.
         - port to openbsd (another blatantly broken non-UNIX/POSIX platform).
         - fix eio_custom prototype.
+        - work around a Linux (and likely FreeBSD and other kernels) bug
+          where sendfile would not transfer all the requested bytes on
+          large transfers, using a heuristic.
diff --git a/eio.c b/eio.c
index a2bf4ec..f7a9666 100644
--- a/eio.c
+++ b/eio.c
@@ -1006,6 +1006,9 @@ eio__sendfile (int ofd, int ifd, off_t offset, size_t count, etp_worker *self)
 
 #elif defined (_WIN32)
       /* does not work, just for documentation of what would need to be done */
+      /* actually, cannot be done like this, as TransmitFile changes the file offset, */
+      /* libeio guarantees that the file offset does not change, and windows */
+      /* has no way to get an independent handle to the same file description */
       HANDLE h = TO_SOCKET (ifd);
       SetFilePointer (h, offset, 0, FILE_BEGIN);
       res = TransmitFile (TO_SOCKET (ofd), h, count, 0, 0, 0, 0);
-- 
cgit v1.2.3