posix-api 0.4.0.1 → 0.5.0.0
raw patch · 3 files changed
+7/−41 lines, 3 files
Files
- CHANGELOG.md +4/−0
- posix-api.cabal +3/−5
- src/Linux/Systemd.hs +0/−36
CHANGELOG.md view
@@ -7,6 +7,10 @@ This project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## [0.5.0.0] - 2023-07-13++- Move Linux.Systemd to systemd-api library to make docs build on hackage.+ ## [0.4.0.1] - 2023-06-27 - Build with GHC 9.4
posix-api.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: posix-api-version: 0.4.0.1+version: 0.5.0.0 synopsis: posix bindings description: This library provides a very thin wrapper around POSIX APIs. It can be@@ -82,7 +82,6 @@ Linux.Epoll Linux.MessageQueue Linux.Socket- Linux.Systemd Posix.Directory Posix.File Posix.MessageQueue@@ -106,10 +105,10 @@ , base >=4.17.1 && <5 , byte-order >= 0.1.2 && <0.2 , byteslice >= 0.2.10 && <0.3- , primitive >= 0.7 && <0.8+ , primitive >= 0.7 && <0.10 , primitive-addr >= 0.1 && <0.2 , primitive-offset >= 0.2 && <0.3- , primitive-unlifted >= 2.0 && <2.1+ , primitive-unlifted >= 2.0 && <2.2 , run-st >= 0.1.1 && <0.2 , text-short >=0.1.5 hs-source-dirs: src@@ -124,7 +123,6 @@ c-sources: cbits/HaskellPosix.c include-dirs: include includes: HaskellPosix.h- extra-libraries: systemd build-tool-depends: hsc2hs:hsc2hs >= 0.68.5 test-suite test
− src/Linux/Systemd.hs
@@ -1,36 +0,0 @@-module Linux.Systemd- ( listenFds- , isSocket- ) where--import Foreign.C.Types (CInt(..))-import System.Posix.Types (Fd(..))-import Foreign.C.Error (Errno,getErrno)-import Posix.Socket.Types (Type(..),Family(..))--foreign import ccall unsafe "systemd/sd-daemon.h sd_listen_fds"- c_listenFds :: CInt -> IO CInt--foreign import ccall unsafe "systemd/sd-daemon.h sd_is_socket"- c_isSocket :: Fd -> Family -> Type -> CInt -> IO CInt---- | Check for file descriptors passed by the system manager. Returns--- the number of received file descriptors. If no file descriptors--- have been received, zero is returned.-listenFds ::- CInt -- ^ unset environment (non-zero unsets @LISTEN_FDS@, @LISTEN_PID@, and @LISTEN_FDNAMES@)- -> IO (Either Errno CInt)-listenFds a = c_listenFds a >>= errorsFromInt--isSocket :: - Fd -- ^ File descriptor- -> Family -- ^ Socket family- -> Type -- ^ Socket type- -> CInt -- ^ Positive: require listen mode. Zero: require non-listening mode.- -> IO (Either Errno CInt)-isSocket a b c d = c_isSocket a b c d >>= errorsFromInt--errorsFromInt :: CInt -> IO (Either Errno CInt)-errorsFromInt r = if r >= 0- then pure (Right r)- else fmap Left getErrno