| Safe Haskell | Safe |
|---|---|
| Language | Haskell98 |
Bindings.Uname
Documentation
Instances
| Storable Utsname Source # | |
Defined in Bindings.Uname Methods peekElemOff :: Ptr Utsname -> Int -> IO Utsname pokeElemOff :: Ptr Utsname -> Int -> Utsname -> IO () peekByteOff :: Ptr b -> Int -> IO Utsname pokeByteOff :: Ptr b -> Int -> Utsname -> IO () | |
uname :: Ptr Utsname -> IO CInt Source #
stores nul-terminated strings of information
identifying the current system info to the structure referenced
by name.uname name
import Foreign.C
import Foreign.Marshal
sysName :: IO String
sysName = alloca $ \ ptr ->
do throwErrnoIfMinus1_ "uname" $ uname ptr
peekCString $ sysname ptr