sendfile
我在 Haskell包中找到了这段代码:
-- sendfile64 gives LFS support
foreign import ccall unsafe "sendfile64" c_sendfile
:: Fd -> Fd -> Ptr (#type off64_t) -> (#type size_t) -> IO (#type ssize_t)
1) 是什么#type
意思和 2) 为什么我会收到这个错误,
[1 of 1] Compiling Linux.Splice ( splice.hs, splice.o )
splice.hs:40:12: parse error on input `type'
当我自己尝试如下使用它时?:
ghc --make splice.hs
拼接.hs:
{-# LANGUAGE ForeignFunctionInterface #-}
module Linux.Splice where
import Data.Word
import System.Posix.Types
-- SPLICE
-- fcntl.h
-- ssize_t splice(
-- int fd_in,
-- loff_t* off_in,
-- int fd_out,
-- loff_t* off_out,
-- size_t len,
-- unsigned int flags
-- );
foreign import ccall unsafe "fnctl.h splice" c_splice
:: Fd
-> Ptr (#type {- < parse error -} loff_t)
-> Fd
-> Ptr (#type loff_t)
-> (#type size_t)
-> Word
-> IO (#type ssize_t)
(使用 GHC 7.4.x)