bsd-sysctl 1.0.7 → 1.0.8.0
raw patch · 5 files changed
+70/−74 lines, 5 filesdep ~basesetup-changednew-uploaderPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- System.BSD.Sysctl: instance SysctlKey OID
- System.BSD.Sysctl: instance SysctlKey String
- System.BSD.Sysctl: instance SysctlKey [Int32]
- System.BSD.Sysctl: sysctlNameToOid :: String -> IO OID
- System.BSD.Sysctl: sysctlNameToOidArgs :: String -> [Int32] -> IO OID
+ System.BSD.Sysctl: instance System.BSD.Sysctl.SysctlKey System.BSD.Sysctl.OID
+ System.BSD.Sysctl: instance System.BSD.Sysctl.SysctlKey [GHC.Int.Int32]
- System.BSD.Sysctl: sysctlPeek :: (SysctlKey k, Storable a) => k -> IO a
+ System.BSD.Sysctl: sysctlPeek :: forall k a. (SysctlKey k, Storable a) => k -> IO a
- System.BSD.Sysctl: sysctlPeekArray :: (SysctlKey k, Storable a) => k -> IO [a]
+ System.BSD.Sysctl: sysctlPeekArray :: forall k a. (SysctlKey k, Storable a) => k -> IO [a]
- System.BSD.Sysctl: sysctlReadLong :: SysctlKey k => k -> IO Int32
+ System.BSD.Sysctl: sysctlReadLong :: SysctlKey k => k -> IO Int64
- System.BSD.Sysctl: sysctlReadULong :: SysctlKey k => k -> IO Word32
+ System.BSD.Sysctl: sysctlReadULong :: SysctlKey k => k -> IO Word64
- System.BSD.Sysctl: sysctlWriteLong :: SysctlKey k => k -> Int32 -> IO ()
+ System.BSD.Sysctl: sysctlWriteLong :: SysctlKey k => k -> Int64 -> IO ()
- System.BSD.Sysctl: sysctlWriteULong :: SysctlKey k => k -> Word32 -> IO ()
+ System.BSD.Sysctl: sysctlWriteULong :: SysctlKey k => k -> Word64 -> IO ()
Files
- Setup.hs +8/−6
- System/BSD/Sysctl.hsc +23/−23
- bsd-sysctl.cabal +32/−25
- demo/demo.cabal +7/−6
- demo/demo.output +0/−14
Setup.hs view
@@ -1,9 +1,11 @@-import Distribution.Simple-import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(withPrograms), buildDir)-import Distribution.Simple.Program (userSpecifyArgs)+import Control.Exception+import Distribution.Simple+import Distribution.Simple.LocalBuildInfo (LocalBuildInfo (withPrograms),+ buildDir)+import Distribution.Simple.Program (userSpecifyArgs) -import System.Directory-import System.FilePath+import System.Directory+import System.FilePath -- Define __HADDOCK__ when building documentation. main = defaultMainWithHooks simpleUserHooks {@@ -19,4 +21,4 @@ removePreProcessedFiles dir = do putStrLn $ "Trying to remove source in: " ++ dir removeFile (dir </> "System/BSD/Sysctl.hs")- `catch` \_ -> putStrLn "Could not find source file!" >> return ()+ `catch` ((\_ -> putStrLn "Could not find source file!") :: IOException -> IO ()) >> return ()
System/BSD/Sysctl.hsc view
@@ -6,7 +6,7 @@ ----------------------------------------------------------------------------- -- | -- Module : System.BSD.Sysctl--- Copyright : (c) Maxime Henrion 2009+-- Copyright : (c) Maxime Henrion 2009-2010 -- License : see LICENSE -- -- Maintainer : mhenrion@gmail.com@@ -43,36 +43,36 @@ -- * OID creation and extraction #ifdef HAVE_SYSCTLNAMETOMIB- sysctlNameToOid, -- :: String -> IO OID- sysctlNameToOidArgs, -- :: String -> [#{type int}] -> IO OID+ sysctlNameToOid, -- :: String -> IO OID+ sysctlNameToOidArgs, -- :: String -> [#{type int}] -> IO OID #endif- sysctlPrepareOid, -- :: [#{type int}] -> IO OID- sysctlExtractOid, -- :: OID -> IO [#{type int}]+ sysctlPrepareOid, -- :: [#{type int}] -> IO OID+ sysctlExtractOid, -- :: OID -> IO [#{type int}] -- * Basic reading functions- sysctlReadInt, -- :: SysctlKey k => k -> IO #{type int}- sysctlReadUInt, -- :: SysctlKey k => k -> IO #{type unsigned int}- sysctlReadLong, -- :: SysctlKey k => k -> IO #{type long}- sysctlReadULong, -- :: SysctlKey k => k -> IO #{type unsigned long}- sysctlReadQuad, -- :: SysctlKey k => k -> IO Int64- sysctlReadUQuad, -- :: SysctlKey k => k -> IO Word64- sysctlReadString, -- :: SysctlKey k => k -> IO String+ sysctlReadInt, -- :: SysctlKey k => k -> IO #{type int}+ sysctlReadUInt, -- :: SysctlKey k => k -> IO #{type unsigned int}+ sysctlReadLong, -- :: SysctlKey k => k -> IO #{type long}+ sysctlReadULong, -- :: SysctlKey k => k -> IO #{type unsigned long}+ sysctlReadQuad, -- :: SysctlKey k => k -> IO Int64+ sysctlReadUQuad, -- :: SysctlKey k => k -> IO Word64+ sysctlReadString, -- :: SysctlKey k => k -> IO String -- * Advanced reading functions- sysctlPeek, -- :: forall k a. (SysctlKey k, Storable a) => k -> IO a- sysctlPeekArray, -- :: forall k a. (SysctlKey k, Storable a) => k -> IO [a]+ sysctlPeek, -- :: forall k a. (SysctlKey k, Storable a) => k -> IO a+ sysctlPeekArray, -- :: forall k a. (SysctlKey k, Storable a) => k -> IO [a] -- * Basic writing functions- sysctlWriteInt, -- :: SysctlKey k => k -> #{type int} -> IO ()- sysctlWriteUInt, -- :: SysctlKey k => k -> #{type unsigned int} -> IO ()- sysctlWriteLong, -- :: SysctlKey k => k -> #{type long} -> IO ()- sysctlWriteULong, -- :: SysctlKey k => k -> #{type unsigned long} -> IO ()- sysctlWriteQuad, -- :: SysctlKey k => k -> Int64 -> IO ()- sysctlWriteUQuad, -- :: SysctlKey k => k -> Word64 -> IO ()- sysctlWriteString, -- :: SysctlKey k => k -> String -> IO ()+ sysctlWriteInt, -- :: SysctlKey k => k -> #{type int} -> IO ()+ sysctlWriteUInt, -- :: SysctlKey k => k -> #{type unsigned int} -> IO ()+ sysctlWriteLong, -- :: SysctlKey k => k -> #{type long} -> IO ()+ sysctlWriteULong, -- :: SysctlKey k => k -> #{type unsigned long} -> IO ()+ sysctlWriteQuad, -- :: SysctlKey k => k -> Int64 -> IO ()+ sysctlWriteUQuad, -- :: SysctlKey k => k -> Word64 -> IO ()+ sysctlWriteString, -- :: SysctlKey k => k -> String -> IO () -- * Advanced writing functions- sysctlPoke -- :: (SysctlKey k, Storable a) => k -> a -> IO ()+ sysctlPoke -- :: (SysctlKey k, Storable a) => k -> a -> IO () ) where import Control.Arrow (second)@@ -226,7 +226,7 @@ sysctlReadDynamic key scale f = withKey key $ \oid len -> do size <- sysctlGetSize oid len- let bufSize = scale size -- Allows to make room for lists of variable length+ let bufSize = scale size -- Allows to make room for lists of variable length allocaBytes (fromIntegral bufSize) $ \buf -> sysctlRead oid len buf bufSize f
bsd-sysctl.cabal view
@@ -1,32 +1,39 @@-Name: bsd-sysctl-Version: 1.0.7-License-File: LICENSE-License: BSD3-Author: Maxime Henrion-Copyright: 2009-2010, Maxime Henrion-Maintainer: Maxime Henrion <mhenrion@gmail.com>-Bug-Reports: http://bitbucket.org/mux/bsd-sysctl/issues/-Category: System, BSD-Synopsis: Access to the BSD sysctl(3) interface-Description:+name: bsd-sysctl+version: 1.0.8.0+license-File: LICENSE+license: BSD3+author: Maxime Henrion+copyright: 2009-2010, Maxime Henrion+maintainer: Alexei Pastuchov <info@maximka.de>+bug-reports: https://github.com:p-alik/bsd-sysctl/issues+homepage: https://github.com:p-alik/bsd-sysctl+category: System, BSD+synopsis: Access to the BSD sysctl(3) interface+description: This module provides efficient access to the BSD sysctl(3) interface via the Haskell FFI. . It allows to read and write both basic sysctl types, as well as complex opaque types (typically C structures) described via Storable instances.-Build-Type: Custom-Cabal-Version: >= 1.6-Tested-with: GHC ==6.10, GHC ==6.12-Extra-Source-Files:- demo/Demo.hsc demo/demo.cabal demo/demo.output demo/Setup.hs+build-type: Simple+cabal-version: >=1.10+tested-with: GHC ==6.10+ , GHC ==6.12+ , GHC ==7.8.4+ , GHC ==7.10.3+ , GHC ==8.0.2+extra-source-files:+ demo/Demo.hsc+ demo/Setup.hs+ demo/demo.cabal -Source-Repository head- Type: mercurial- Location: http://bitbucket.org/mux/bsd-sysctl/+library+ build-depends: base >= 4.7 && < 5+ exposed-modules: System.BSD.Sysctl+ ghc-options: -Wall -O2 -funbox-strict-fields+ default-language: Haskell2010 -Library- Build-Depends: base >= 3 && < 5- Exposed-Modules: System.BSD.Sysctl- Extensions: ForeignFunctionInterface, ScopedTypeVariables,- TypeSynonymInstances, FlexibleInstances- GHC-Options: -Wall -O2 -funbox-strict-fields+source-repository head+ type: git+ location: https://github.com:p-alik/bsd-sysctl+
demo/demo.cabal view
@@ -1,6 +1,7 @@-Name: demo-Version: 0.0-Build-Depends: base >= 3 && < 5, bsd-sysctl-Build-Type: Simple-Executable: demo-Main-is: Demo.hs+name: demo+version: 0.0+Build-Depends: base >= 3 && < 5,+ bsd-sysctl+build-type: Simple+executable: demo+main-is: Demo.hs
− demo/demo.output
@@ -1,14 +0,0 @@-kern.osrelease: 7.2-PRERELEASE-kern.boottime: { usec = 1241115805, usec = 736670 }-kern.maxfiles: 32768-kern.lastpid: 90199-vfs.numvnodes: 45973-net.inet.tcp.recvspace: 65536-PID UID COMMAND-90199 1001 demo-89970 1001 vim-89593 1001 zsh-87861 1001 screen-87841 1001 ssh-[...lots of lines removed...]-test: sysctl: permission denied (Operation not permitted)