{-# LINE 1 "libraries/unix/System/Posix/Fcntl.hsc" #-}
{-# LANGUAGE CApiFFI #-}
{-# LINE 3 "libraries/unix/System/Posix/Fcntl.hsc" #-}
{-# LANGUAGE Safe #-}
{-# LINE 7 "libraries/unix/System/Posix/Fcntl.hsc" #-}
module System.Posix.Fcntl (
Advice(..), fileAdvise,
fileAllocate,
) where
{-# LINE 33 "libraries/unix/System/Posix/Fcntl.hsc" #-}
import System.Posix.Types
{-# LINE 36 "libraries/unix/System/Posix/Fcntl.hsc" #-}
import System.IO.Error ( ioeSetLocation )
import GHC.IO.Exception ( unsupportedOperation )
{-# LINE 39 "libraries/unix/System/Posix/Fcntl.hsc" #-}
data Advice
= AdviceNormal
| AdviceRandom
| AdviceSequential
| AdviceWillNeed
| AdviceDontNeed
| AdviceNoReuse
deriving Eq
fileAdvise :: Fd -> FileOffset -> FileOffset -> Advice -> IO ()
{-# LINE 81 "libraries/unix/System/Posix/Fcntl.hsc" #-}
fileAdvise _ _ _ _ = return ()
{-# LINE 83 "libraries/unix/System/Posix/Fcntl.hsc" #-}
fileAllocate :: Fd -> FileOffset -> FileOffset -> IO ()
{-# LINE 100 "libraries/unix/System/Posix/Fcntl.hsc" #-}
{-# WARNING fileAllocate
"operation will throw 'IOError' \"unsupported operation\" (CPP guard: @#if HAVE_POSIX_FALLOCATE@)" #-}
fileAllocate _ _ _ = ioError (ioeSetLocation unsupportedOperation
"fileAllocate")
{-# LINE 105 "libraries/unix/System/Posix/Fcntl.hsc" #-}