{-# LINE 1 "src/System/Posix/Fsync.hsc" #-} {-# LANGUAGE ForeignFunctionInterface #-} module System.Posix.Fsync (fsync) where import Foreign.C.Error (throwErrnoIfMinus1_) import Foreign.C.Types (CInt(..)) import System.Posix.Types (Fd(..)) foreign import ccall "fsync" c_fsync :: CInt -> IO CInt fsync :: Fd -> IO () fsync :: Fd -> IO () fsync (Fd fd :: CInt fd) = String -> IO CInt -> IO () forall a. (Eq a, Num a) => String -> IO a -> IO () throwErrnoIfMinus1_ "fsync" (IO CInt -> IO ()) -> IO CInt -> IO () forall a b. (a -> b) -> a -> b $ CInt -> IO CInt c_fsync CInt fd