{-# LINE 1 "libraries/unix/System/Posix/Fcntl.hsc" #-}
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE Safe #-}
module System.Posix.Fcntl (
Advice(..), fileAdvise,
fileAllocate,
) where
{-# LINE 29 "libraries/unix/System/Posix/Fcntl.hsc" #-}
import System.Posix.Types
{-# LINE 32 "libraries/unix/System/Posix/Fcntl.hsc" #-}
import System.IO.Error ( ioeSetLocation )
import GHC.IO.Exception ( unsupportedOperation )
{-# LINE 35 "libraries/unix/System/Posix/Fcntl.hsc" #-}
data Advice
= AdviceNormal
| AdviceRandom
| AdviceSequential
| AdviceWillNeed
| AdviceDontNeed
| AdviceNoReuse
deriving Advice -> Advice -> Bool
(Advice -> Advice -> Bool)
-> (Advice -> Advice -> Bool) -> Eq Advice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Advice -> Advice -> Bool
== :: Advice -> Advice -> Bool
$c/= :: Advice -> Advice -> Bool
/= :: Advice -> Advice -> Bool
Eq
fileAdvise :: Fd -> FileOffset -> FileOffset -> Advice -> IO ()
{-# LINE 77 "libraries/unix/System/Posix/Fcntl.hsc" #-}
fileAdvise :: Fd -> FileOffset -> FileOffset -> Advice -> IO ()
fileAdvise Fd
_ FileOffset
_ FileOffset
_ Advice
_ = () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
{-# LINE 79 "libraries/unix/System/Posix/Fcntl.hsc" #-}
fileAllocate :: Fd -> FileOffset -> FileOffset -> IO ()
{-# LINE 99 "libraries/unix/System/Posix/Fcntl.hsc" #-}
{-# WARNING fileAllocate
"operation will throw 'IOError' \"unsupported operation\" (CPP guard: @#if HAVE_POSIX_FALLOCATE@)" #-}
fileAllocate :: Fd -> FileOffset -> FileOffset -> IO ()
fileAllocate Fd
_ FileOffset
_ FileOffset
_ = IOError -> IO ()
forall a. IOError -> IO a
ioError (IOError -> String -> IOError
ioeSetLocation IOError
unsupportedOperation
String
"fileAllocate")
{-# LINE 104 "libraries/unix/System/Posix/Fcntl.hsc" #-}