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

Bindings.Uname

Synopsis

Documentation

uname :: Ptr Utsname -> IO CIntSource

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