Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion System/Posix/Fcntl.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ fileAdvise _ _ _ _ = return ()
fileAllocate :: Fd -> FileOffset -> FileOffset -> IO ()
#if HAVE_POSIX_FALLOCATE
fileAllocate fd off len = do
throwErrnoIfMinus1_ "fileAllocate" (c_posix_fallocate (fromIntegral fd) (fromIntegral off) (fromIntegral len))
ret <- c_posix_fallocate (fromIntegral fd) (fromIntegral off) (fromIntegral len)
if ret == 0
then pure ()
else ioError (errnoToIOError "fileAllocate" (Errno ret) Nothing Nothing)

foreign import capi safe "fcntl.h posix_fallocate"
c_posix_fallocate :: CInt -> COff -> COff -> IO CInt
Expand Down