Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aycanirican/421613 to your computer and use it in GitHub Desktop.
Save aycanirican/421613 to your computer and use it in GitHub Desktop.
c_sendfile :: Fd -> Fd -> COff -> CSize -> IO CSsize
#if defined(LINUX)
c_sendfile ofd ifd o c = do
alloca $ \off -> do
poke off o
r <- c_sendfile_linux ofd ifd off c
return r
#endif
#if defined(DARWIN)
c_sendfile ofd ifd o c = do
alloca $ \sbytes ->
do poke sbytes c
c_sendfile_darwin ifd ofd o sbytes 0 0
#endif
#if defined(FREEBSD)
c_sendfile ofd ifd o c = do
alloca $ \sbytes ->
do poke sbytes c
c_sendfile_freebsd ifd ofd o c 0 sbytes 0
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment