bindings-uname-0.1: Low-level binding to POSIX uname(3)

Safe HaskellSafe
LanguageHaskell98

Bindings.Uname

Synopsis

Documentation

data Utsname Source #

Instances
Storable Utsname Source # 
Instance details

Defined in Bindings.Uname

Methods

sizeOf :: Utsname -> Int

alignment :: Utsname -> Int

peekElemOff :: Ptr Utsname -> Int -> IO Utsname

pokeElemOff :: Ptr Utsname -> Int -> Utsname -> IO ()

peekByteOff :: Ptr b -> Int -> IO Utsname

pokeByteOff :: Ptr b -> Int -> Utsname -> IO ()

peek :: Ptr Utsname -> IO Utsname

poke :: Ptr Utsname -> Utsname -> IO ()

uname :: Ptr Utsname -> IO CInt Source #

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

sysname :: Ptr Utsname -> CString Source #

nodename :: Ptr Utsname -> CString Source #

release :: Ptr Utsname -> CString Source #

version :: Ptr Utsname -> CString Source #

machine :: Ptr Utsname -> CString Source #