diff --git a/sendfile.cabal b/sendfile.cabal
--- a/sendfile.cabal
+++ b/sendfile.cabal
@@ -1,5 +1,5 @@
 name:          sendfile
-version:       0.7.5
+version:       0.7.6
 stability:     provisional
 synopsis:      A portable sendfile library
 description:   A library which exposes zero-copy sendfile functionality in a portable way. If a platform does not support sendfile, a fallback implementation in haskell is provided.
@@ -43,7 +43,7 @@
       other-modules: Network.Socket.SendFile.Win32
     else
       if os(linux) && !flag(portable)
-        cpp-options: -DLINUX_SENDFILE
+        cpp-options: -DLINUX_SENDFILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE.
         other-modules: Network.Socket.SendFile.Linux
       else
         if os(freebsd) && !flag(portable)
diff --git a/src/Network/Socket/SendFile/Linux.hsc b/src/Network/Socket/SendFile/Linux.hsc
--- a/src/Network/Socket/SendFile/Linux.hsc
+++ b/src/Network/Socket/SendFile/Linux.hsc
@@ -12,6 +12,7 @@
 import Network.Socket.SendFile.Iter (Iter(..), runIter)
 import System.Posix.Types (Fd(..))
 #include <sys/sendfile.h>
+#include <stdio.h>
 
 -- | automatically loop and send everything
 _sendFile :: Fd -> Fd -> Int64 -> Int64 -> IO ()
@@ -79,5 +80,5 @@
 
 -- sendfile64 gives LFS support
 foreign import ccall unsafe "sendfile64" c_sendfile
-    :: Fd -> Fd -> Ptr (#type off_t) -> (#type size_t) -> IO (#type ssize_t)
+    :: Fd -> Fd -> Ptr (#type off64_t) -> (#type size_t) -> IO (#type ssize_t)
 
