2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1997, 1998
5 * Sleepycat Software. All rights reserved.
11 static const char sccsid
[] = "@(#)os_config.c 10.30 (Sleepycat) 10/12/98";
14 #ifndef NO_SYSTEM_INCLUDES
15 #include <sys/types.h>
23 struct __db_jumptab __db_jump
;
25 DB_GLOBALS __db_global_values
= {
26 1, /* DB_MUTEXLOCKS */
28 0, /* DB_REGION_ANON, DB_REGION_NAME */
29 0, /* DB_REGION_INIT */
31 {NULL
, &__db_global_values
.db_envq
.tqh_first
}, /* Environemnt queue */
32 {NULL
, &__db_global_values
.db_nameq
.tqh_first
} /* Name queue */
37 * Replace functions for the DB package.
40 db_jump_set(func
, which
)
46 __db_jump
.j_close
= (int (*) __P((int)))func
;
49 __db_jump
.j_dirfree
= (void (*) __P((char **, int)))func
;
53 (int (*) __P((const char *, char ***, int *)))func
;
56 __db_jump
.j_exists
= (int (*) __P((const char *, int *)))func
;
59 __db_jump
.j_free
= (void (*) __P((void *)))func
;
62 __db_jump
.j_fsync
= (int (*) __P((int)))func
;
65 __db_jump
.j_ioinfo
= (int (*) __P((const char *,
66 int, u_int32_t
*, u_int32_t
*, u_int32_t
*)))func
;
69 __db_jump
.j_malloc
= (void *(*) __P((size_t)))func
;
72 __db_jump
.j_map
= (int (*)
73 __P((char *, int, size_t, int, int, int, void **)))func
;
76 __db_jump
.j_open
= (int (*) __P((const char *, int, ...)))func
;
80 (ssize_t (*) __P((int, void *, size_t)))func
;
83 __db_jump
.j_realloc
= (void *(*) __P((void *, size_t)))func
;
86 __db_jump
.j_runlink
= (int (*) __P((char *)))func
;
89 __db_jump
.j_seek
= (int (*)
90 __P((int, size_t, db_pgno_t
, u_int32_t
, int, int)))func
;
93 __db_jump
.j_sleep
= (int (*) __P((u_long
, u_long
)))func
;
96 __db_jump
.j_unlink
= (int (*) __P((const char *)))func
;
99 __db_jump
.j_unmap
= (int (*) __P((void *, size_t)))func
;
103 (ssize_t (*) __P((int, const void *, size_t)))func
;
106 __db_jump
.j_yield
= (int (*) __P((void)))func
;
116 * Replace values for the DB package.
119 db_value_set(value
, which
)
126 DB_GLOBAL(db_mutexlocks
) = value
;
129 DB_GLOBAL(db_pageyield
) = value
;
132 if (value
!= 0 && (ret
= __db_mapanon_ok(0)) != 0)
134 DB_GLOBAL(db_region_anon
) = value
;
137 DB_GLOBAL(db_region_init
) = value
;
140 if (value
!= 0 && (ret
= __db_mapanon_ok(1)) != 0)
142 DB_GLOBAL(db_region_anon
) = value
;
147 DB_GLOBAL(db_tsl_spins
) = value
;