{-# LINE 1 "src/unix/System/Uname.hsc" #-}
-- | The module of this name differs as between Windows and non-Windows builds.
-- This is the non-Windows version.
module System.Uname
    ( getRelease
    )
    where



import           Foreign
import           Foreign.C

getRelease :: IO String
getRelease :: IO String
getRelease = do
  forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \ Ptr Utsname
ptr ->
             do forall a. (Eq a, Num a) => String -> IO a -> IO ()
throwErrnoIfMinus1_ String
"uname" forall a b. (a -> b) -> a -> b
$ Ptr Utsname -> IO CInt
uname Ptr Utsname
ptr
                CString -> IO String
peekCString forall a b. (a -> b) -> a -> b
$ Ptr Utsname -> CString
release Ptr Utsname
ptr
-- | @'uname' name@ stores nul-terminated strings of information
--   identifying the current system info to the structure referenced
--   by name.
--
--   > import Foreign.C
--   > import Foreign.Marshal
--   >
--   > sysName :: IO String
--   > sysName = alloca $ \ ptr ->
--   >           do throwErrnoIfMinus1_ "uname" $ uname ptr
--   >              peekCString $ sysname ptr
--
foreign import ccall unsafe "haskell_uname"
        uname :: Ptr Utsname -> IO CInt

data Utsname

instance Storable Utsname where
  sizeOf :: Utsname -> Int
sizeOf    = forall a b. a -> b -> a
const (Int
390)
{-# LINE 37 "src/unix/System/Uname.hsc" #-}
  alignment = const 1
{-# LINE 38 "src/unix/System/Uname.hsc" #-}
  poke      = error "Storable Utsname: peek: unsupported operation"
  peek :: Ptr Utsname -> IO Utsname
peek      = forall a. HasCallStack => String -> a
error String
"Storable Utsname: poke: unsupported operation"

release :: Ptr Utsname -> CString
release :: Ptr Utsname -> CString
release = ((\Ptr Utsname
hsc_ptr -> Ptr Utsname
hsc_ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
130))
{-# LINE 43 "src/unix/System/Uname.hsc" #-}