summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Erdmann <n@nirf.de>2021-01-06 20:21:23 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-09 21:25:19 -0500
commit4d1ea2c3dfc75b17dbd6f16e12bf7d037c708622 (patch)
tree944205e10de2aa624cd8f1f80adba6df7af637a3
parent78629c2480d6d15616cb8c2614f7b19c33c003ad (diff)
downloadhaskell-4d1ea2c3dfc75b17dbd6f16e12bf7d037c708622.tar.gz
Fix calls to varargs C function fcntl
The ccall calling convention doesn't support varargs functions, so switch to capi instead. See https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html#varargs-not-supported-by-ccall-calling-convention
-rw-r--r--libraries/base/GHC/IO/Handle/Lock/LinuxOFD.hsc3
1 files changed, 2 insertions, 1 deletions
diff --git a/libraries/base/GHC/IO/Handle/Lock/LinuxOFD.hsc b/libraries/base/GHC/IO/Handle/Lock/LinuxOFD.hsc
index 86d1545db8..40e70ebce7 100644
--- a/libraries/base/GHC/IO/Handle/Lock/LinuxOFD.hsc
+++ b/libraries/base/GHC/IO/Handle/Lock/LinuxOFD.hsc
@@ -1,3 +1,4 @@
+{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE InterruptibleFFI #-}
{-# LANGUAGE MultiWayIf #-}
@@ -40,7 +41,7 @@ import System.Posix.Types (COff, CPid)
-- use ordinary POSIX file locking due to its peculiar semantics under
-- multi-threaded environments.
-foreign import ccall interruptible "fcntl"
+foreign import capi interruptible "fcntl.h fcntl"
c_fcntl :: CInt -> CInt -> Ptr FLock -> IO CInt
data FLock = FLock { l_type :: CShort