diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # ChangeLog for warp
 
+## 3.3.21
+
+* Support GHC 9.4 [#889](https://github.com/yesodweb/wai/pull/889)
+
 ## 3.3.20
 
 * Adding "x509" flag.
diff --git a/Network/Wai/Handler/Warp/Settings.hs b/Network/Wai/Handler/Warp/Settings.hs
--- a/Network/Wai/Handler/Warp/Settings.hs
+++ b/Network/Wai/Handler/Warp/Settings.hs
@@ -249,7 +249,16 @@
 -- @since 3.3.17
 defaultFork :: ((forall a. IO a -> IO a) -> IO ()) -> IO ()
 defaultFork io =
+#if __GLASGOW_HASKELL__ >= 904
   IO $ \s0 ->
+    case io unsafeUnmask of
+      IO io' ->
+        case (fork# io' s0) of
+          (# s1, _tid #) ->
+            (# s1, () #)
+#else
+  IO $ \s0 ->
     case (fork# (io unsafeUnmask) s0) of
       (# s1, _tid #) ->
         (# s1, () #)
+#endif
diff --git a/warp.cabal b/warp.cabal
--- a/warp.cabal
+++ b/warp.cabal
@@ -1,5 +1,5 @@
 Name:                warp
-Version:             3.3.20
+Version:             3.3.21
 Synopsis:            A fast, light-weight web server for WAI applications.
 License:             MIT
 License-file:        LICENSE
@@ -187,6 +187,7 @@
     Type:            exitcode-stdio-1.0
 
     Ghc-Options:     -Wall -threaded
+    Build-Tool-Depends: hspec-discover:hspec-discover
     Build-Depends:   base >= 4.8 && < 5
                    , HUnit
                    , QuickCheck
@@ -219,7 +220,6 @@
                    , wai                       >= 3.2      && < 3.3
                    , word8
                    , unliftio
-    -- Build-Tool-Depends: hspec-discover:hspec-discover
   if flag(x509)
       Build-Depends: x509
   if impl(ghc < 8)
