#define _GNU_SOURCE
#include <dlfcn.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <string.h>
+#include "fips.h"
#include "dlwrap.h"
-#define STRNCMP_LITERAL(var, literal) \
- strncmp ((var), (literal), sizeof (literal) - 1)
-
void *libfips_handle;
typedef void * (* fips_dlopen_t)(const char * filename, int flag);
void *
dlwrap_real_dlopen (const char *filename, int flag)
{
- fips_dlopen_t real_dlopen = NULL;
+ static fips_dlopen_t real_dlopen = NULL;
if (! real_dlopen) {
real_dlopen = (fips_dlopen_t) dlwrap_real_dlsym (RTLD_NEXT, "dlopen");
return dlwrap_real_dlsym (handle, name);
}
-extern void *__dlsym (void *handle, const char *name);
void *
dlwrap_real_dlsym (void *handle, const char *name)
{