{-# LINE 1 "src/System/PosixCompat/Extensions.hsc" #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module System.PosixCompat.Extensions (
CMajor
, CMinor
, deviceMajor
, deviceMinor
, makeDeviceID
) where
{-# LINE 16 "src/System/PosixCompat/Extensions.hsc" #-}
{-# LINE 18 "src/System/PosixCompat/Extensions.hsc" #-}
import Foreign.C.Types
import System.PosixCompat.Types
type CMajor = CUInt
type CMinor = CUInt
deviceMajor :: DeviceID -> CMajor
{-# LINE 33 "src/System/PosixCompat/Extensions.hsc" #-}
deviceMajor dev = unix_major dev
foreign import ccall unsafe "unix_major" unix_major :: CDev -> CUInt
{-# LINE 37 "src/System/PosixCompat/Extensions.hsc" #-}
deviceMinor :: DeviceID -> CMinor
{-# LINE 45 "src/System/PosixCompat/Extensions.hsc" #-}
deviceMinor dev = unix_minor dev
foreign import ccall unsafe "unix_minor" unix_minor :: CDev -> CUInt
{-# LINE 49 "src/System/PosixCompat/Extensions.hsc" #-}
makeDeviceID :: CMajor -> CMinor -> DeviceID
{-# LINE 55 "src/System/PosixCompat/Extensions.hsc" #-}
makeDeviceID ma mi = unix_makedev ma mi
foreign import ccall unsafe "unix_makedev" unix_makedev :: CUInt -> CUInt -> CDev
{-# LINE 59 "src/System/PosixCompat/Extensions.hsc" #-}