mirror of https://github.com/voidlizard/hbs2
FuckOS X storage patch / 2
This commit is contained in:
parent
67081eac22
commit
ef88112822
|
@ -41,6 +41,7 @@ import System.Posix
|
||||||
import System.Posix.Fcntl
|
import System.Posix.Fcntl
|
||||||
import System.Posix.IO
|
import System.Posix.IO
|
||||||
import System.Posix.Files (setFileSize)
|
import System.Posix.Files (setFileSize)
|
||||||
|
import System.Posix.IO.ByteString as Posix
|
||||||
import System.FilePath.Posix
|
import System.FilePath.Posix
|
||||||
import System.IO.MMap
|
import System.IO.MMap
|
||||||
import System.IO.Temp
|
import System.IO.Temp
|
||||||
|
@ -215,10 +216,11 @@ nwayFileAllocate :: Fd -> COff -> COff -> IO ()
|
||||||
nwayFileAllocate fd offset size = do
|
nwayFileAllocate fd offset size = do
|
||||||
let chunk = BS.replicate (fromIntegral size) 0
|
let chunk = BS.replicate (fromIntegral size) 0
|
||||||
_ <- fdSeek fd AbsoluteSeek (fromIntegral offset)
|
_ <- fdSeek fd AbsoluteSeek (fromIntegral offset)
|
||||||
void $ fdWrite fd chunk
|
void $ Posix.fdWrite fd chunk
|
||||||
#else
|
#else
|
||||||
nwayFileAllocate = fileAllocate
|
nwayFileAllocate = fileAllocate
|
||||||
#endif
|
#endif
|
||||||
|
{-# INLINE nwayFileAllocate #-}
|
||||||
|
|
||||||
|
|
||||||
nwayWriteBatch :: MonadUnliftIO m
|
nwayWriteBatch :: MonadUnliftIO m
|
||||||
|
|
Loading…
Reference in New Issue