diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Version 0.0.6.0 2023-06-27 by luispedro
+	* Add compatibility code for unix-2.8 (which changed the signature of
+	openFd)
+
 Version 0.0.5.0 2018-01-18 by luispedro
 	* Deprecate safeSinkFile
 	* Add fake Windows support
diff --git a/Data/Conduit/SafeWrite.hs b/Data/Conduit/SafeWrite.hs
--- a/Data/Conduit/SafeWrite.hs
+++ b/Data/Conduit/SafeWrite.hs
@@ -22,7 +22,7 @@
 -- This function is deprecated in favor of 'Data.Conduit.Binary.SinkFileCautious'
 safeSinkFile :: (MonadResource m) =>
                     FilePath -- ^ Final filename
-                    -> C.Sink B.ByteString m ()
+                    -> C.ConduitT B.ByteString C.Void m ()
 safeSinkFile finalname = atomicConduitUseFile finalname CC.sinkHandle
 
 -- | Conduit using a Handle in an atomic way
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,5 +1,11 @@
 # SafeIO: Haskell library for safe (atomic) IO
 
+[![Hackage](https://img.shields.io/hackage/v/safeio.svg)](https://hackage.haskell.org/package/safeio)
+[![Hackage-Deps](https://img.shields.io/hackage-deps/v/safeio.svg)](http://packdeps.haskellers.com/feed?needle=safeio)
+[![Stackage (LTS)](http://stackage.org/package/safeio/badge/lts)](http://stackage.org/lts/package/safeio)
+[![Travis](https://api.travis-ci.com/luispedro/safeio.png)](https://travis-ci.com/luispedro/safeio)
+Atomic IO
+
 This is a simple module, which enables writing in atomic mode. It
 implements the following 4 step procedure:
 
diff --git a/System/IO/SafeWrite.hs b/System/IO/SafeWrite.hs
--- a/System/IO/SafeWrite.hs
+++ b/System/IO/SafeWrite.hs
@@ -12,10 +12,20 @@
 import           System.Directory (renameFile, removeFile)
 
 #ifndef WINDOWS
-import           System.Posix.IO (openFd, defaultFileFlags, closeFd, OpenMode(..))
+import           System.Posix.IO (defaultFileFlags, closeFd, OpenMode(..))
+import qualified System.Posix.IO
+import qualified System.Posix.Types
 import           System.Posix.Unistd (fileSynchronise)
 #endif
 
+
+openFd :: FilePath -> OpenMode -> System.Posix.IO.OpenFileFlags -> IO System.Posix.Types.Fd
+#if MIN_VERSION_base (4,18,0)
+openFd = System.Posix.IO.openFd
+#else
+openFd fname mode flags = System.Posix.IO.openFd fname mode Nothing flags
+#endif
+
 -- | Sync a file to disk
 --
 -- On Windows, this is a fake function.
@@ -23,11 +33,11 @@
             -> IO ()
 #ifndef WINDOWS
 syncFile fname = do
-    bracket (openFd fname ReadWrite Nothing defaultFileFlags)
+    bracket (openFd fname ReadWrite defaultFileFlags)
         closeFd
         fileSynchronise
     -- The code below will not work on Windows
-    bracket (openFd (takeDirectory fname) ReadOnly Nothing defaultFileFlags)
+    bracket (openFd (takeDirectory fname) ReadOnly defaultFileFlags)
         closeFd
         fileSynchronise
 #else
diff --git a/System/IO/SafeWrite/Tests.hs b/System/IO/SafeWrite/Tests.hs
--- a/System/IO/SafeWrite/Tests.hs
+++ b/System/IO/SafeWrite/Tests.hs
@@ -2,11 +2,11 @@
 
 module Main where
 
-import           Test.Framework.TH
-import           Test.HUnit
-import           Test.Framework.Providers.HUnit
+import Test.Tasty.TH
+import Test.Tasty.HUnit
 
 import qualified Data.ByteString as B
+import qualified Data.ByteString.Char8 as B8
 import qualified Data.Conduit as C
 import qualified Data.Conduit.Combinators as CC
 import           Data.Conduit ((.|))
@@ -80,7 +80,7 @@
     where
         writeout h = C.awaitForever $ \line -> do
             C.yield line
-            liftIO $ B.hPutStrLn h (B.take 8 line)
+            liftIO $ B8.hPutStrLn h (B.take 8 line)
 
 case_conduit_not_create_on_exception = do
     (C.runConduitRes $
diff --git a/safeio.cabal b/safeio.cabal
--- a/safeio.cabal
+++ b/safeio.cabal
@@ -1,9 +1,11 @@
--- This file has been generated from package.yaml by hpack version 0.18.1.
+cabal-version: 1.12
+
+-- This file has been generated from package.yaml by hpack version 0.35.1.
 --
 -- see: https://github.com/sol/hpack
 
 name:           safeio
-version:        0.0.5.0
+version:        0.0.6.0
 synopsis:       Write output to disk atomically
 description:    This package implements utilities to perform atomic output so as to avoid the problem of partial intermediate files.
 category:       IO
@@ -14,62 +16,67 @@
 license:        MIT
 license-file:   COPYING
 build-type:     Simple
-cabal-version:  >= 1.10
-
 extra-source-files:
-    ChangeLog
     README.md
+    ChangeLog
 
 source-repository head
   type: git
   location: https://github.com/luispedro/safeio
 
 library
+  exposed-modules:
+      System.IO.SafeWrite
+      Data.Conduit.SafeWrite
   hs-source-dirs:
       ./
-  default-extensions: BangPatterns OverloadedStrings CPP
+  default-extensions:
+      BangPatterns
+      OverloadedStrings
+      CPP
   ghc-options: -Wall
   build-depends:
-      base > 4.8 && < 5
+      base >4.8 && <5
     , bytestring
-    , conduit >= 1.0
+    , conduit >=1.0
     , conduit-combinators
     , directory
     , exceptions
     , filepath
     , resourcet
     , unix
+  default-language: Haskell2010
   if os(windows)
     cpp-options: -DWINDOWS
-  exposed-modules:
-      System.IO.SafeWrite
-      Data.Conduit.SafeWrite
-  default-language: Haskell2010
 
 test-suite safeiotest
   type: exitcode-stdio-1.0
   main-is: System/IO/SafeWrite/Tests.hs
+  other-modules:
+      Data.Conduit.SafeWrite
+      System.IO.SafeWrite
+      Paths_safeio
   hs-source-dirs:
       ./
-  default-extensions: BangPatterns OverloadedStrings CPP
+  default-extensions:
+      BangPatterns
+      OverloadedStrings
+      CPP
   ghc-options: -Wall
   build-depends:
-      base > 4.8 && < 5
+      HUnit
+    , base >4.8 && <5
     , bytestring
-    , conduit >= 1.0
+    , conduit >=1.0
     , conduit-combinators
     , directory
     , exceptions
     , filepath
     , resourcet
+    , tasty
+    , tasty-hunit
+    , tasty-th
     , unix
-    , HUnit
-    , test-framework
-    , test-framework-hunit
-    , test-framework-th
+  default-language: Haskell2010
   if os(windows)
     cpp-options: -DWINDOWS
-  other-modules:
-      Data.Conduit.SafeWrite
-      System.IO.SafeWrite
-  default-language: Haskell2010
