diff --git a/Changelog b/Changelog
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,6 @@
+Changed in version 0.8.1.3:
+   * Use the capi calling convention for ioctl (#163).
+
 Changed in version 0.8.1.2:
    * Add import list to Data.List (#153)
 
diff --git a/System/Console/Haskeline/Backend/Posix.hsc b/System/Console/Haskeline/Backend/Posix.hsc
--- a/System/Console/Haskeline/Backend/Posix.hsc
+++ b/System/Console/Haskeline/Backend/Posix.hsc
@@ -1,3 +1,5 @@
+{-# LANGUAGE CApiFFI #-}
+
 module System.Console.Haskeline.Backend.Posix (
                         withPosixGetEvent,
                         posixLayouts,
@@ -61,7 +63,7 @@
 -------------------
 -- Window size
 
-foreign import ccall ioctl :: FD -> CULong -> Ptr a -> IO CInt
+foreign import capi "sys/ioctl.h ioctl" ioctl :: FD -> CULong -> Ptr a -> IO CInt
 
 posixLayouts :: Handles -> [IO (Maybe Layout)]
 posixLayouts h = [ioctlLayout $ ehOut h, envLayout]
diff --git a/haskeline.cabal b/haskeline.cabal
--- a/haskeline.cabal
+++ b/haskeline.cabal
@@ -1,6 +1,6 @@
 Name:           haskeline
 Cabal-Version:  >=1.10
-Version:        0.8.1.2
+Version:        0.8.1.3
 Category:       User Interfaces
 License:        BSD3
 License-File:   LICENSE
