From: PHO Date: Fri, 5 Jun 2009 07:27:20 +0000 (+0900) Subject: Doc fix X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=1b1bb33141d52b8d173843fb6104040a8d81f72b;p=bindings-uname.git Doc fix --- diff --git a/Bindings/Uname.hsc b/Bindings/Uname.hsc index ec03f1d..91eefc0 100644 --- a/Bindings/Uname.hsc +++ b/Bindings/Uname.hsc @@ -15,6 +15,18 @@ module Bindings.Uname 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 @@ -26,17 +38,17 @@ instance Storable Utsname where 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)