diff --git a/HsDirectoryConfig.h.in b/HsDirectoryConfig.h.in
--- a/HsDirectoryConfig.h.in
+++ b/HsDirectoryConfig.h.in
@@ -48,9 +48,6 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define to 1 if you have the `utimensat' function. */
-#undef HAVE_UTIMENSAT
-
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
diff --git a/System/Directory/Internal/C_utimensat.hsc b/System/Directory/Internal/C_utimensat.hsc
--- a/System/Directory/Internal/C_utimensat.hsc
+++ b/System/Directory/Internal/C_utimensat.hsc
@@ -1,3 +1,5 @@
+{-# LANGUAGE CApiFFI #-}
+
 module System.Directory.Internal.C_utimensat where
 #include <HsDirectoryConfig.h>
 #ifdef HAVE_UTIMENSAT
@@ -41,7 +43,7 @@
     (sec,  frac)  = if frac' < 0 then (sec' - 1, frac' + 1) else (sec', frac')
     (sec', frac') = properFraction (toRational t)
 
-foreign import ccall "utimensat" c_utimensat
+foreign import capi "sys/stat.h utimensat" c_utimensat
   :: CInt -> CString -> Ptr CTimeSpec -> CInt -> IO CInt
 
 #endif
diff --git a/System/Directory/Internal/Windows.hsc b/System/Directory/Internal/Windows.hsc
--- a/System/Directory/Internal/Windows.hsc
+++ b/System/Directory/Internal/Windows.hsc
@@ -330,7 +330,7 @@
       '\\' : '\\' : '?' : '\\' : _ -> simplifiedPath
       '\\' : '\\' : '.' : '\\' : _ -> simplifiedPath
       '\\' : '\\' : _ ->
-        os "\\\\?\\UNC" <> pack (tail simplifiedPath')
+        os "\\\\?\\UNC" <> pack (drop 1 simplifiedPath')
       _ -> os "\\\\?\\" <> simplifiedPath
   where simplifiedPath = simplify path
         simplifiedPath' = unpack simplifiedPath
diff --git a/System/Directory/OsPath.hs b/System/Directory/OsPath.hs
--- a/System/Directory/OsPath.hs
+++ b/System/Directory/OsPath.hs
@@ -120,6 +120,7 @@
   , splitSearchPath
   , takeDirectory
   )
+import qualified Data.List.NonEmpty as NE
 import Data.Time (UTCTime)
 import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)
 
@@ -890,7 +891,7 @@
 
         segments = splitDirectories path
         prefixes = scanl1 (</>) segments
-        suffixes = tail (scanr (</>) mempty segments)
+        suffixes = NE.tail (NE.scanr (</>) mempty segments)
 
         -- try to call realpath on the largest possible prefix
         realpathPrefix candidates =
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,6 +1,13 @@
 Changelog for the [`directory`][1] package
 ==========================================
 
+## 1.3.8.1 (Feb 2023)
+
+  * Use CApiFFI for utimensat.
+    ([#145](https://github.com/haskell/directory/pull/145))
+  * Relax `base` version bounds to support 4.18.
+    ([#151](https://github.com/haskell/directory/pull/151))
+
 ## 1.3.8.0 (Sep 2022)
 
   * Drop support for `base` older than 4.11.0.
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -3383,13 +3383,6 @@
 
 fi
 
-ac_fn_c_check_func "$LINENO" "utimensat" "ac_cv_func_utimensat"
-if test "x$ac_cv_func_utimensat" = xyes
-then :
-  printf "%s\n" "#define HAVE_UTIMENSAT 1" >>confdefs.h
-
-fi
-
 ac_fn_c_check_func "$LINENO" "CreateSymbolicLinkW" "ac_cv_func_CreateSymbolicLinkW"
 if test "x$ac_cv_func_CreateSymbolicLinkW" = xyes
 then :
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,6 @@
 AC_CHECK_HEADERS([fcntl.h limits.h sys/types.h sys/stat.h time.h])
 
 AC_CHECK_FUNCS([realpath])
-AC_CHECK_FUNCS([utimensat])
 AC_CHECK_FUNCS([CreateSymbolicLinkW])
 AC_CHECK_FUNCS([GetFinalPathNameByHandleW])
 
diff --git a/directory.cabal b/directory.cabal
--- a/directory.cabal
+++ b/directory.cabal
@@ -1,6 +1,7 @@
+cabal-version:  2.2
 name:           directory
-version:        1.3.8.0
-license:        BSD3
+version:        1.3.8.1
+license:        BSD-3-Clause
 license-file:   LICENSE
 maintainer:     libraries@haskell.org
 bug-reports:    https://github.com/haskell/directory/issues
@@ -10,8 +11,7 @@
   directories in a portable way.
 category:       System
 build-type:     Configure
-cabal-version:  >= 1.10
-tested-with:    GHC>=7.4.1
+tested-with:    GHC == 8.6.5 || == 8.10.7 || == 9.0.2 || == 9.2.4 || == 9.4.3
 
 extra-tmp-files:
     autom4te.cache
@@ -36,7 +36,7 @@
 
 Library
     default-language: Haskell2010
-    other-extensions: CPP
+    other-extensions: CApiFFI, CPP
 
     exposed-modules:
         System.Directory
@@ -53,7 +53,7 @@
     include-dirs: .
 
     build-depends:
-        base     >= 4.11.0 && < 4.18,
+        base     >= 4.11.0 && < 4.19,
         time     >= 1.8.0 && < 1.13,
         filepath >= 1.4.100 && < 1.5
     if os(windows)
