HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulesimple-sendfile-0.2.32Haskell2010

System.Linux.Sendfile

  • 1 type
  • 2 values
valuesendfile :: Fd -> ByteString -> FileRange -> IO () -> IO ()
#

Simple binding for sendfile() of Linux. Used system calls:

  • EntireFile -- open(), stat(), sendfile(), and close()

  • PartOfFile -- open(), sendfile(), and close()

If the size of the file is unknown when sending the entire file, specifying PartOfFile is much faster.

The fourth action argument is called when a file is sent as chunks. Chucking is inevitable if the socket is non-blocking (this is the default) and the file is large. The action is called after a chunk is sent and before waiting the socket to be ready for writing.

valuesendfileFd :: Fd -> Fd -> FileRange -> IO () -> IO ()
#

Simple binding for sendfile() of Linux. Used system calls:

  • EntireFile -- stat() and sendfile()

  • PartOfFile -- sendfile()

If the size of the file is unknown when sending the entire file, specifying PartOfFile is much faster.

The fourth action argument is called when a file is sent as chunks. Chucking is inevitable if the socket is non-blocking (this is the default) and the file is large. The action is called after a chunk is sent and before waiting the socket to be ready for writing.