aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--System/Posix/User.hsc6
-rw-r--r--changelog.md4
2 files changed, 7 insertions, 3 deletions
diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc
index ff7268f..50c9f41 100644
--- a/System/Posix/User.hsc
+++ b/System/Posix/User.hsc
@@ -1,5 +1,5 @@
#ifdef __GLASGOW_HASKELL__
-{-# LANGUAGE Trustworthy #-}
+{-# LANGUAGE Trustworthy, CApiFFI #-}
#endif
-----------------------------------------------------------------------------
-- |
@@ -207,7 +207,7 @@ getGroupEntryForID gid =
doubleAllocWhileERANGE "getGroupEntryForID" "group" grBufSize unpackGroupEntry $
c_getgrgid_r gid pgr
-foreign import ccall unsafe "getgrgid_r"
+foreign import capi unsafe "HsUnix.h getgrgid_r"
c_getgrgid_r :: CGid -> Ptr CGroup -> CString
-> CSize -> Ptr (Ptr CGroup) -> IO CInt
#else
@@ -226,7 +226,7 @@ getGroupEntryForName name =
doubleAllocWhileERANGE "getGroupEntryForName" "group" grBufSize unpackGroupEntry $
c_getgrnam_r pstr pgr
-foreign import ccall unsafe "getgrnam_r"
+foreign import capi unsafe "HsUnix.h getgrnam_r"
c_getgrnam_r :: CString -> Ptr CGroup -> CString
-> CSize -> Ptr (Ptr CGroup) -> IO CInt
#else
diff --git a/changelog.md b/changelog.md
index 4440892..ae5b726 100644
--- a/changelog.md
+++ b/changelog.md
@@ -5,6 +5,10 @@
* Add support for `base-4.8.0.0`
* Add haddock comments on `RTLD_NEXT` and `RTLD_DEFAULT`
* Deprecate function `haveRtldLocal`
+ * Fix `getGroupEntryForID/getGroupEntryForName' on Solaris. Solaris uses
+ CPP macros for required getgrgid_r and getgrnam_r functions definition
+ so the fix is to change from C ABI calling convention to C API calling
+ convention
## 2.7.0.1 *Mar 2014*