bindings-uname-0.1: Low-level binding to POSIX uname(3)
Safe HaskellSafe-Inferred
LanguageHaskell98

Bindings.Uname

Synopsis

Documentation

data Utsname Source #

Instances

Instances details
Storable Utsname Source # 
Instance details

Defined in Bindings.Uname

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