#include "postgres.h"
#include <nlist.h>
#include <link.h>
#include <dlfcn.h>
#include "dynloader.h"
Go to the source code of this file.
Functions | |
char * | BSD44_derived_dlerror (void) |
void * | BSD44_derived_dlopen (const char *file, int num) |
void * | BSD44_derived_dlsym (void *handle, const char *name) |
void | BSD44_derived_dlclose (void *handle) |
Variables | |
static char | error_message [BUFSIZ] |
void BSD44_derived_dlclose | ( | void * | handle | ) |
char* BSD44_derived_dlerror | ( | void | ) |
Definition at line 48 of file freebsd.c.
{ static char ret[BUFSIZ]; strcpy(ret, error_message); error_message[0] = 0; return (ret[0] == 0) ? NULL : ret; }
void* BSD44_derived_dlopen | ( | const char * | file, | |
int | num | |||
) |
Definition at line 58 of file freebsd.c.
{ #if !defined(HAVE_DLOPEN) snprintf(error_message, sizeof(error_message), "dlopen (%s) not supported", file); return NULL; #else void *vp; if ((vp = dlopen((char *) file, num)) == NULL) snprintf(error_message, sizeof(error_message), "dlopen (%s) failed: %s", file, dlerror()); return vp; #endif }
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 /* !__ELF__ */ if ((vp = dlsym(handle, (char *) name)) == NULL) snprintf(error_message, sizeof(error_message), "dlsym (%s) failed", name); return vp; #endif }
char error_message[BUFSIZ] [static] |
Definition at line 45 of file freebsd.c.
Referenced by BSD44_derived_dlerror(), BSD44_derived_dlopen(), and BSD44_derived_dlsym().