argument with pointer to data.
#include <link.h>
#include <dlfcn.h>
+static void
+dlclose_doit (void *handle)
+{
+ _dl_close (handle);
+}
+
int
dlclose (void *handle)
{
- void doit (void)
- {
- _dl_close (handle);
- }
-
- return _dlerror_run (doit) ? -1 : 0;
+ return _dlerror_run (dlclose_doit, handle) ? -1 : 0;
}
}
int
-_dlerror_run (void (*operate) (void))
+_dlerror_run (void (*operate) (void *), void *args)
{
if (last_errstring != NULL)
/* Free the error string from the last failed command. This can
free (last_errstring);
last_errcode = _dl_catch_error (&last_errstring, &last_object_name,
- operate);
+ operate, args);
return last_errstring != NULL;
}