summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Erdmann <n@nirf.de>2021-01-06 20:21:23 +0100
committerBen Gamari <ben@smart-cactus.org>2021-01-06 22:28:38 -0500
commit740be0a7f84eb02bf06b386273795667a3bc4761 (patch)
treeeb1b70ec335e8a146d2041093a3e36a4b33d50d6
parent26a928b8fdb1b4ccb75e8edb620b8cf12cb38621 (diff)
downloadhaskell-740be0a7f84eb02bf06b386273795667a3bc4761.tar.gz
Fix calls to varargs C function fcntlwip/fix-fnctl
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