Haskell Core Libraries (unix package)ParentContentsIndex
System.Sendfile
Portability provides fallback
Stability provisional
Maintainer vs@foldr.org
Contents
Haskell wrappers
Fallback implementation
Description
sendfile is a low-level method for efficently passing data from one file descriptor to another. The intended audience includes for example web server authors. Please note that this function is highly platform dependent.
Synopsis
sendfile :: Fd -> Fd -> Int -> Int -> IO ()
sendfileByName :: String -> Fd -> IO ()
squirt :: Fd -> Fd -> Int -> Int -> IO ()
Haskell wrappers
sendfile
:: Fd Input
-> Fd Output
-> Int Offset
-> Int Nr. of bytes to transmit
-> IO ()
sendfile transmits the contents of an open file to a stream socket opened for writing with as little overhead as possible. This function is not defined by any standard! Passing '0' will indeed transmit nothing at all. Caveats for converting a Handle to Fd apply.
sendfileByName :: String -> Fd -> IO ()
sendfileByName sends a file to an already open descriptor using sendfile. You can only use this function on regular files.
Fallback implementation
squirt
:: Fd Input
-> Fd Output
-> Int Offset
-> Int Nr. of bytes to transmit
-> IO ()
Fallback API. Exported in case somebody needs it.
Produced by Haddock version 0.4