import Foreign
import Foreign.C
+-- | @'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 "sys/utsname.h uname"
uname :: Ptr Utsname -> IO CInt
poke = error "Storable Utsname: peek: unsupported operation"
peek = error "Storable Utsname: poke: unsupported operation"
-sysname :: Ptr Utsname -> IO CString
-sysname = (#peek struct utsname, sysname)
+sysname :: Ptr Utsname -> CString
+sysname = (#ptr struct utsname, sysname)
-nodename :: Ptr Utsname -> IO CString
-nodename = (#peek struct utsname, nodename)
+nodename :: Ptr Utsname -> CString
+nodename = (#ptr struct utsname, nodename)
-release :: Ptr Utsname -> IO CString
-release = (#peek struct utsname, release)
+release :: Ptr Utsname -> CString
+release = (#ptr struct utsname, release)
-version :: Ptr Utsname -> IO CString
-version = (#peek struct utsname, version)
+version :: Ptr Utsname -> CString
+version = (#ptr struct utsname, version)
-machine :: Ptr Utsname -> IO CString
-machine = (#peek struct utsname, machine)
+machine :: Ptr Utsname -> CString
+machine = (#ptr struct utsname, machine)