diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/btree/btree.h | 12 | ||||
-rw-r--r-- | db/db.h | 1 | ||||
-rw-r--r-- | db/db/db.c | 10 | ||||
-rw-r--r-- | db/mpool.h | 8 | ||||
-rw-r--r-- | db/mpool/mpool.c | 29 |
5 files changed, 60 insertions, 0 deletions
diff --git a/db/btree/btree.h b/db/btree/btree.h index ab4c5b5ec4..45f7c94ed4 100644 --- a/db/btree/btree.h +++ b/db/btree/btree.h @@ -43,6 +43,18 @@ #include <mpool.h> +#ifdef _LIBC +/* In the GNU C library we must not pollute the namespace because libdb is + needed by libnss_db. */ +#define mpool_open __mpool_open +#define mpool_filter __mpool_filter +#define mpool_new __mpool_new +#define mpool_get __mpool_get +#define mpool_put __mpool_put +#define mpool_sync __mpool_sync +#define mpool_close __mpool_close +#endif + #define DEFMINKEYPAGE (2) /* Minimum keys per page */ #define MINCACHE (5) /* Minimum cached pages */ #define MINPSIZE (512) /* Minimum page size */ diff --git a/db/db.h b/db/db.h index 13c7495d64..8f1a9de9e2 100644 --- a/db/db.h +++ b/db/db.h @@ -224,6 +224,7 @@ typedef struct { #endif __BEGIN_DECLS +DB *__dbopen __P((const char *, int, int, DBTYPE, const void *)); DB *dbopen __P((const char *, int, int, DBTYPE, const void *)); #ifdef __DBINTERFACE_PRIVATE diff --git a/db/db/db.c b/db/db/db.c index c93b36ff75..49f6124580 100644 --- a/db/db/db.c +++ b/db/db/db.c @@ -44,6 +44,12 @@ static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94"; #include <db.h> +#ifdef _LIBC +/* In the GNU C library we must not pollute the namespace, because libdb + is needed by libnss_db. */ +#define dbopen __dbopen +#endif + DB * dbopen(fname, flags, mode, type, openinfo) const char *fname; @@ -72,6 +78,10 @@ dbopen(fname, flags, mode, type, openinfo) errno = EINVAL; return (NULL); } +#ifdef _LIBC +#undef dbopen +weak_alias (__dbopen, dbopen) +#endif static int __dberr __P((void)) diff --git a/db/mpool.h b/db/mpool.h index 40d1022309..e533072a65 100644 --- a/db/mpool.h +++ b/db/mpool.h @@ -85,13 +85,21 @@ typedef struct MPOOL { } MPOOL; __BEGIN_DECLS +MPOOL *__mpool_open __P((void *, int, pgno_t, pgno_t)); MPOOL *mpool_open __P((void *, int, pgno_t, pgno_t)); +void __mpool_filter __P((MPOOL *, void (*)(void *, pgno_t, void *), + void (*)(void *, pgno_t, void *), void *)); void mpool_filter __P((MPOOL *, void (*)(void *, pgno_t, void *), void (*)(void *, pgno_t, void *), void *)); +void *__mpool_new __P((MPOOL *, pgno_t *)); void *mpool_new __P((MPOOL *, pgno_t *)); +void *__mpool_get __P((MPOOL *, pgno_t, u_int)); void *mpool_get __P((MPOOL *, pgno_t, u_int)); +int __mpool_put __P((MPOOL *, void *, u_int)); int mpool_put __P((MPOOL *, void *, u_int)); +int __mpool_sync __P((MPOOL *)); int mpool_sync __P((MPOOL *)); +int __mpool_close __P((MPOOL *)); int mpool_close __P((MPOOL *)); #ifdef STATISTICS void mpool_stat __P((MPOOL *)); diff --git a/db/mpool/mpool.c b/db/mpool/mpool.c index 9956aca87b..7ced76fd4f 100644 --- a/db/mpool/mpool.c +++ b/db/mpool/mpool.c @@ -50,6 +50,18 @@ static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94"; #define __MPOOLINTERFACE_PRIVATE #include <mpool.h> +#ifdef _LIBC +/* In the GNU C library we must not pollute the namespace because libdb is + needed by libnss_db. */ +#define mpool_open __mpool_open +#define mpool_filter __mpool_filter +#define mpool_new __mpool_new +#define mpool_get __mpool_get +#define mpool_put __mpool_put +#define mpool_sync __mpool_sync +#define mpool_close __mpool_close +#endif + static BKT *mpool_bkt __P((MPOOL *)); static BKT *mpool_look __P((MPOOL *, pgno_t)); static int mpool_write __P((MPOOL *, BKT *)); @@ -301,6 +313,23 @@ mpool_sync(mp) return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS); } +#ifdef _LIBC +#undef mpool_open +#undef mpool_filter +#undef mpool_new +#undef mpool_get +#undef mpool_put +#undef mpool_close +#undef mpool_sync +weak_alias (__mpool_open, mpool_open) +weak_alias (__mpool_filter, mpool_filter) +weak_alias (__mpool_new, mpool_new) +weak_alias (__mpool_get, mpool_get) +weak_alias (__mpool_put, mpool_put) +weak_alias (__mpool_close, mpool_close) +weak_alias (__mpool_sync, mpool_sync) +#endif + /* * mpool_bkt * Get a page from the cache (or create one). |