{-# LANGUAGE CPP #-}
module Network.Sendfile.Types where
import qualified Data.ByteString as B
import qualified System.Posix.IO as P
import qualified System.Posix.IO.ByteString as PB
import qualified System.Posix.Types as P
data FileRange = EntireFile
| PartOfFile {
rangeOffset :: Integer
, rangeLength :: Integer
}
openFd :: FilePath -> P.OpenMode -> P.OpenFileFlags -> IO P.Fd
#if MIN_VERSION_unix(2,8,0)
openFd path mode flags = P.openFd path mode flags
#else
openFd path mode flags = P.openFd path mode Nothing flags
#endif
openFdBS :: B.ByteString -> P.OpenMode -> P.OpenFileFlags -> IO P.Fd
#if MIN_VERSION_unix(2,8,0)
openFdBS path mode flags = PB.openFd path mode flags
#else
openFdBS path mode flags = PB.openFd path mode Nothing flags
#endif