aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--System/Posix/DynamicLinker/Prim.hsc8
-rw-r--r--include/HsUnix.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/System/Posix/DynamicLinker/Prim.hsc b/System/Posix/DynamicLinker/Prim.hsc
index 2ab3a20..eb1985e 100644
--- a/System/Posix/DynamicLinker/Prim.hsc
+++ b/System/Posix/DynamicLinker/Prim.hsc
@@ -62,6 +62,10 @@ foreign import ccall unsafe "__hsunix_rtldNext" rtldNext :: Ptr a
haveRtldNext = False
#endif /* HAVE_RTLDNEXT */
+#ifdef HAVE_RTLDDEFAULT
+foreign import ccall unsafe "__hsunix_rtldDefault" rtldDefault :: Ptr a
+#endif /* HAVE_RTLDDEFAULT */
+
haveRtldLocal :: Bool
#ifdef HAVE_RTLDLOCAL
@@ -118,5 +122,9 @@ packDL Next = rtldNext
#else
packDL Next = error "RTLD_NEXT not available"
#endif
+#ifdef HAVE_RTLDDEFAULT
+packDL Default = rtldDefault
+#else
packDL Default = nullPtr
+#endif
packDL (DLHandle h) = h
diff --git a/include/HsUnix.h b/include/HsUnix.h
index cce4e5e..51bf111 100644
--- a/include/HsUnix.h
+++ b/include/HsUnix.h
@@ -103,6 +103,10 @@ INLINE int __hsunix_wstopsig (int stat) { return WSTOPSIG(stat); }
INLINE void *__hsunix_rtldNext (void) {return RTLD_NEXT;}
#endif
+#ifdef HAVE_RTLDDEFAULT
+INLINE void *__hsunix_rtldDefault (void) {return RTLD_DEFAULT;}
+#endif
+
/* O_SYNC doesn't exist on Mac OS X and (at least some versions of) FreeBSD,
fall back to O_FSYNC, which should be the same */
#ifndef O_SYNC