From 4d1ea2c3dfc75b17dbd6f16e12bf7d037c708622 Mon Sep 17 00:00:00 2001 From: Nick Erdmann Date: Wed, 6 Jan 2021 20:21:23 +0100 Subject: 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 --- libraries/base/GHC/IO/Handle/Lock/LinuxOFD.hsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1