1 /* $NetBSD: dldb.c,v 1.2 2013/11/22 15:52:05 christos Exp $ */
9 static void relocate
__P(());
11 #define RELOC(func,returntype,args,proto,types) \
12 static returntype reloc_##func __P(proto); \
13 returntype (*nvi_##func) __P(proto) = reloc_##func; \
14 static returntype reloc_##func args \
18 return nvi_##func args; \
21 RELOC(db_create
,int,(a
,b
,c
),(DB
**, DB_ENV
*, u_int32_t
),
22 DB
**a
;DB_ENV
*b
;u_int32_t c
;)
23 RELOC(db_env_create
,int,(a
,b
),(DB_ENV
**, u_int32_t
),DB_ENV
** a
;u_int32_t b
;);
24 RELOC(db_strerror
,char *,(a
),(int),int a
;)
26 #define LOADSYM(func) \
27 if ((nvi_##func = dlsym(handle, #func)) == NULL) \
33 void *handle
= dlopen(_PATH_DB3
, RTLD_LAZY
);
39 LOADSYM(db_env_create
)
44 fprintf(stderr
, "Relocation error: %s\n", dlerror());