#include <sys/types.h>
#include <nlist.h>
#include <link.h>
#include <dlfcn.h>
#include "utils/dynamic_loader.h"
Go to the source code of this file.
Define Documentation
#define pg_dlclose BSD44_derived_dlclose |
#define pg_dlerror BSD44_derived_dlerror |
#define pg_dlopen |
( |
|
f |
) |
BSD44_derived_dlopen((f), RTLD_NOW | RTLD_GLOBAL) |
#define pg_dlsym BSD44_derived_dlsym |
Function Documentation
void BSD44_derived_dlclose |
( |
void * |
handle |
) |
|
char* BSD44_derived_dlerror |
( |
void |
|
) |
|
void* BSD44_derived_dlopen |
( |
const char * |
filename, |
|
|
int |
num | |
|
) |
| | |
void* BSD44_derived_dlsym |
( |
void * |
handle, |
|
|
const char * |
name | |
|
) |
| | |
Definition at line 75 of file freebsd.c.
{
#if !defined(HAVE_DLOPEN)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return NULL;
#else
void *vp;
#ifndef __ELF__
char buf[BUFSIZ];
if (*name != '_')
{
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
#endif
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return vp;
#endif
}