aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dlfcn/dlclose.c')
-rw-r--r--dlfcn/dlclose.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/dlfcn/dlclose.c b/dlfcn/dlclose.c
index 046e6d4d98..3ddedcffbe 100644
--- a/dlfcn/dlclose.c
+++ b/dlfcn/dlclose.c
@@ -1,5 +1,6 @@
/* Close a handle opened by `dlopen'.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2004
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +20,16 @@
#include <dlfcn.h>
+#if !defined SHARED && defined IS_IN_libdl
+
+int
+dlclose (void *handle)
+{
+ return __dlclose (handle);
+}
+
+#else
+
static void
dlclose_doit (void *handle)
{
@@ -26,7 +37,16 @@ dlclose_doit (void *handle)
}
int
-dlclose (void *handle)
+__dlclose (void *handle)
{
+# ifdef SHARED
+ if (__builtin_expect (_dlfcn_hook != NULL, 0))
+ return _dlfcn_hook->dlclose (handle);
+# endif
+
return _dlerror_run (dlclose_doit, handle) ? -1 : 0;
}
+# ifdef SHARED
+strong_alias (__dlclose, dlclose)
+# endif
+#endif