Import BSDDB 4.7.25 (as of svn r89086)

This commit is contained in:
Zachary Ware
2017-09-04 13:40:25 -05:00
parent 4b29e0458f
commit 8f590873d0
4781 changed files with 2241032 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
Workspace
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> projectList
$(PRJ_DIR)/BerkeleyDB20.wpj \
$(PRJ_DIR)/db_archive/db_archive20.wpj \
$(PRJ_DIR)/db_checkpoint/db_checkpoint20.wpj \
$(PRJ_DIR)/db_deadlock/db_deadlock20.wpj \
$(PRJ_DIR)/db_dump/db_dump20.wpj \
$(PRJ_DIR)/db_load/db_load20.wpj \
$(PRJ_DIR)/db_printlog/db_printlog20.wpj \
$(PRJ_DIR)/db_recover/db_recover20.wpj \
$(PRJ_DIR)/db_stat/db_stat20.wpj \
$(PRJ_DIR)/db_upgrade/db_upgrade20.wpj \
$(PRJ_DIR)/db_verify/db_verify20.wpj \
$(PRJ_DIR)/dbdemo/dbdemo20.wpj
<END>
<BEGIN> userComments
<END>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
Workspace
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> projectList
$(PRJ_DIR)/BerkeleyDB20small.wpj \
$(PRJ_DIR)/db_archive/db_archive20.wpj \
$(PRJ_DIR)/db_checkpoint/db_checkpoint20.wpj \
$(PRJ_DIR)/db_deadlock/db_deadlock20.wpj \
$(PRJ_DIR)/db_dump/db_dump20.wpj \
$(PRJ_DIR)/db_load/db_load20.wpj \
$(PRJ_DIR)/db_printlog/db_printlog20.wpj \
$(PRJ_DIR)/db_recover/db_recover20.wpj \
$(PRJ_DIR)/db_stat/db_stat20.wpj \
$(PRJ_DIR)/db_upgrade/db_upgrade20.wpj \
$(PRJ_DIR)/db_verify/db_verify20.wpj \
$(PRJ_DIR)/dbdemo/dbdemo20.wpj
<END>
<BEGIN> userComments
<END>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
Workspace
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> projectList
$(PRJ_DIR)/BerkeleyDB22.wpj \
$(PRJ_DIR)/db_archive/db_archive22.wpj \
$(PRJ_DIR)/db_checkpoint/db_checkpoint22.wpj \
$(PRJ_DIR)/db_deadlock/db_deadlock22.wpj \
$(PRJ_DIR)/db_dump/db_dump22.wpj \
$(PRJ_DIR)/db_load/db_load22.wpj \
$(PRJ_DIR)/db_printlog/db_printlog22.wpj \
$(PRJ_DIR)/db_recover/db_recover22.wpj \
$(PRJ_DIR)/db_stat/db_stat22.wpj \
$(PRJ_DIR)/db_upgrade/db_upgrade22.wpj \
$(PRJ_DIR)/db_verify/db_verify22.wpj \
$(PRJ_DIR)/dbdemo/dbdemo22.wpj
<END>
<BEGIN> userComments
<END>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
Document file - DO NOT EDIT
<BEGIN> CORE_INFO_TYPE
Workspace
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> projectList
$(PRJ_DIR)/BerkeleyDB22small.wpj \
$(PRJ_DIR)/db_archive/db_archive22.wpj \
$(PRJ_DIR)/db_checkpoint/db_checkpoint22.wpj \
$(PRJ_DIR)/db_deadlock/db_deadlock22.wpj \
$(PRJ_DIR)/db_dump/db_dump22.wpj \
$(PRJ_DIR)/db_load/db_load22.wpj \
$(PRJ_DIR)/db_printlog/db_printlog22.wpj \
$(PRJ_DIR)/db_recover/db_recover22.wpj \
$(PRJ_DIR)/db_stat/db_stat22.wpj \
$(PRJ_DIR)/db_upgrade/db_upgrade22.wpj \
$(PRJ_DIR)/db_verify/db_verify22.wpj \
$(PRJ_DIR)/dbdemo/dbdemo22.wpj
<END>
<BEGIN> userComments
<END>

276
build_vxworks/clib_port.h Normal file
View File

@@ -0,0 +1,276 @@
/* DO NOT EDIT: automatically built from dist/clib_port.in. */
/*
* Minimum/maximum values for various types.
*/
#ifndef UINT16_MAX /* Maximum 16-bit unsigned. */
#define UINT16_MAX 65535
#endif
#ifndef UINT32_MAX /* Maximum 32-bit unsigned. */
#define UINT32_MAX 4294967295U
#endif
#ifndef INT_MAX
#if SIZEOF_INT == 4
#define INT_MAX 2147483647
#endif
#if SIZEOF_INT == 8
#define INT_MAX 9223372036854775807
#endif
#endif
#ifndef INT_MIN /* minimum (signed) int value */
#define INT_MIN (-INT_MAX-1)
#endif
#ifndef UINT_MAX /* maximum (signed) int value */
#if SIZEOF_INT == 4
#define UINT_MAX 4294967295U
#endif
#if SIZEOF_INT == 8
#define UINT_MAX 18446744073709551615U
#endif
#endif
#ifndef LONG_MAX /* maximum (signed) long value */
#if SIZEOF_LONG == 4
#define LONG_MAX 2147483647
#endif
#if SIZEOF_LONG == 8
#define LONG_MAX 9223372036854775807L
#endif
#endif
#ifndef LONG_MIN /* minimum (signed) long value */
#define LONG_MIN (-LONG_MAX-1)
#endif
#ifndef ULONG_MAX /* maximum (unsigned) long value */
#if SIZEOF_LONG == 4
#define ULONG_MAX 4294967295U
#endif
#if SIZEOF_LONG == 8
#define ULONG_MAX 18446744073709551615UL
#endif
#endif
#if defined(HAVE_64BIT_TYPES)
/*
* Override the system's 64-bit min/max constants. AIX's 32-bit compiler can
* handle 64-bit values, but the system's constants don't include the LL/ULL
* suffix, and so can't be compiled using the 32-bit compiler.
*/
#undef INT64_MAX
#undef INT64_MIN
#undef UINT64_MAX
#ifdef DB_WIN32
#define INT64_MAX _I64_MAX
#define INT64_MIN _I64_MIN
#define UINT64_MAX _UI64_MAX
#else
#define INT64_MAX 9223372036854775807LL
#define INT64_MIN (-INT64_MAX-1)
#define UINT64_MAX 18446744073709551615ULL
#endif /* DB_WIN32 */
#define INT64_FMT "%lld"
#define UINT64_FMT "%llu"
#endif /* HAVE_64BIT_TYPES */
/*
* Exit success/failure macros.
*/
#ifndef HAVE_EXIT_SUCCESS
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#endif
/*
* File modes.
*/
#ifdef DB_WIN32
#ifndef S_IREAD /* WinCE doesn't have S_IREAD. */
#define S_IREAD 0
#endif
#ifndef S_IWRITE /* WinCE doesn't have S_IWRITE. */
#define S_IWRITE 0
#endif
#ifndef S_IRUSR
#define S_IRUSR S_IREAD /* R for owner */
#endif
#ifndef S_IWUSR
#define S_IWUSR S_IWRITE /* W for owner */
#endif
#ifndef S_IXUSR
#define S_IXUSR 0 /* X for owner */
#endif
#ifndef S_IRGRP
#define S_IRGRP 0 /* R for group */
#endif
#ifndef S_IWGRP
#define S_IWGRP 0 /* W for group */
#endif
#ifndef S_IXGRP
#define S_IXGRP 0 /* X for group */
#endif
#ifndef S_IROTH
#define S_IROTH 0 /* R for other */
#endif
#ifndef S_IWOTH
#define S_IWOTH 0 /* W for other */
#endif
#ifndef S_IXOTH
#define S_IXOTH 0 /* X for other */
#endif
#else /* !DB_WIN32 */
#ifndef S_IRUSR
#define S_IRUSR 0000400 /* R for owner */
#endif
#ifndef S_IWUSR
#define S_IWUSR 0000200 /* W for owner */
#endif
#ifndef S_IXUSR
#define S_IXUSR 0000100 /* X for owner */
#endif
#ifndef S_IRGRP
#define S_IRGRP 0000040 /* R for group */
#endif
#ifndef S_IWGRP
#define S_IWGRP 0000020 /* W for group */
#endif
#ifndef S_IXGRP
#define S_IXGRP 0000010 /* X for group */
#endif
#ifndef S_IROTH
#define S_IROTH 0000004 /* R for other */
#endif
#ifndef S_IWOTH
#define S_IWOTH 0000002 /* W for other */
#endif
#ifndef S_IXOTH
#define S_IXOTH 0000001 /* X for other */
#endif
#endif /* !DB_WIN32 */
/*
* Don't step on the namespace. Other libraries may have their own
* implementations of these functions, we don't want to use their
* implementations or force them to use ours based on the load order.
*/
#ifndef HAVE_ATOI
#define atoi __db_Catoi
#endif
#ifndef HAVE_ATOL
#define atol __db_Catol
#endif
#ifndef HAVE_FCLOSE
#define fclose __db_Cfclose
#endif
#ifndef HAVE_FGETC
#define fgetc __db_Cfgetc
#endif
#ifndef HAVE_FGETS
#define fgets __db_Cfgets
#endif
#ifndef HAVE_FOPEN
#define fopen __db_Cfopen
#endif
#ifndef HAVE_FWRITE
#define fwrite __db_Cfwrite
#endif
#ifndef HAVE_GETADDRINFO
#define freeaddrinfo(a) __db_Cfreeaddrinfo(a)
#define getaddrinfo(a, b, c, d) __db_Cgetaddrinfo(a, b, c, d)
#endif
#ifndef HAVE_GETCWD
#define getcwd __db_Cgetcwd
#endif
#ifndef HAVE_GETOPT
#define getopt __db_Cgetopt
#define optarg __db_Coptarg
#define opterr __db_Copterr
#define optind __db_Coptind
#define optopt __db_Coptopt
#define optreset __db_Coptreset
#endif
#ifndef HAVE_ISALPHA
#define isalpha __db_Cisalpha
#endif
#ifndef HAVE_ISDIGIT
#define isdigit __db_Cisdigit
#endif
#ifndef HAVE_ISPRINT
#define isprint __db_Cisprint
#endif
#ifndef HAVE_ISSPACE
#define isspace __db_Cisspace
#endif
#ifndef HAVE_LOCALTIME
#define localtime __db_Clocaltime
#endif
#ifndef HAVE_MEMCMP
#define memcmp __db_Cmemcmp
#endif
#ifndef HAVE_MEMCPY
#define memcpy __db_Cmemcpy
#endif
#ifndef HAVE_MEMMOVE
#define memmove __db_Cmemmove
#endif
#ifndef HAVE_PRINTF
#define printf __db_Cprintf
#define fprintf __db_Cfprintf
#endif
#ifndef HAVE_QSORT
#define qsort __db_Cqsort
#endif
#ifndef HAVE_RAISE
#define raise __db_Craise
#endif
#ifndef HAVE_RAND
#define rand __db_Crand
#define srand __db_Csrand
#endif
#ifndef HAVE_SNPRINTF
#define snprintf __db_Csnprintf
#endif
#ifndef HAVE_STRCASECMP
#define strcasecmp __db_Cstrcasecmp
#define strncasecmp __db_Cstrncasecmp
#endif
#ifndef HAVE_STRCAT
#define strcat __db_Cstrcat
#endif
#ifndef HAVE_STRCHR
#define strchr __db_Cstrchr
#endif
#ifndef HAVE_STRDUP
#define strdup __db_Cstrdup
#endif
#ifndef HAVE_STRERROR
#define strerror __db_Cstrerror
#endif
#ifndef HAVE_STRNCAT
#define strncat __db_Cstrncat
#endif
#ifndef HAVE_STRNCMP
#define strncmp __db_Cstrncmp
#endif
#ifndef HAVE_STRRCHR
#define strrchr __db_Cstrrchr
#endif
#ifndef HAVE_STRSEP
#define strsep __db_Cstrsep
#endif
#ifndef HAVE_STRTOL
#define strtol __db_Cstrtol
#endif
#ifndef HAVE_STRTOUL
#define strtoul __db_Cstrtoul
#endif
#ifndef HAVE_TIME
#define time __db_Ctime
#endif
#ifndef HAVE_VSNPRINTF
#define vsnprintf __db_Cvsnprintf
#endif

2483
build_vxworks/db.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,199 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_archive.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
int db_archive_main __P((int, char *[]));
int db_archive_usage __P((void));
int db_archive_version_check __P((void));
const char *progname;
int
db_archive(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_archive", args, &argc, &argv);
return (db_archive_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_archive_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
DB_ENV *dbenv;
u_int32_t flags;
int ch, exitval, ret, verbose;
char **file, *home, **list, *passwd;
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_archive_version_check()) != 0)
return (ret);
dbenv = NULL;
flags = 0;
exitval = verbose = 0;
home = passwd = NULL;
file = list = NULL;
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "adh:lP:sVv")) != EOF)
switch (ch) {
case 'a':
LF_SET(DB_ARCH_ABS);
break;
case 'd':
LF_SET(DB_ARCH_REMOVE);
break;
case 'h':
home = optarg;
break;
case 'l':
LF_SET(DB_ARCH_LOG);
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 's':
LF_SET(DB_ARCH_DATA);
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case 'v':
/*
* !!!
* The verbose flag no longer actually does anything,
* but it's left rather than adding it back at some
* future date.
*/
verbose = 1;
break;
case '?':
default:
return (db_archive_usage());
}
argc -= optind;
argv += optind;
if (argc != 0)
return (db_archive_usage());
/* Handle possible interruptions. */
__db_util_siginit();
/*
* Create an environment object and initialize it for error
* reporting.
*/
if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
goto shutdown;
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto shutdown;
}
/*
* If attaching to a pre-existing environment fails, create a
* private one and try again.
*/
if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
(ret == DB_VERSION_MISMATCH ||
(ret = dbenv->open(dbenv, home, DB_CREATE |
DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
dbenv->err(dbenv, ret, "DB_ENV->open");
goto shutdown;
}
/* Get the list of names. */
if ((ret = dbenv->log_archive(dbenv, &list, flags)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->log_archive");
goto shutdown;
}
/* Print the list of names. */
if (list != NULL) {
for (file = list; *file != NULL; ++file)
printf("%s\n", *file);
free(list);
}
if (0) {
shutdown: exitval = 1;
}
if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (passwd != NULL)
free(passwd);
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
int
db_archive_usage()
{
(void)fprintf(stderr,
"usage: %s [-adlsVv] [-h home] [-P password]\n", progname);
return (EXIT_FAILURE);
}
int
db_archive_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_archive20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_archive20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_archive20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_archive.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_archive.c_dependencies
<END>
<BEGIN> FILE_db_archive.c_objects
db_archive.o
<END>
<BEGIN> FILE_db_archive.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_archive.c
<END>
<BEGIN> userComments
db_archive
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_archive22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_archive22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_archive22.out
<END>
<BEGIN> BUILD_RULE_db_archive22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_archive.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_archive.c_dependencies
<END>
<BEGIN> FILE_db_archive.c_objects
db_archive.o
<END>
<BEGIN> FILE_db_archive.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_archive.c
<END>
<BEGIN> userComments
db_archive
<END>

View File

@@ -0,0 +1,245 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_checkpoint.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
int db_checkpoint_main __P((int, char *[]));
int db_checkpoint_usage __P((void));
int db_checkpoint_version_check __P((void));
const char *progname;
int
db_checkpoint(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_checkpoint", args, &argc, &argv);
return (db_checkpoint_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_checkpoint_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
DB_ENV *dbenv;
time_t now;
long argval;
u_int32_t flags, kbytes, minutes, seconds;
int ch, exitval, once, ret, verbose;
char *home, *logfile, *passwd, time_buf[CTIME_BUFLEN];
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_checkpoint_version_check()) != 0)
return (ret);
/*
* !!!
* Don't allow a fully unsigned 32-bit number, some compilers get
* upset and require it to be specified in hexadecimal and so on.
*/
#define MAX_UINT32_T 2147483647
dbenv = NULL;
kbytes = minutes = 0;
exitval = once = verbose = 0;
flags = 0;
home = logfile = passwd = NULL;
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "1h:k:L:P:p:Vv")) != EOF)
switch (ch) {
case '1':
once = 1;
flags = DB_FORCE;
break;
case 'h':
home = optarg;
break;
case 'k':
if (__db_getlong(NULL, progname,
optarg, 1, (long)MAX_UINT32_T, &argval))
return (EXIT_FAILURE);
kbytes = (u_int32_t)argval;
break;
case 'L':
logfile = optarg;
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 'p':
if (__db_getlong(NULL, progname,
optarg, 1, (long)MAX_UINT32_T, &argval))
return (EXIT_FAILURE);
minutes = (u_int32_t)argval;
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case 'v':
verbose = 1;
break;
case '?':
default:
return (db_checkpoint_usage());
}
argc -= optind;
argv += optind;
if (argc != 0)
return (db_checkpoint_usage());
if (once == 0 && kbytes == 0 && minutes == 0) {
(void)fprintf(stderr,
"%s: at least one of -1, -k and -p must be specified\n",
progname);
return (db_checkpoint_usage());
}
/* Handle possible interruptions. */
__db_util_siginit();
/* Log our process ID. */
if (logfile != NULL && __db_util_logset(progname, logfile))
goto shutdown;
/*
* Create an environment object and initialize it for error
* reporting.
*/
if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
goto shutdown;
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto shutdown;
}
/*
* If attaching to a pre-existing environment fails, create a
* private one and try again.
*/
if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
(!once || ret == DB_VERSION_MISMATCH ||
(ret = dbenv->open(dbenv, home,
DB_CREATE | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
dbenv->err(dbenv, ret, "DB_ENV->open");
goto shutdown;
}
/*
* If we have only a time delay, then we'll sleep the right amount
* to wake up when a checkpoint is necessary. If we have a "kbytes"
* field set, then we'll check every 30 seconds.
*/
seconds = kbytes != 0 ? 30 : minutes * 60;
while (!__db_util_interrupted()) {
if (verbose) {
(void)time(&now);
dbenv->errx(dbenv,
"checkpoint begin: %s", __os_ctime(&now, time_buf));
}
if ((ret = dbenv->txn_checkpoint(dbenv,
kbytes, minutes, flags)) != 0) {
dbenv->err(dbenv, ret, "txn_checkpoint");
goto shutdown;
}
if (verbose) {
(void)time(&now);
dbenv->errx(dbenv,
"checkpoint complete: %s", __os_ctime(&now, time_buf));
}
if (once)
break;
__os_yield(dbenv->env, seconds, 0);
}
if (0) {
shutdown: exitval = 1;
}
/* Clean up the logfile. */
if (logfile != NULL)
(void)remove(logfile);
/* Clean up the environment. */
if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (passwd != NULL)
free(passwd);
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
int
db_checkpoint_usage()
{
(void)fprintf(stderr, "usage: %s [-1Vv]\n\t%s\n", progname,
"[-h home] [-k kbytes] [-L file] [-P password] [-p min]");
return (EXIT_FAILURE);
}
int
db_checkpoint_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_checkpoint20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_checkpoint20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_checkpoint20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_checkpoint.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_checkpoint.c_dependencies
<END>
<BEGIN> FILE_db_checkpoint.c_objects
db_checkpoint.o
<END>
<BEGIN> FILE_db_checkpoint.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_checkpoint.c
<END>
<BEGIN> userComments
db_checkpoint
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_checkpoint22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_checkpoint22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_checkpoint22.out
<END>
<BEGIN> BUILD_RULE_db_checkpoint22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_checkpoint.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_checkpoint.c_dependencies
<END>
<BEGIN> FILE_db_checkpoint.c_objects
db_checkpoint.o
<END>
<BEGIN> FILE_db_checkpoint.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_checkpoint.c
<END>
<BEGIN> userComments
db_checkpoint
<END>

581
build_vxworks/db_config.h Normal file
View File

@@ -0,0 +1,581 @@
/* DO NOT EDIT: automatically built by dist/s_vxworks. */
/* !!!
* The CONFIG_TEST option may be added using the Tornado project build.
* DO NOT modify it here.
*/
/* Define to 1 if you want to build a version for running the test suite. */
/* #undef CONFIG_TEST */
/* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using
an operating system environment that supports Win32 calls and semantics. We
don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though
Cygwin/GCC closely emulates the Unix environment. */
/* #undef DB_WIN32 */
/* !!!
* The DEBUG option may be added using the Tornado project build.
* DO NOT modify it here.
*/
/* Define to 1 if you want a debugging version. */
/* #undef DEBUG */
/* Define to 1 if you want a version that logs read operations. */
/* #undef DEBUG_ROP */
/* Define to 1 if you want a version that logs write operations. */
/* #undef DEBUG_WOP */
/* !!!
* The DIAGNOSTIC option may be added using the Tornado project build.
* DO NOT modify it here.
*/
/* Define to 1 if you want a version with run-time diagnostic checking. */
/* #undef DIAGNOSTIC */
/* Define to 1 if 64-bit types are available. */
#define HAVE_64BIT_TYPES 1
/* Define to 1 if you have the `abort' function. */
#define HAVE_ABORT 1
/* Define to 1 if you have the `atoi' function. */
#define HAVE_ATOI 1
/* Define to 1 if you have the `atol' function. */
#define HAVE_ATOL 1
/* Define to 1 if you have the `backtrace' function. */
/* #undef HAVE_BACKTRACE */
/* Define to 1 if you have the `backtrace_symbols' function. */
/* #undef HAVE_BACKTRACE_SYMBOLS */
/* Define to 1 if building BREW. */
/* #undef HAVE_BREW */
/* Define to 1 if building on BREW (SDK2). */
/* #undef HAVE_BREW_SDK2 */
/* Define to 1 if you have the `clock_gettime' function. */
#define HAVE_CLOCK_GETTIME 1
/* Define to 1 if clock_gettime supports CLOCK_MONOTONIC. */
/* #undef HAVE_CLOCK_MONOTONIC */
/* Define to 1 if Berkeley DB release includes strong cryptography. */
#define HAVE_CRYPTO 1
/* Define to 1 if you have the `ctime_r' function. */
#define HAVE_CTIME_R 1
/* Define to 1 if ctime_r takes a buffer length as a third argument. */
#define HAVE_CTIME_R_3ARG 1
/* Define to 1 if you have the `directio' function. */
/* #undef HAVE_DIRECTIO */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define to 1 if you have the <execinfo.h> header file. */
/* #undef HAVE_EXECINFO_H */
/* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */
#define HAVE_EXIT_SUCCESS 1
/* Define to 1 if you have the `fchmod' function. */
/* #undef HAVE_FCHMOD */
/* Define to 1 if you have the `fclose' function. */
#define HAVE_FCLOSE 1
/* Define to 1 if you have the `fcntl' function. */
/* #undef HAVE_FCNTL */
/* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */
/* #undef HAVE_FCNTL_F_SETFD */
/* Define to 1 if you have the `fdatasync' function. */
/* #undef HAVE_FDATASYNC */
/* Define to 1 if you have the `fgetc' function. */
#define HAVE_FGETC 1
/* Define to 1 if you have the `fgets' function. */
#define HAVE_FGETS 1
/* Define to 1 if allocated filesystem blocks are not zeroed. */
#define HAVE_FILESYSTEM_NOTZERO 1
/* Define to 1 if you have the `fopen' function. */
#define HAVE_FOPEN 1
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the `fwrite' function. */
#define HAVE_FWRITE 1
/* Define to 1 if you have the `getaddrinfo' function. */
/* #undef HAVE_GETADDRINFO */
/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the `getenv' function. */
#define HAVE_GETENV 1
/* Define to 1 if you have the `getgid' function. */
#define HAVE_GETGID 1
/* Define to 1 if you have the `getopt' function. */
/* #undef HAVE_GETOPT */
/* Define to 1 if getopt supports the optreset variable. */
/* #undef HAVE_GETOPT_OPTRESET */
/* Define to 1 if you have the `getrusage' function. */
/* #undef HAVE_GETRUSAGE */
/* Define to 1 if you have the `gettimeofday' function. */
/* #undef HAVE_GETTIMEOFDAY */
/* Define to 1 if you have the `getuid' function. */
/* #undef HAVE_GETUID */
/* Define to 1 if building Hash access method. */
#define HAVE_HASH 1
/* Define to 1 if you have the `hstrerror' function. */
/* #undef HAVE_HSTRERROR */
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */
/* Define to 1 if you have the `isalpha' function. */
#define HAVE_ISALPHA 1
/* Define to 1 if you have the `isdigit' function. */
#define HAVE_ISDIGIT 1
/* Define to 1 if you have the `isprint' function. */
#define HAVE_ISPRINT 1
/* Define to 1 if you have the `isspace' function. */
#define HAVE_ISSPACE 1
/* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1
/* Define to 1 if you have the `memcmp' function. */
#define HAVE_MEMCMP 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mlock' function. */
/* #undef HAVE_MLOCK */
/* Define to 1 if you have the `mmap' function. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the `mprotect' function. */
/* #undef HAVE_MPROTECT */
/* Define to 1 if you have the `munlock' function. */
/* #undef HAVE_MUNLOCK */
/* Define to 1 if you have the `munmap' function. */
/* #undef HAVE_MUNMAP */
/* Define to 1 to use the GCC compiler and 68K assembly language mutexes. */
/* #undef HAVE_MUTEX_68K_GCC_ASSEMBLY */
/* Define to 1 to use the AIX _check_lock mutexes. */
/* #undef HAVE_MUTEX_AIX_CHECK_LOCK */
/* Define to 1 to use the GCC compiler and Alpha assembly language mutexes. */
/* #undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and ARM assembly language mutexes. */
/* #undef HAVE_MUTEX_ARM_GCC_ASSEMBLY */
/* Define to 1 to use the Apple/Darwin _spin_lock_try mutexes. */
/* #undef HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY */
/* Define to 1 to use the UNIX fcntl system call mutexes. */
/* #undef HAVE_MUTEX_FCNTL */
/* Define to 1 to use the GCC compiler and PaRisc assembly language mutexes.
*/
/* #undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY */
/* Define to 1 to use the msem_XXX mutexes on HP-UX. */
/* #undef HAVE_MUTEX_HPPA_MSEM_INIT */
/* Define to 1 to use test-and-set mutexes with blocking mutexes. */
/* #undef HAVE_MUTEX_HYBRID */
/* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */
/* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */
/* #undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY */
/* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */
/* #undef HAVE_MUTEX_MSEM_INIT */
/* Define to 1 to use the GCC compiler and PowerPC assembly language mutexes.
*/
/* #undef HAVE_MUTEX_PPC_GCC_ASSEMBLY */
/* Define to 1 to use POSIX 1003.1 pthread_XXX mutexes. */
/* #undef HAVE_MUTEX_PTHREADS */
/* Define to 1 to use Reliant UNIX initspin mutexes. */
/* #undef HAVE_MUTEX_RELIANTUNIX_INITSPIN */
/* Define to 1 to use the IBM C compiler and S/390 assembly language mutexes.
*/
/* #undef HAVE_MUTEX_S390_CC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and S/390 assembly language mutexes. */
/* #undef HAVE_MUTEX_S390_GCC_ASSEMBLY */
/* Define to 1 to use the SCO compiler and x86 assembly language mutexes. */
/* #undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY */
/* Define to 1 to use the obsolete POSIX 1003.1 sema_XXX mutexes. */
/* #undef HAVE_MUTEX_SEMA_INIT */
/* Define to 1 to use the SGI XXX_lock mutexes. */
/* #undef HAVE_MUTEX_SGI_INIT_LOCK */
/* Define to 1 to use the Solaris _lock_XXX mutexes. */
/* #undef HAVE_MUTEX_SOLARIS_LOCK_TRY */
/* Define to 1 to use the Solaris lwp threads mutexes. */
/* #undef HAVE_MUTEX_SOLARIS_LWP */
/* Define to 1 to use the GCC compiler and Sparc assembly language mutexes. */
/* #undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY */
/* Define to 1 if the Berkeley DB library should support mutexes. */
#define HAVE_MUTEX_SUPPORT 1
/* Define to 1 if mutexes hold system resources. */
#define HAVE_MUTEX_SYSTEM_RESOURCES 1
/* Define to 1 to configure mutexes intra-process only. */
/* #undef HAVE_MUTEX_THREAD_ONLY */
/* Define to 1 to use the CC compiler and Tru64 assembly language mutexes. */
/* #undef HAVE_MUTEX_TRU64_CC_ASSEMBLY */
/* Define to 1 to use the UNIX International mutexes. */
/* #undef HAVE_MUTEX_UI_THREADS */
/* Define to 1 to use the UTS compiler and assembly language mutexes. */
/* #undef HAVE_MUTEX_UTS_CC_ASSEMBLY */
/* Define to 1 to use VMS mutexes. */
/* #undef HAVE_MUTEX_VMS */
/* Define to 1 to use VxWorks mutexes. */
#define HAVE_MUTEX_VXWORKS 1
/* Define to 1 to use the MSVC compiler and Windows mutexes. */
/* #undef HAVE_MUTEX_WIN32 */
/* Define to 1 to use the GCC compiler and Windows mutexes. */
/* #undef HAVE_MUTEX_WIN32_GCC */
/* Define to 1 to use the GCC compiler and 64-bit x86 assembly language
mutexes. */
/* #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and 32-bit x86 assembly language
mutexes. */
/* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the O_DIRECT flag. */
/* #undef HAVE_O_DIRECT */
/* Define to 1 if you have the `pread' function. */
/* #undef HAVE_PREAD */
/* Define to 1 if you have the `printf' function. */
#define HAVE_PRINTF 1
/* Define to 1 if you have the `pstat_getdynamic' function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define to 1 to configure Berkeley DB for POSIX pthread API. */
/* #undef HAVE_PTHREAD_API */
/* Define to 1 if you have the `pthread_yield' function. */
/* #undef HAVE_PTHREAD_YIELD */
/* Define to 1 if you have the `pwrite' function. */
/* #undef HAVE_PWRITE */
/* Define to 1 if building on QNX. */
/* #undef HAVE_QNX */
/* Define to 1 if you have the `qsort' function. */
#define HAVE_QSORT 1
/* Define to 1 if building Queue access method. */
#define HAVE_QUEUE 1
/* Define to 1 if you have the `raise' function. */
#define HAVE_RAISE 1
/* Define to 1 if you have the `rand' function. */
#define HAVE_RAND 1
/* Define to 1 if building replication support. */
#define HAVE_REPLICATION 1
/* Define to 1 if building the Berkeley DB replication framework. */
/* #undef HAVE_REPLICATION_THREADS */
/* Define to 1 if building RPC client/server. */
/* #undef HAVE_RPC */
/* Define to 1 if building on S60. */
/* #undef HAVE_S60 */
/* Define to 1 if you have the `sched_yield' function. */
#define HAVE_SCHED_YIELD 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `setgid' function. */
#define HAVE_SETGID 1
/* Define to 1 if you have the `setuid' function. */
#define HAVE_SETUID 1
/* Define to 1 if shmctl/SHM_LOCK locks down shared memory segments. */
/* #undef HAVE_SHMCTL_SHM_LOCK */
/* Define to 1 if you have the `shmget' function. */
/* #undef HAVE_SHMGET */
/* Define to 1 if you have the `sigaction' function. */
/* #undef HAVE_SIGACTION */
/* Define to 1 if thread identifier type db_threadid_t is integral. */
#define HAVE_SIMPLE_THREAD_TYPE 1
/* Define to 1 if you have the `snprintf' function. */
/* #undef HAVE_SNPRINTF */
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
/* Define to 1 if building statistics support. */
#define HAVE_STATISTICS 1
/* Define to 1 if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the `strcat' function. */
#define HAVE_STRCAT 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strdup' function. */
/* #undef HAVE_STRDUP */
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strncat' function. */
#define HAVE_STRNCAT 1
/* Define to 1 if you have the `strncmp' function. */
#define HAVE_STRNCMP 1
/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
/* Define to 1 if you have the `strsep' function. */
/* #undef HAVE_STRSEP */
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1
/* Define to 1 if `st_blksize' is member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
/* Define to 1 if you have the `sysconf' function. */
/* #undef HAVE_SYSCONF */
/* Define to 1 if port includes files in the Berkeley DB source code. */
#define HAVE_SYSTEM_INCLUDE_FILES 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
/* #undef HAVE_SYS_SOCKET_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
/* #undef HAVE_SYS_STAT_H */
/* Define to 1 if you have the <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */
/* Define to 1 if you have the <sys/types.h> header file. */
/* #undef HAVE_SYS_TYPES_H */
/* Define to 1 if you have the `time' function. */
#define HAVE_TIME 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if unlink of file with open file descriptors will fail. */
#define HAVE_UNLINK_WITH_OPEN_FAILURE 1
/* Define to 1 if port includes historic database upgrade support. */
#define HAVE_UPGRADE_SUPPORT 1
/* Define to 1 if building access method verification support. */
#define HAVE_VERIFY 1
/* Define to 1 if you have the `vsnprintf' function. */
/* #undef HAVE_VSNPRINTF */
/* Define to 1 if building VxWorks. */
#define HAVE_VXWORKS 1
/* Define to 1 if you have the `yield' function. */
/* #undef HAVE_YIELD */
/* Define to 1 if you have the `_fstati64' function. */
/* #undef HAVE__FSTATI64 */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum"
/* Define to the full name of this package. */
#define PACKAGE_NAME "Berkeley DB"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Berkeley DB 4.7.25"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "db-4.7.25"
/* Define to the version of this package. */
#define PACKAGE_VERSION "4.7.25"
/* The size of a `char', as computed by sizeof. */
/* #undef SIZEOF_CHAR */
/* The size of a `char *', as computed by sizeof. */
/* #undef SIZEOF_CHAR_P */
/* The size of a `int', as computed by sizeof. */
/* #undef SIZEOF_INT */
/* The size of a `long', as computed by sizeof. */
/* #undef SIZEOF_LONG */
/* The size of a `long long', as computed by sizeof. */
/* #undef SIZEOF_LONG_LONG */
/* The size of a `short', as computed by sizeof. */
/* #undef SIZEOF_SHORT */
/* The size of a `size_t', as computed by sizeof. */
/* #undef SIZEOF_SIZE_T */
/* The size of a `unsigned char', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_CHAR */
/* The size of a `unsigned int', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_INT */
/* The size of a `unsigned long', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_LONG */
/* The size of a `unsigned long long', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_LONG_LONG */
/* The size of a `unsigned short', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_SHORT */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* #undef TIME_WITH_SYS_TIME */
/* Define to 1 to mask harmless uninitialized memory read/writes. */
/* #undef UMRW */
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#define inline
#endif
/* type to use in place of socklen_t if not defined */
/* #undef socklen_t */

View File

@@ -0,0 +1,581 @@
/* DO NOT EDIT: automatically built by dist/s_vxworks. */
/* !!!
* The CONFIG_TEST option may be added using the Tornado project build.
* DO NOT modify it here.
*/
/* Define to 1 if you want to build a version for running the test suite. */
/* #undef CONFIG_TEST */
/* We use DB_WIN32 much as one would use _WIN32 -- to specify that we're using
an operating system environment that supports Win32 calls and semantics. We
don't use _WIN32 because Cygwin/GCC also defines _WIN32, even though
Cygwin/GCC closely emulates the Unix environment. */
/* #undef DB_WIN32 */
/* !!!
* The DEBUG option may be added using the Tornado project build.
* DO NOT modify it here.
*/
/* Define to 1 if you want a debugging version. */
/* #undef DEBUG */
/* Define to 1 if you want a version that logs read operations. */
/* #undef DEBUG_ROP */
/* Define to 1 if you want a version that logs write operations. */
/* #undef DEBUG_WOP */
/* !!!
* The DIAGNOSTIC option may be added using the Tornado project build.
* DO NOT modify it here.
*/
/* Define to 1 if you want a version with run-time diagnostic checking. */
/* #undef DIAGNOSTIC */
/* Define to 1 if 64-bit types are available. */
#define HAVE_64BIT_TYPES 1
/* Define to 1 if you have the `abort' function. */
#define HAVE_ABORT 1
/* Define to 1 if you have the `atoi' function. */
#define HAVE_ATOI 1
/* Define to 1 if you have the `atol' function. */
#define HAVE_ATOL 1
/* Define to 1 if you have the `backtrace' function. */
/* #undef HAVE_BACKTRACE */
/* Define to 1 if you have the `backtrace_symbols' function. */
/* #undef HAVE_BACKTRACE_SYMBOLS */
/* Define to 1 if building BREW. */
/* #undef HAVE_BREW */
/* Define to 1 if building on BREW (SDK2). */
/* #undef HAVE_BREW_SDK2 */
/* Define to 1 if you have the `clock_gettime' function. */
#define HAVE_CLOCK_GETTIME 1
/* Define to 1 if clock_gettime supports CLOCK_MONOTONIC. */
/* #undef HAVE_CLOCK_MONOTONIC */
/* Define to 1 if Berkeley DB release includes strong cryptography. */
/* #undef HAVE_CRYPTO */
/* Define to 1 if you have the `ctime_r' function. */
#define HAVE_CTIME_R 1
/* Define to 1 if ctime_r takes a buffer length as a third argument. */
#define HAVE_CTIME_R_3ARG 1
/* Define to 1 if you have the `directio' function. */
/* #undef HAVE_DIRECTIO */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define to 1 if you have the <execinfo.h> header file. */
/* #undef HAVE_EXECINFO_H */
/* Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines. */
#define HAVE_EXIT_SUCCESS 1
/* Define to 1 if you have the `fchmod' function. */
/* #undef HAVE_FCHMOD */
/* Define to 1 if you have the `fclose' function. */
#define HAVE_FCLOSE 1
/* Define to 1 if you have the `fcntl' function. */
/* #undef HAVE_FCNTL */
/* Define to 1 if fcntl/F_SETFD denies child access to file descriptors. */
/* #undef HAVE_FCNTL_F_SETFD */
/* Define to 1 if you have the `fdatasync' function. */
/* #undef HAVE_FDATASYNC */
/* Define to 1 if you have the `fgetc' function. */
#define HAVE_FGETC 1
/* Define to 1 if you have the `fgets' function. */
#define HAVE_FGETS 1
/* Define to 1 if allocated filesystem blocks are not zeroed. */
#define HAVE_FILESYSTEM_NOTZERO 1
/* Define to 1 if you have the `fopen' function. */
#define HAVE_FOPEN 1
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the `fwrite' function. */
#define HAVE_FWRITE 1
/* Define to 1 if you have the `getaddrinfo' function. */
/* #undef HAVE_GETADDRINFO */
/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the `getenv' function. */
#define HAVE_GETENV 1
/* Define to 1 if you have the `getgid' function. */
#define HAVE_GETGID 1
/* Define to 1 if you have the `getopt' function. */
/* #undef HAVE_GETOPT */
/* Define to 1 if getopt supports the optreset variable. */
/* #undef HAVE_GETOPT_OPTRESET */
/* Define to 1 if you have the `getrusage' function. */
/* #undef HAVE_GETRUSAGE */
/* Define to 1 if you have the `gettimeofday' function. */
/* #undef HAVE_GETTIMEOFDAY */
/* Define to 1 if you have the `getuid' function. */
/* #undef HAVE_GETUID */
/* Define to 1 if building Hash access method. */
/* #undef HAVE_HASH */
/* Define to 1 if you have the `hstrerror' function. */
/* #undef HAVE_HSTRERROR */
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */
/* Define to 1 if you have the `isalpha' function. */
#define HAVE_ISALPHA 1
/* Define to 1 if you have the `isdigit' function. */
#define HAVE_ISDIGIT 1
/* Define to 1 if you have the `isprint' function. */
#define HAVE_ISPRINT 1
/* Define to 1 if you have the `isspace' function. */
#define HAVE_ISSPACE 1
/* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1
/* Define to 1 if you have the `memcmp' function. */
#define HAVE_MEMCMP 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mlock' function. */
/* #undef HAVE_MLOCK */
/* Define to 1 if you have the `mmap' function. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the `mprotect' function. */
/* #undef HAVE_MPROTECT */
/* Define to 1 if you have the `munlock' function. */
/* #undef HAVE_MUNLOCK */
/* Define to 1 if you have the `munmap' function. */
/* #undef HAVE_MUNMAP */
/* Define to 1 to use the GCC compiler and 68K assembly language mutexes. */
/* #undef HAVE_MUTEX_68K_GCC_ASSEMBLY */
/* Define to 1 to use the AIX _check_lock mutexes. */
/* #undef HAVE_MUTEX_AIX_CHECK_LOCK */
/* Define to 1 to use the GCC compiler and Alpha assembly language mutexes. */
/* #undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and ARM assembly language mutexes. */
/* #undef HAVE_MUTEX_ARM_GCC_ASSEMBLY */
/* Define to 1 to use the Apple/Darwin _spin_lock_try mutexes. */
/* #undef HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY */
/* Define to 1 to use the UNIX fcntl system call mutexes. */
/* #undef HAVE_MUTEX_FCNTL */
/* Define to 1 to use the GCC compiler and PaRisc assembly language mutexes.
*/
/* #undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY */
/* Define to 1 to use the msem_XXX mutexes on HP-UX. */
/* #undef HAVE_MUTEX_HPPA_MSEM_INIT */
/* Define to 1 to use test-and-set mutexes with blocking mutexes. */
/* #undef HAVE_MUTEX_HYBRID */
/* Define to 1 to use the GCC compiler and IA64 assembly language mutexes. */
/* #undef HAVE_MUTEX_IA64_GCC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and MIPS assembly language mutexes. */
/* #undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY */
/* Define to 1 to use the msem_XXX mutexes on systems other than HP-UX. */
/* #undef HAVE_MUTEX_MSEM_INIT */
/* Define to 1 to use the GCC compiler and PowerPC assembly language mutexes.
*/
/* #undef HAVE_MUTEX_PPC_GCC_ASSEMBLY */
/* Define to 1 to use POSIX 1003.1 pthread_XXX mutexes. */
/* #undef HAVE_MUTEX_PTHREADS */
/* Define to 1 to use Reliant UNIX initspin mutexes. */
/* #undef HAVE_MUTEX_RELIANTUNIX_INITSPIN */
/* Define to 1 to use the IBM C compiler and S/390 assembly language mutexes.
*/
/* #undef HAVE_MUTEX_S390_CC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and S/390 assembly language mutexes. */
/* #undef HAVE_MUTEX_S390_GCC_ASSEMBLY */
/* Define to 1 to use the SCO compiler and x86 assembly language mutexes. */
/* #undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY */
/* Define to 1 to use the obsolete POSIX 1003.1 sema_XXX mutexes. */
/* #undef HAVE_MUTEX_SEMA_INIT */
/* Define to 1 to use the SGI XXX_lock mutexes. */
/* #undef HAVE_MUTEX_SGI_INIT_LOCK */
/* Define to 1 to use the Solaris _lock_XXX mutexes. */
/* #undef HAVE_MUTEX_SOLARIS_LOCK_TRY */
/* Define to 1 to use the Solaris lwp threads mutexes. */
/* #undef HAVE_MUTEX_SOLARIS_LWP */
/* Define to 1 to use the GCC compiler and Sparc assembly language mutexes. */
/* #undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY */
/* Define to 1 if the Berkeley DB library should support mutexes. */
#define HAVE_MUTEX_SUPPORT 1
/* Define to 1 if mutexes hold system resources. */
#define HAVE_MUTEX_SYSTEM_RESOURCES 1
/* Define to 1 to configure mutexes intra-process only. */
/* #undef HAVE_MUTEX_THREAD_ONLY */
/* Define to 1 to use the CC compiler and Tru64 assembly language mutexes. */
/* #undef HAVE_MUTEX_TRU64_CC_ASSEMBLY */
/* Define to 1 to use the UNIX International mutexes. */
/* #undef HAVE_MUTEX_UI_THREADS */
/* Define to 1 to use the UTS compiler and assembly language mutexes. */
/* #undef HAVE_MUTEX_UTS_CC_ASSEMBLY */
/* Define to 1 to use VMS mutexes. */
/* #undef HAVE_MUTEX_VMS */
/* Define to 1 to use VxWorks mutexes. */
#define HAVE_MUTEX_VXWORKS 1
/* Define to 1 to use the MSVC compiler and Windows mutexes. */
/* #undef HAVE_MUTEX_WIN32 */
/* Define to 1 to use the GCC compiler and Windows mutexes. */
/* #undef HAVE_MUTEX_WIN32_GCC */
/* Define to 1 to use the GCC compiler and 64-bit x86 assembly language
mutexes. */
/* #undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY */
/* Define to 1 to use the GCC compiler and 32-bit x86 assembly language
mutexes. */
/* #undef HAVE_MUTEX_X86_GCC_ASSEMBLY */
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the O_DIRECT flag. */
/* #undef HAVE_O_DIRECT */
/* Define to 1 if you have the `pread' function. */
/* #undef HAVE_PREAD */
/* Define to 1 if you have the `printf' function. */
#define HAVE_PRINTF 1
/* Define to 1 if you have the `pstat_getdynamic' function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define to 1 to configure Berkeley DB for POSIX pthread API. */
/* #undef HAVE_PTHREAD_API */
/* Define to 1 if you have the `pthread_yield' function. */
/* #undef HAVE_PTHREAD_YIELD */
/* Define to 1 if you have the `pwrite' function. */
/* #undef HAVE_PWRITE */
/* Define to 1 if building on QNX. */
/* #undef HAVE_QNX */
/* Define to 1 if you have the `qsort' function. */
#define HAVE_QSORT 1
/* Define to 1 if building Queue access method. */
/* #undef HAVE_QUEUE */
/* Define to 1 if you have the `raise' function. */
#define HAVE_RAISE 1
/* Define to 1 if you have the `rand' function. */
#define HAVE_RAND 1
/* Define to 1 if building replication support. */
/* #undef HAVE_REPLICATION */
/* Define to 1 if building the Berkeley DB replication framework. */
/* #undef HAVE_REPLICATION_THREADS */
/* Define to 1 if building RPC client/server. */
/* #undef HAVE_RPC */
/* Define to 1 if building on S60. */
/* #undef HAVE_S60 */
/* Define to 1 if you have the `sched_yield' function. */
#define HAVE_SCHED_YIELD 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `setgid' function. */
#define HAVE_SETGID 1
/* Define to 1 if you have the `setuid' function. */
#define HAVE_SETUID 1
/* Define to 1 if shmctl/SHM_LOCK locks down shared memory segments. */
/* #undef HAVE_SHMCTL_SHM_LOCK */
/* Define to 1 if you have the `shmget' function. */
/* #undef HAVE_SHMGET */
/* Define to 1 if you have the `sigaction' function. */
/* #undef HAVE_SIGACTION */
/* Define to 1 if thread identifier type db_threadid_t is integral. */
#define HAVE_SIMPLE_THREAD_TYPE 1
/* Define to 1 if you have the `snprintf' function. */
/* #undef HAVE_SNPRINTF */
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
/* Define to 1 if building statistics support. */
/* #undef HAVE_STATISTICS */
/* Define to 1 if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the `strcat' function. */
#define HAVE_STRCAT 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strdup' function. */
/* #undef HAVE_STRDUP */
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strncat' function. */
#define HAVE_STRNCAT 1
/* Define to 1 if you have the `strncmp' function. */
#define HAVE_STRNCMP 1
/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
/* Define to 1 if you have the `strsep' function. */
/* #undef HAVE_STRSEP */
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1
/* Define to 1 if `st_blksize' is member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
/* Define to 1 if you have the `sysconf' function. */
/* #undef HAVE_SYSCONF */
/* Define to 1 if port includes files in the Berkeley DB source code. */
#define HAVE_SYSTEM_INCLUDE_FILES 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
/* #undef HAVE_SYS_SOCKET_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
/* #undef HAVE_SYS_STAT_H */
/* Define to 1 if you have the <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */
/* Define to 1 if you have the <sys/types.h> header file. */
/* #undef HAVE_SYS_TYPES_H */
/* Define to 1 if you have the `time' function. */
#define HAVE_TIME 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if unlink of file with open file descriptors will fail. */
#define HAVE_UNLINK_WITH_OPEN_FAILURE 1
/* Define to 1 if port includes historic database upgrade support. */
#define HAVE_UPGRADE_SUPPORT 1
/* Define to 1 if building access method verification support. */
/* #undef HAVE_VERIFY */
/* Define to 1 if you have the `vsnprintf' function. */
/* #undef HAVE_VSNPRINTF */
/* Define to 1 if building VxWorks. */
#define HAVE_VXWORKS 1
/* Define to 1 if you have the `yield' function. */
/* #undef HAVE_YIELD */
/* Define to 1 if you have the `_fstati64' function. */
/* #undef HAVE__FSTATI64 */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum"
/* Define to the full name of this package. */
#define PACKAGE_NAME "Berkeley DB"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Berkeley DB 4.7.25"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "db-4.7.25"
/* Define to the version of this package. */
#define PACKAGE_VERSION "4.7.25"
/* The size of a `char', as computed by sizeof. */
/* #undef SIZEOF_CHAR */
/* The size of a `char *', as computed by sizeof. */
/* #undef SIZEOF_CHAR_P */
/* The size of a `int', as computed by sizeof. */
/* #undef SIZEOF_INT */
/* The size of a `long', as computed by sizeof. */
/* #undef SIZEOF_LONG */
/* The size of a `long long', as computed by sizeof. */
/* #undef SIZEOF_LONG_LONG */
/* The size of a `short', as computed by sizeof. */
/* #undef SIZEOF_SHORT */
/* The size of a `size_t', as computed by sizeof. */
/* #undef SIZEOF_SIZE_T */
/* The size of a `unsigned char', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_CHAR */
/* The size of a `unsigned int', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_INT */
/* The size of a `unsigned long', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_LONG */
/* The size of a `unsigned long long', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_LONG_LONG */
/* The size of a `unsigned short', as computed by sizeof. */
/* #undef SIZEOF_UNSIGNED_SHORT */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* #undef TIME_WITH_SYS_TIME */
/* Define to 1 to mask harmless uninitialized memory read/writes. */
/* #undef UMRW */
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#define inline
#endif
/* type to use in place of socklen_t if not defined */
/* #undef socklen_t */

1212
build_vxworks/db_cxx.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,249 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_deadlock.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
int db_deadlock_main __P((int, char *[]));
int db_deadlock_usage __P((void));
int db_deadlock_version_check __P((void));
const char *progname;
int
db_deadlock(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_deadlock", args, &argc, &argv);
return (db_deadlock_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_deadlock_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
DB_ENV *dbenv;
u_int32_t atype;
time_t now;
u_long secs, usecs;
int rejected, ch, exitval, ret, verbose;
char *home, *logfile, *passwd, *str, time_buf[CTIME_BUFLEN];
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_deadlock_version_check()) != 0)
return (ret);
dbenv = NULL;
atype = DB_LOCK_DEFAULT;
home = logfile = passwd = NULL;
secs = usecs = 0;
exitval = verbose = 0;
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "a:h:L:P:t:Vv")) != EOF)
switch (ch) {
case 'a':
switch (optarg[0]) {
case 'e':
atype = DB_LOCK_EXPIRE;
break;
case 'm':
atype = DB_LOCK_MAXLOCKS;
break;
case 'n':
atype = DB_LOCK_MINLOCKS;
break;
case 'o':
atype = DB_LOCK_OLDEST;
break;
case 'W':
atype = DB_LOCK_MAXWRITE;
break;
case 'w':
atype = DB_LOCK_MINWRITE;
break;
case 'y':
atype = DB_LOCK_YOUNGEST;
break;
default:
return (db_deadlock_usage());
/* NOTREACHED */
}
if (optarg[1] != '\0')
return (db_deadlock_usage());
break;
case 'h':
home = optarg;
break;
case 'L':
logfile = optarg;
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 't':
if ((str = strchr(optarg, '.')) != NULL) {
*str++ = '\0';
if (*str != '\0' && __db_getulong(
NULL, progname, str, 0, LONG_MAX, &usecs))
return (EXIT_FAILURE);
}
if (*optarg != '\0' && __db_getulong(
NULL, progname, optarg, 0, LONG_MAX, &secs))
return (EXIT_FAILURE);
if (secs == 0 && usecs == 0)
return (db_deadlock_usage());
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case 'v':
verbose = 1;
break;
case '?':
default:
return (db_deadlock_usage());
}
argc -= optind;
argv += optind;
if (argc != 0)
return (db_deadlock_usage());
/* Handle possible interruptions. */
__db_util_siginit();
/* Log our process ID. */
if (logfile != NULL && __db_util_logset(progname, logfile))
goto shutdown;
/*
* Create an environment object and initialize it for error
* reporting.
*/
if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
goto shutdown;
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto shutdown;
}
if (verbose) {
(void)dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, 1);
(void)dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, 1);
}
/* An environment is required. */
if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0) {
dbenv->err(dbenv, ret, "open");
goto shutdown;
}
while (!__db_util_interrupted()) {
if (verbose) {
(void)time(&now);
dbenv->errx(dbenv,
"running at %.24s", __os_ctime(&now, time_buf));
}
if ((ret =
dbenv->lock_detect(dbenv, 0, atype, &rejected)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->lock_detect");
goto shutdown;
}
if (verbose)
dbenv->errx(dbenv, "rejected %d locks", rejected);
/* Make a pass every "secs" secs and "usecs" usecs. */
if (secs == 0 && usecs == 0)
break;
__os_yield(dbenv->env, secs, usecs);
}
if (0) {
shutdown: exitval = 1;
}
/* Clean up the logfile. */
if (logfile != NULL)
(void)remove(logfile);
/* Clean up the environment. */
if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (passwd != NULL)
free(passwd);
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
int
db_deadlock_usage()
{
(void)fprintf(stderr,
"usage: %s [-Vv] [-a e | m | n | o | W | w | y]\n\t%s\n", progname,
"[-h home] [-L file] [-P password] [-t sec.usec]");
return (EXIT_FAILURE);
}
int
db_deadlock_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_deadlock20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_deadlock20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_deadlock20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_deadlock.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_deadlock.c_dependencies
<END>
<BEGIN> FILE_db_deadlock.c_objects
db_deadlock.o
<END>
<BEGIN> FILE_db_deadlock.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_deadlock.c
<END>
<BEGIN> userComments
db_deadlock
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_deadlock22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_deadlock22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_deadlock22.out
<END>
<BEGIN> BUILD_RULE_db_deadlock22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_deadlock.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_deadlock.c_dependencies
<END>
<BEGIN> FILE_db_deadlock.c_objects
db_deadlock.o
<END>
<BEGIN> FILE_db_deadlock.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_deadlock.c
<END>
<BEGIN> userComments
db_deadlock
<END>

View File

@@ -0,0 +1,481 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_dump.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/db_am.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
int db_dump_db_init __P((DB_ENV *, char *, int, u_int32_t, int *));
int db_dump_dump_sub __P((DB_ENV *, DB *, char *, int, int));
int db_dump_main __P((int, char *[]));
int db_dump_show_subs __P((DB *));
int db_dump_usage __P((void));
int db_dump_version_check __P((void));
const char *progname;
int
db_dump(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_dump", args, &argc, &argv);
return (db_dump_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_dump_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
DB_ENV *dbenv;
DB *dbp;
u_int32_t cache;
int ch;
int exitval, keyflag, lflag, nflag, pflag, private;
int ret, Rflag, rflag, resize;
char *dopt, *home, *passwd, *subname;
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_dump_version_check()) != 0)
return (ret);
dbenv = NULL;
dbp = NULL;
exitval = lflag = nflag = pflag = rflag = Rflag = 0;
keyflag = 0;
cache = MEGABYTE;
private = 0;
dopt = home = passwd = subname = NULL;
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "d:f:h:klNpP:rRs:V")) != EOF)
switch (ch) {
case 'd':
dopt = optarg;
break;
case 'f':
if (freopen(optarg, "w", stdout) == NULL) {
fprintf(stderr, "%s: %s: reopen: %s\n",
progname, optarg, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 'h':
home = optarg;
break;
case 'k':
keyflag = 1;
break;
case 'l':
lflag = 1;
break;
case 'N':
nflag = 1;
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 'p':
pflag = 1;
break;
case 's':
subname = optarg;
break;
case 'R':
Rflag = 1;
/* DB_AGGRESSIVE requires DB_SALVAGE */
/* FALLTHROUGH */
case 'r':
rflag = 1;
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case '?':
default:
return (db_dump_usage());
}
argc -= optind;
argv += optind;
if (argc != 1)
return (db_dump_usage());
if (dopt != NULL && pflag) {
fprintf(stderr,
"%s: the -d and -p options may not both be specified\n",
progname);
return (EXIT_FAILURE);
}
if (lflag && subname != NULL) {
fprintf(stderr,
"%s: the -l and -s options may not both be specified\n",
progname);
return (EXIT_FAILURE);
}
if (keyflag && rflag) {
fprintf(stderr, "%s: %s",
"the -k and -r or -R options may not both be specified\n",
progname);
return (EXIT_FAILURE);
}
if (subname != NULL && rflag) {
fprintf(stderr, "%s: %s",
"the -s and -r or R options may not both be specified\n",
progname);
return (EXIT_FAILURE);
}
/* Handle possible interruptions. */
__db_util_siginit();
/*
* Create an environment object and initialize it for error
* reporting.
*/
retry: if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
goto err;
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (nflag) {
if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) {
dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING");
goto err;
}
if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) {
dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC");
goto err;
}
}
if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto err;
}
/* Initialize the environment. */
if (db_dump_db_init(dbenv, home, rflag, cache, &private) != 0)
goto err;
/* Create the DB object and open the file. */
if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
dbenv->err(dbenv, ret, "db_create");
goto err;
}
/*
* If we're salvaging, don't do an open; it might not be safe.
* Dispatch now into the salvager.
*/
if (rflag) {
/* The verify method is a destructor. */
ret = dbp->verify(dbp, argv[0], NULL, stdout,
DB_SALVAGE |
(Rflag ? DB_AGGRESSIVE : 0) |
(pflag ? DB_PRINTABLE : 0));
dbp = NULL;
if (ret != 0)
goto err;
goto done;
}
if ((ret = dbp->open(dbp, NULL,
argv[0], subname, DB_UNKNOWN, DB_RDONLY, 0)) != 0) {
dbp->err(dbp, ret, "open: %s", argv[0]);
goto err;
}
if (private != 0) {
if ((ret = __db_util_cache(dbp, &cache, &resize)) != 0)
goto err;
if (resize) {
(void)dbp->close(dbp, 0);
dbp = NULL;
(void)dbenv->close(dbenv, 0);
dbenv = NULL;
goto retry;
}
}
if (dopt != NULL) {
if ((ret = __db_dumptree(dbp, NULL, dopt, NULL)) != 0) {
dbp->err(dbp, ret, "__db_dumptree: %s", argv[0]);
goto err;
}
} else if (lflag) {
if (dbp->get_multiple(dbp)) {
if (db_dump_show_subs(dbp))
goto err;
} else {
dbp->errx(dbp,
"%s: does not contain multiple databases", argv[0]);
goto err;
}
} else {
if (subname == NULL && dbp->get_multiple(dbp)) {
if (db_dump_dump_sub(dbenv, dbp, argv[0], pflag, keyflag))
goto err;
} else
if (dbp->dump(dbp, NULL,
__db_pr_callback, stdout, pflag, keyflag))
goto err;
}
if (0) {
err: exitval = 1;
}
done: if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0) {
exitval = 1;
dbenv->err(dbenv, ret, "close");
}
if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (passwd != NULL)
free(passwd);
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
/*
* db_init --
* Initialize the environment.
*/
int
db_dump_db_init(dbenv, home, is_salvage, cache, is_privatep)
DB_ENV *dbenv;
char *home;
int is_salvage;
u_int32_t cache;
int *is_privatep;
{
int ret;
/*
* Try and use the underlying environment when opening a database.
* We wish to use the buffer pool so our information is as up-to-date
* as possible, even if the mpool cache hasn't been flushed.
*
* If we are not doing a salvage, we want to join the environment;
* if a locking system is present, this will let us use it and be
* safe to run concurrently with other threads of control. (We never
* need to use transactions explicitly, as we're read-only.) Note
* that in CDB, too, this will configure our environment
* appropriately, and our cursors will (correctly) do locking as CDB
* read cursors.
*
* If we are doing a salvage, the verification code will protest
* if we initialize transactions, logging, or locking; do an
* explicit DB_INIT_MPOOL to try to join any existing environment
* before we create our own.
*/
*is_privatep = 0;
if ((ret = dbenv->open(dbenv, home,
DB_USE_ENVIRON | (is_salvage ? DB_INIT_MPOOL : 0), 0)) == 0)
return (0);
if (ret == DB_VERSION_MISMATCH)
goto err;
/*
* An environment is required because we may be trying to look at
* databases in directories other than the current one. We could
* avoid using an environment iff the -h option wasn't specified,
* but that seems like more work than it's worth.
*
* No environment exists (or, at least no environment that includes
* an mpool region exists). Create one, but make it private so that
* no files are actually created.
*/
*is_privatep = 1;
if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) == 0 &&
(ret = dbenv->open(dbenv, home,
DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0)) == 0)
return (0);
/* An environment is required. */
err: dbenv->err(dbenv, ret, "DB_ENV->open");
return (1);
}
/*
* dump_sub --
* Dump out the records for a DB containing subdatabases.
*/
int
db_dump_dump_sub(dbenv, parent_dbp, parent_name, pflag, keyflag)
DB_ENV *dbenv;
DB *parent_dbp;
char *parent_name;
int pflag, keyflag;
{
DB *dbp;
DBC *dbcp;
DBT key, data;
int ret;
char *subdb;
/*
* Get a cursor and step through the database, dumping out each
* subdatabase.
*/
if ((ret = parent_dbp->cursor(parent_dbp, NULL, &dbcp, 0)) != 0) {
dbenv->err(dbenv, ret, "DB->cursor");
return (1);
}
memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data));
while ((ret = dbcp->get(dbcp, &key, &data,
DB_IGNORE_LEASE | DB_NEXT)) == 0) {
/* Nul terminate the subdatabase name. */
if ((subdb = malloc(key.size + 1)) == NULL) {
dbenv->err(dbenv, ENOMEM, NULL);
return (1);
}
memcpy(subdb, key.data, key.size);
subdb[key.size] = '\0';
/* Create the DB object and open the file. */
if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
dbenv->err(dbenv, ret, "db_create");
free(subdb);
return (1);
}
if ((ret = dbp->open(dbp, NULL,
parent_name, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0)
dbp->err(dbp, ret,
"DB->open: %s:%s", parent_name, subdb);
if (ret == 0 && dbp->dump(
dbp, subdb, __db_pr_callback, stdout, pflag, keyflag))
ret = 1;
(void)dbp->close(dbp, 0);
free(subdb);
if (ret != 0)
return (1);
}
if (ret != DB_NOTFOUND) {
parent_dbp->err(parent_dbp, ret, "DBcursor->get");
return (1);
}
if ((ret = dbcp->close(dbcp)) != 0) {
parent_dbp->err(parent_dbp, ret, "DBcursor->close");
return (1);
}
return (0);
}
/*
* show_subs --
* Display the subdatabases for a database.
*/
int
db_dump_show_subs(dbp)
DB *dbp;
{
DBC *dbcp;
DBT key, data;
int ret;
/*
* Get a cursor and step through the database, printing out the key
* of each key/data pair.
*/
if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) {
dbp->err(dbp, ret, "DB->cursor");
return (1);
}
memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data));
while ((ret = dbcp->get(dbcp, &key, &data,
DB_IGNORE_LEASE | DB_NEXT)) == 0) {
if ((ret = dbp->dbenv->prdbt(
&key, 1, NULL, stdout, __db_pr_callback, 0)) != 0) {
dbp->errx(dbp, NULL);
return (1);
}
}
if (ret != DB_NOTFOUND) {
dbp->err(dbp, ret, "DBcursor->get");
return (1);
}
if ((ret = dbcp->close(dbcp)) != 0) {
dbp->err(dbp, ret, "DBcursor->close");
return (1);
}
return (0);
}
/*
* usage --
* Display the usage message.
*/
int
db_dump_usage()
{
(void)fprintf(stderr, "usage: %s [-klNprRV]\n\t%s\n",
progname,
"[-d ahr] [-f output] [-h home] [-P password] [-s database] db_file");
return (EXIT_FAILURE);
}
int
db_dump_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_dump20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_dump20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_dump20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_dump.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_dump.c_dependencies
<END>
<BEGIN> FILE_db_dump.c_objects
db_dump.o
<END>
<BEGIN> FILE_db_dump.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_dump.c
<END>
<BEGIN> userComments
db_dump
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_dump22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_dump22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_dump22.out
<END>
<BEGIN> BUILD_RULE_db_dump22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_dump.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_dump.c_dependencies
<END>
<BEGIN> FILE_db_dump.c_objects
db_dump.o
<END>
<BEGIN> FILE_db_dump.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_dump.c
<END>
<BEGIN> userComments
db_dump
<END>

View File

@@ -0,0 +1,879 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_hotbackup.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#include "dbinc/log.h"
#include "dbinc/db_page.h"
#include "dbinc/qam.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
enum which_open { OPEN_ORIGINAL, OPEN_HOT_BACKUP };
int db_hotbackup_backup_dir_clean __P((DB_ENV *, char *, char *, int *, int, int));
int db_hotbackup_data_copy __P((DB_ENV *, char *, char *, char *, int));
int db_hotbackup_env_init __P((DB_ENV **,
char *, char **, char ***, char *, enum which_open));
int db_hotbackup_main __P((int, char *[]));
int db_hotbackup_read_data_dir __P((DB_ENV *, char *, char *, char *, int, int));
int db_hotbackup_read_log_dir __P((DB_ENV *, char *, char *, char *, int *, int, int));
int db_hotbackup_usage __P((void));
int db_hotbackup_version_check __P((void));
const char *progname;
int
db_hotbackup(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_hotbackup", args, &argc, &argv);
return (db_hotbackup_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_hotbackup_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
time_t now;
DB_ENV *dbenv;
u_int data_cnt, data_next;
int ch, checkpoint, copy_min, db_config, exitval;
int remove_max, ret, update, verbose;
char *backup_dir, **data_dir, **dir, *home, *log_dir, *passwd;
char home_buf[DB_MAXPATHLEN], time_buf[CTIME_BUFLEN];
/*
* Make sure all verbose message are output before any error messages
* in the case where the output is being logged into a file. This
* call has to be done before any operation is performed on the stream.
*
* Use unbuffered I/O because line-buffered I/O requires a buffer, and
* some operating systems have buffer alignment and size constraints we
* don't want to care about. There isn't enough output for the calls
* to matter.
*/
setbuf(stdout, NULL);
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_hotbackup_version_check()) != 0)
return (ret);
checkpoint = db_config = data_cnt =
data_next = exitval = update = verbose = 0;
data_dir = NULL;
backup_dir = home = passwd = NULL;
log_dir = NULL;
copy_min = remove_max = 0;
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "b:cDd:h:l:P:uVv")) != EOF)
switch (ch) {
case 'b':
backup_dir = optarg;
break;
case 'c':
checkpoint = 1;
break;
case 'D':
db_config = 1;
break;
case 'd':
/*
* User can specify a list of directories -- keep an
* array, leaving room for the trailing NULL.
*/
if (data_dir == NULL || data_next >= data_cnt - 2) {
data_cnt = data_cnt == 0 ? 20 : data_cnt * 2;
if ((data_dir = realloc(data_dir,
data_cnt * sizeof(*data_dir))) == NULL) {
fprintf(stderr, "%s: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
}
data_dir[data_next++] = optarg;
break;
case 'h':
home = optarg;
break;
case 'l':
log_dir = optarg;
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 'u':
update = 1;
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case 'v':
verbose = 1;
break;
case '?':
default:
return (db_hotbackup_usage());
}
argc -= optind;
argv += optind;
if (argc != 0)
return (db_hotbackup_usage());
/* NULL-terminate any list of data directories. */
if (data_dir != NULL) {
data_dir[data_next] = NULL;
/*
* -d is relative to the current directory, to run a checkpoint
* we must have directories relative to the environment.
*/
if (checkpoint == 1) {
fprintf(stderr,
"%s: cannot specify -d and -c\n", progname);
return (db_hotbackup_usage());
}
}
if (db_config && (data_dir != NULL || log_dir != NULL)) {
fprintf(stderr,
"%s: cannot specify -D and -d or -l\n", progname);
return (db_hotbackup_usage());
}
/* Handle possible interruptions. */
__db_util_siginit();
/*
* The home directory defaults to the environment variable DB_HOME.
* The log directory defaults to the home directory.
*
* We require a source database environment directory and a target
* backup directory.
*/
if (home == NULL) {
home = home_buf;
if ((ret = __os_getenv(
NULL, "DB_HOME", &home, sizeof(home_buf))) != 0) {
fprintf(stderr,
"%s failed to get environment variable DB_HOME: %s\n",
progname, db_strerror(ret));
return (EXIT_FAILURE);
}
/*
* home set to NULL if __os_getenv failed to find DB_HOME.
*/
}
if (home == NULL) {
fprintf(stderr,
"%s: no source database environment specified\n", progname);
return (db_hotbackup_usage());
}
if (backup_dir == NULL) {
fprintf(stderr,
"%s: no target backup directory specified\n", progname);
return (db_hotbackup_usage());
}
if (verbose) {
(void)time(&now);
printf("%s: hot backup started at %s",
progname, __os_ctime(&now, time_buf));
}
/* Open the source environment. */
if (db_hotbackup_env_init(&dbenv, home,
(db_config || log_dir != NULL) ? &log_dir : NULL,
db_config ? &data_dir : NULL,
passwd, OPEN_ORIGINAL) != 0)
goto shutdown;
if (db_config && __os_abspath(log_dir)) {
fprintf(stderr,
"%s: DB_CONFIG must not contain an absolute path for the log directory",
progname);
goto shutdown;
}
/*
* If the -c option is specified, checkpoint the source home
* database environment, and remove any unnecessary log files.
*/
if (checkpoint) {
if (verbose)
printf("%s: %s: force checkpoint\n", progname, home);
if ((ret =
dbenv->txn_checkpoint(dbenv, 0, 0, DB_FORCE)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->txn_checkpoint");
goto shutdown;
}
if (!update) {
if (verbose)
printf("%s: %s: remove unnecessary log files\n",
progname, home);
if ((ret = dbenv->log_archive(dbenv,
NULL, DB_ARCH_REMOVE)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->log_archive");
goto shutdown;
}
}
}
/*
* If the target directory for the backup does not exist, create it
* with mode read-write-execute for the owner. Ignore errors here,
* it's simpler and more portable to just always try the create. If
* there's a problem, we'll fail with reasonable errors later.
*/
(void)__os_mkdir(NULL, backup_dir, DB_MODE_700);
/*
* If -u was specified, remove all log files; if -u was not specified,
* remove all files.
*
* Potentially there are two directories to clean, the log directory
* and the target directory. First, clean up the log directory if
* it's different from the target directory, then clean up the target
* directory.
*/
if (db_config && log_dir != NULL &&
db_hotbackup_backup_dir_clean(
dbenv, backup_dir, log_dir, &remove_max, update, verbose) != 0)
goto shutdown;
if (db_hotbackup_backup_dir_clean(dbenv,
backup_dir, NULL, &remove_max, update, verbose) != 0)
goto shutdown;
/*
* If the -u option was not specified, copy all database files found in
* the database environment home directory, or any directory specified
* using the -d option, into the target directory for the backup.
*/
if (!update) {
if (db_hotbackup_read_data_dir(dbenv, home,
backup_dir, home, verbose, db_config) != 0)
goto shutdown;
if (data_dir != NULL)
for (dir = data_dir; *dir != NULL; ++dir) {
/*
* Don't allow absolute path names taken from
* the DB_CONFIG file -- running recovery with
* them would corrupt the source files.
*/
if (db_config && __os_abspath(*dir)) {
fprintf(stderr,
"%s: data directory '%s' is absolute path, not permitted with -D option\n",
progname, *dir);
goto shutdown;
}
if (db_hotbackup_read_data_dir(dbenv, home,
backup_dir, *dir, verbose, db_config) != 0)
goto shutdown;
}
}
/*
* Copy all log files found in the directory specified by the -l option
* (or in the database environment home directory, if no -l option was
* specified), into the target directory for the backup.
*
* The log directory defaults to the home directory.
*/
if (db_hotbackup_read_log_dir(dbenv, db_config ? home : NULL, backup_dir,
log_dir == NULL ? home : log_dir, &copy_min, update, verbose) != 0)
goto shutdown;
/*
* If we're updating a snapshot, the lowest-numbered log file copied
* into the backup directory should be less than, or equal to, the
* highest-numbered log file removed from the backup directory during
* cleanup.
*/
if (update && remove_max < copy_min &&
!(remove_max == 0 && copy_min == 1)) {
fprintf(stderr,
"%s: the largest log file removed (%d) must be greater\n",
progname, remove_max);
fprintf(stderr,
"%s: than or equal the smallest log file copied (%d)\n",
progname, copy_min);
goto shutdown;
}
/* Close the source environment. */
if ((ret = dbenv->close(dbenv, 0)) != 0) {
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
dbenv = NULL;
goto shutdown;
}
/* Perform catastrophic recovery on the hot backup. */
if (verbose)
printf("%s: %s: run catastrophic recovery\n",
progname, backup_dir);
if (db_hotbackup_env_init(
&dbenv, backup_dir, NULL, NULL, passwd, OPEN_HOT_BACKUP) != 0)
goto shutdown;
/*
* Remove any unnecessary log files from the hot backup.
*/
if (verbose)
printf("%s: %s: remove unnecessary log files\n",
progname, backup_dir);
if ((ret =
dbenv->log_archive(dbenv, NULL, DB_ARCH_REMOVE)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->log_archive");
goto shutdown;
}
if (0) {
shutdown: exitval = 1;
}
if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (exitval == 0) {
if (verbose) {
(void)time(&now);
printf("%s: hot backup completed at %s",
progname, __os_ctime(&now, time_buf));
}
} else {
fprintf(stderr, "%s: HOT BACKUP FAILED!\n", progname);
}
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
/*
* env_init --
* Open a database environment.
*/
int
db_hotbackup_env_init(dbenvp, home, log_dirp, data_dirp, passwd, which)
DB_ENV **dbenvp;
char *home, **log_dirp, ***data_dirp, *passwd;
enum which_open which;
{
DB_ENV *dbenv;
int ret;
*dbenvp = NULL;
/*
* Create an environment object and initialize it for error reporting.
*/
if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
return (1);
}
dbenv->set_errfile(dbenv, stderr);
setbuf(stderr, NULL);
dbenv->set_errpfx(dbenv, progname);
/* Any created intermediate directories are created private. */
if ((ret = dbenv->set_intermediate_dir_mode(dbenv, "rwx------")) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->set_intermediate_dir_mode");
return (1);
}
/*
* If a log directory has been specified, and it's not the same as the
* home directory, set it for the environment.
*/
if (log_dirp != NULL && *log_dirp != NULL &&
(ret = dbenv->set_lg_dir(dbenv, *log_dirp)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->set_lg_dir: %s", *log_dirp);
return (1);
}
/* Optionally set the password. */
if (passwd != NULL &&
(ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->set_encrypt");
return (1);
}
switch (which) {
case OPEN_ORIGINAL:
/*
* Opening the database environment we're trying to back up.
* We try to attach to a pre-existing environment; if that
* fails, we create a private environment and try again.
*/
if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
(ret == DB_VERSION_MISMATCH ||
(ret = dbenv->open(dbenv, home, DB_CREATE |
DB_INIT_LOG | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON,
0)) != 0)) {
dbenv->err(dbenv, ret, "DB_ENV->open: %s", home);
return (1);
}
if (log_dirp != NULL && *log_dirp == NULL)
(void)dbenv->get_lg_dir(dbenv, (const char **)log_dirp);
if (data_dirp != NULL && *data_dirp == NULL)
(void)dbenv->get_data_dirs(
dbenv, (const char ***)data_dirp);
break;
case OPEN_HOT_BACKUP:
/*
* Opening the backup copy of the database environment. We
* better be the only user, we're running recovery.
* Ensure that there at least minimal cache for worst
* case page size.
*/
if ((ret =
dbenv->set_cachesize(dbenv, 0, 64 * 1024 * 10, 0)) != 0) {
dbenv->err(dbenv,
ret, "DB_ENV->set_cachesize: %s", home);
return (1);
}
if ((ret = dbenv->open(dbenv, home, DB_CREATE |
DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_PRIVATE |
DB_RECOVER_FATAL | DB_USE_ENVIRON, 0)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->open: %s", home);
return (1);
}
break;
}
*dbenvp = dbenv;
return (0);
}
/*
* backup_dir_clean --
* Clean out the backup directory.
*/
int
db_hotbackup_backup_dir_clean(dbenv, backup_dir, log_dir, remove_maxp, update, verbose)
DB_ENV *dbenv;
char *backup_dir, *log_dir;
int *remove_maxp, update, verbose;
{
ENV *env;
int cnt, fcnt, ret, v;
char **names, *dir, buf[DB_MAXPATHLEN], path[DB_MAXPATHLEN];
env = dbenv->env;
/* We may be cleaning a log directory separate from the target. */
if (log_dir != NULL) {
if ((size_t)snprintf(buf, sizeof(buf), "%s%c%s",
backup_dir, PATH_SEPARATOR[0] ,log_dir) >= sizeof(buf)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
backup_dir, PATH_SEPARATOR[0] ,log_dir);
return (1);
}
dir = buf;
} else
dir = backup_dir;
/* Get a list of file names. */
if ((ret = __os_dirlist(env, dir, 0, &names, &fcnt)) != 0) {
if (log_dir != NULL && !update)
return (0);
dbenv->err(dbenv, ret, "%s: directory read", dir);
return (1);
}
for (cnt = fcnt; --cnt >= 0;) {
/*
* Skip non-log files (if update was specified).
*/
if (strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1)) {
if (update)
continue;
} else {
/* Track the highest-numbered log file removed. */
v = atoi(names[cnt] + sizeof(LFPREFIX) - 1);
if (*remove_maxp < v)
*remove_maxp = v;
}
if ((size_t)snprintf(path, sizeof(path), "%s%c%s",
dir, PATH_SEPARATOR[0], names[cnt]) >= sizeof(path)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
dir, PATH_SEPARATOR[0], names[cnt]);
return (1);
}
if (verbose)
printf("%s: removing %s\n", progname, path);
if (__os_unlink(env, path, 0) != 0)
return (1);
}
__os_dirfree(env, names, fcnt);
if (verbose && *remove_maxp != 0)
printf("%s: highest numbered log file removed: %d\n",
progname, *remove_maxp);
return (0);
}
/*
* read_data_dir --
* Read a directory looking for databases to copy.
*/
int
db_hotbackup_read_data_dir(dbenv, home, backup_dir, dir, verbose, db_config)
DB_ENV *dbenv;
char *home, *backup_dir, *dir;
int verbose, db_config;
{
ENV *env;
int cnt, fcnt, ret;
char *bd, **names;
char buf[DB_MAXPATHLEN], bbuf[DB_MAXPATHLEN];
env = dbenv->env;
bd = backup_dir;
if (db_config && dir != home) {
/* Build a path name to the destination. */
if ((size_t)(cnt = snprintf(bbuf, sizeof(bbuf), "%s%c%s%c",
backup_dir, PATH_SEPARATOR[0],
dir, PATH_SEPARATOR[0])) >= sizeof(buf)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
backup_dir, PATH_SEPARATOR[0], dir);
return (1);
}
bd = bbuf;
/* Create the path. */
if ((ret = __db_mkpath(env, bd)) != 0) {
dbenv->err(dbenv, ret, "%s: cannot create", bd);
return (1);
}
/* step on the trailing '/' */
bd[cnt - 1] = '\0';
/* Build a path name to the source. */
if ((size_t)snprintf(buf, sizeof(buf),
"%s%c%s", home, PATH_SEPARATOR[0], dir) >= sizeof(buf)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
home, PATH_SEPARATOR[0], dir);
return (1);
}
dir = buf;
}
/* Get a list of file names. */
if ((ret = __os_dirlist(env, dir, 0, &names, &fcnt)) != 0) {
dbenv->err(dbenv, ret, "%s: directory read", dir);
return (1);
}
for (cnt = fcnt; --cnt >= 0;) {
/*
* Skip files in DB's name space (but not Queue
* extent files, we need them).
*/
if (!strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1))
continue;
if (!strncmp(names[cnt],
DB_REGION_PREFIX, sizeof(DB_REGION_PREFIX) - 1) &&
strncmp(names[cnt],
QUEUE_EXTENT_PREFIX, sizeof(QUEUE_EXTENT_PREFIX) - 1))
continue;
/*
* Skip DB_CONFIG.
*/
if (!db_config &&
!strncmp(names[cnt], "DB_CONFIG", sizeof("DB_CONFIG")))
continue;
/* Copy the file. */
if (db_hotbackup_data_copy(dbenv, names[cnt], dir, bd, verbose) != 0)
return (1);
}
__os_dirfree(env, names, fcnt);
return (0);
}
/*
* read_log_dir --
* * Read a directory looking for log files to copy. If home
* is passed then we are possibly using a log dir in the destination,
* following DB_CONFIG configuration.
*/
int
db_hotbackup_read_log_dir(dbenv, home, backup_dir, log_dir, copy_minp, update, verbose)
DB_ENV *dbenv;
char *home, *backup_dir, *log_dir;
int *copy_minp, update, verbose;
{
ENV *env;
u_int32_t aflag;
int cnt, ret, v;
char **begin, **names, *backupd, *logd;
char from[DB_MAXPATHLEN], to[DB_MAXPATHLEN];
env = dbenv->env;
if (home != NULL && log_dir != NULL) {
if ((size_t)snprintf(from, sizeof(from), "%s%c%s",
home, PATH_SEPARATOR[0], log_dir) >= sizeof(from)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
home, PATH_SEPARATOR[0], log_dir);
return (1);
}
logd = strdup(from);
if ((size_t)(cnt = snprintf(to, sizeof(to),
"%s%c%s%c", backup_dir, PATH_SEPARATOR[0],
log_dir, PATH_SEPARATOR[0])) >= sizeof(to)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
backup_dir, PATH_SEPARATOR[0], log_dir);
return (1);
}
backupd = strdup(to);
/* Create the backup log directory. */
if ((ret = __db_mkpath(env, backupd)) != 0) {
dbenv->err(dbenv, ret, "%s: cannot create", backupd);
return (1);
}
/* Step on the trailing '/'. */
backupd[cnt - 1] = '\0';
} else {
backupd = backup_dir;
logd = log_dir;
}
again: aflag = DB_ARCH_LOG;
/*
* If this is an update and we are deleting files, first process
* those files that can be removed, then repeat with the rest.
*/
if (update)
aflag = 0;
/* Get a list of file names to be copied. */
if ((ret = dbenv->log_archive(dbenv, &names, aflag)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->log_archive");
return (1);
}
if (names == NULL)
goto done;
begin = names;
for (; *names != NULL; names++) {
/* Track the lowest-numbered log file copied. */
v = atoi(*names + sizeof(LFPREFIX) - 1);
if (*copy_minp == 0 || *copy_minp > v)
*copy_minp = v;
if ((size_t)snprintf(from, sizeof(from), "%s%c%s",
logd, PATH_SEPARATOR[0], *names) >= sizeof(from)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
logd, PATH_SEPARATOR[0], *names);
return (1);
}
/*
* If we're going to remove the file, attempt to rename the
* instead of copying and then removing. The likely failure
* is EXDEV (source and destination are on different volumes).
* Fall back to a copy, regardless of the error. We don't
* worry about partial contents, the copy truncates the file
* on open.
*/
if (update) {
if ((size_t)snprintf(to, sizeof(to), "%s%c%s",
backupd, PATH_SEPARATOR[0], *names) >= sizeof(to)) {
dbenv->errx(dbenv, "%s%c%s: path too long",
backupd, PATH_SEPARATOR[0], *names);
return (1);
}
if (__os_rename(env, from, to, 1) == 0) {
if (verbose)
printf("%s: moving %s to %s\n",
progname, from, to);
continue;
}
}
/* Copy the file. */
if (db_hotbackup_data_copy(dbenv, *names, logd, backupd, verbose) != 0)
return (1);
if (update) {
if (verbose)
printf("%s: removing %s\n", progname, from);
if ((ret = __os_unlink(env, from, 0)) != 0) {
dbenv->err(dbenv, ret,
"unlink of %s failed", from);
return (1);
}
}
}
free(begin);
done: if (update) {
update = 0;
goto again;
}
if (verbose && *copy_minp != 0)
printf("%s: lowest numbered log file copied: %d\n",
progname, *copy_minp);
if (logd != log_dir)
free(logd);
if (backupd != backup_dir)
free(backupd);
return (0);
}
/*
* data_copy --
* Copy a file into the backup directory.
*/
int
db_hotbackup_data_copy(dbenv, file, from_dir, to_dir, verbose)
DB_ENV *dbenv;
char *file, *from_dir, *to_dir;
int verbose;
{
DB_FH *rfhp, *wfhp;
ENV *env;
size_t nr, nw;
int ret;
char *buf;
rfhp = wfhp = NULL;
env = dbenv->env;
ret = 0;
if (verbose)
printf("%s: copying %s%c%s to %s%c%s\n", progname, from_dir,
PATH_SEPARATOR[0], file, to_dir, PATH_SEPARATOR[0], file);
/*
* We MUST copy multiples of the page size, atomically, to ensure a
* database page is not updated by another thread of control during
* the copy.
*
* !!!
* The current maximum page size for Berkeley DB is 64KB; we will have
* to increase this value if the maximum page size is ever more than a
* megabyte
*/
if ((buf = malloc(MEGABYTE)) == NULL) {
dbenv->err(dbenv,
errno, "%lu buffer allocation", (u_long)MEGABYTE);
return (1);
}
/* Open the input file. */
if (snprintf(buf, MEGABYTE, "%s%c%s",
from_dir, PATH_SEPARATOR[0], file) >= MEGABYTE) {
dbenv->errx(dbenv,
"%s%c%s: path too long", from_dir, PATH_SEPARATOR[0], file);
goto err;
}
if ((ret = __os_open(env, buf, 0, DB_OSO_RDONLY, 0, &rfhp)) != 0) {
dbenv->err(dbenv, ret, "%s", buf);
goto err;
}
/* Open the output file. */
if (snprintf(buf, MEGABYTE, "%s%c%s",
to_dir, PATH_SEPARATOR[0], file) >= MEGABYTE) {
dbenv->errx(dbenv,
"%s%c%s: path too long", to_dir, PATH_SEPARATOR[0], file);
goto err;
}
if ((ret = __os_open(env, buf, 0,
DB_OSO_CREATE | DB_OSO_TRUNC, DB_MODE_600, &wfhp)) != 0) {
dbenv->err(dbenv, ret, "%s", buf);
goto err;
}
/* Copy the data. */
while ((ret = __os_read(env, rfhp, buf, MEGABYTE, &nr)) == 0 &&
nr > 0)
if ((ret = __os_write(env, wfhp, buf, nr, &nw)) != 0)
break;
if (0) {
err: ret = 1;
}
if (buf != NULL)
free(buf);
if (rfhp != NULL && __os_closehandle(env, rfhp) != 0)
ret = 1;
/* We may be running on a remote filesystem; force the flush. */
if (wfhp != NULL) {
if (__os_fsync(env, wfhp) != 0)
ret = 1;
if (__os_closehandle(env, wfhp) != 0)
ret = 1;
}
return (ret);
}
int
db_hotbackup_usage()
{
(void)fprintf(stderr, "usage: %s [-cDuVv]\n\t%s\n", progname,
"[-d data_dir ...] [-h home] [-l log_dir] [-P password] -b backup_dir");
return (EXIT_FAILURE);
}
int
db_hotbackup_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_hotbackup20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_hotbackup20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_hotbackup20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_hotbackup.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_hotbackup.c_dependencies
<END>
<BEGIN> FILE_db_hotbackup.c_objects
db_hotbackup.o
<END>
<BEGIN> FILE_db_hotbackup.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_hotbackup.c
<END>
<BEGIN> userComments
db_hotbackup
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_hotbackup22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_hotbackup22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_hotbackup22.out
<END>
<BEGIN> BUILD_RULE_db_hotbackup22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_hotbackup.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_hotbackup.c_dependencies
<END>
<BEGIN> FILE_db_hotbackup.c_objects
db_hotbackup.o
<END>
<BEGIN> FILE_db_hotbackup.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_hotbackup.c
<END>
<BEGIN> userComments
db_hotbackup
<END>

916
build_vxworks/db_int.h Normal file
View File

@@ -0,0 +1,916 @@
/* DO NOT EDIT: automatically built by dist/s_vxworks. */
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_int.h 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#ifndef _DB_INT_H_
#define _DB_INT_H_
/*******************************************************
* Berkeley DB ANSI/POSIX include files.
*******************************************************/
#include "vxWorks.h"
#ifdef HAVE_SYSTEM_INCLUDE_FILES
#include <sys/types.h>
#ifdef DIAG_MVCC
#include <sys/mman.h>
#endif
#include <sys/stat.h>
#if defined(__INCLUDE_SELECT_H)
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_VXWORKS
#include <selectLib.h>
#endif
#endif
#if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif
#ifdef HAVE_VXWORKS
#include <net/uio.h>
#else
#include <sys/uio.h>
#endif
#if defined(__INCLUDE_NETWORKING)
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#endif
#if defined(STDC_HEADERS) || defined(__cplusplus)
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#if defined(__INCLUDE_DIRECTORY)
#if HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# if HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# if HAVE_NDIR_H
# include <ndir.h>
# endif
#endif
#endif /* __INCLUDE_DIRECTORY */
#endif /* !HAVE_SYSTEM_INCLUDE_FILES */
#include "clib_port.h"
#include "db.h"
#ifdef DB_WIN32
#include "dbinc/win_db.h"
#endif
#include "db.h"
#include "clib_port.h"
#include "dbinc/queue.h"
#include "dbinc/shqueue.h"
#if defined(__cplusplus)
extern "C" {
#endif
/*******************************************************
* Forward structure declarations.
*******************************************************/
struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO;
struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD;
struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST;
struct __vrfy_childinfo;typedef struct __vrfy_childinfo VRFY_CHILDINFO;
struct __vrfy_dbinfo; typedef struct __vrfy_dbinfo VRFY_DBINFO;
struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB;
/*******************************************************
* General purpose constants and macros.
*******************************************************/
#undef FALSE
#define FALSE 0
#undef TRUE
#define TRUE (!FALSE)
#define MEGABYTE 1048576
#define GIGABYTE 1073741824
#define NS_PER_MS 1000000 /* Nanoseconds in a millisecond */
#define NS_PER_US 1000 /* Nanoseconds in a microsecond */
#define NS_PER_SEC 1000000000 /* Nanoseconds in a second */
#define US_PER_MS 1000 /* Microseconds in a millisecond */
#define US_PER_SEC 1000000 /* Microseconds in a second */
#define MS_PER_SEC 1000 /* Milliseconds in a second */
#define RECNO_OOB 0 /* Illegal record number. */
/* Test for a power-of-two (tests true for zero, which doesn't matter here). */
#define POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0)
/* Test for valid page sizes. */
#define DB_MIN_PGSIZE 0x000200 /* Minimum page size (512). */
#define DB_MAX_PGSIZE 0x010000 /* Maximum page size (65536). */
#define IS_VALID_PAGESIZE(x) \
(POWER_OF_TWO(x) && (x) >= DB_MIN_PGSIZE && ((x) <= DB_MAX_PGSIZE))
/* Minimum number of pages cached, by default. */
#define DB_MINPAGECACHE 16
/*
* If we are unable to determine the underlying filesystem block size, use
* 8K on the grounds that most OS's use less than 8K for a VM page size.
*/
#define DB_DEF_IOSIZE (8 * 1024)
/* Align an integer to a specific boundary. */
#undef DB_ALIGN
#define DB_ALIGN(v, bound) \
(((v) + (bound) - 1) & ~(((uintmax_t)(bound)) - 1))
/* Increment a pointer to a specific boundary. */
#undef ALIGNP_INC
#define ALIGNP_INC(p, bound) \
(void *)(((uintptr_t)(p) + (bound) - 1) & ~(((uintptr_t)(bound)) - 1))
/*
* Print an address as a u_long (a u_long is the largest type we can print
* portably). Most 64-bit systems have made longs 64-bits, so this should
* work.
*/
#define P_TO_ULONG(p) ((u_long)(uintptr_t)(p))
/*
* Convert a pointer to a small integral value.
*
* The (u_int16_t)(uintptr_t) cast avoids warnings: the (uintptr_t) cast
* converts the value to an integral type, and the (u_int16_t) cast converts
* it to a small integral type so we don't get complaints when we assign the
* final result to an integral type smaller than uintptr_t.
*/
#define P_TO_UINT32(p) ((u_int32_t)(uintptr_t)(p))
#define P_TO_UINT16(p) ((u_int16_t)(uintptr_t)(p))
/*
* There are several on-page structures that are declared to have a number of
* fields followed by a variable length array of items. The structure size
* without including the variable length array or the address of the first of
* those elements can be found using SSZ.
*
* This macro can also be used to find the offset of a structure element in a
* structure. This is used in various places to copy structure elements from
* unaligned memory references, e.g., pointers into a packed page.
*
* There are two versions because compilers object if you take the address of
* an array.
*/
#undef SSZ
#define SSZ(name, field) P_TO_UINT16(&(((name *)0)->field))
#undef SSZA
#define SSZA(name, field) P_TO_UINT16(&(((name *)0)->field[0]))
/* Structure used to print flag values. */
typedef struct __fn {
u_int32_t mask; /* Flag value. */
const char *name; /* Flag name. */
} FN;
/* Set, clear and test flags. */
#define FLD_CLR(fld, f) (fld) &= ~(f)
#define FLD_ISSET(fld, f) ((fld) & (f))
#define FLD_SET(fld, f) (fld) |= (f)
#define F_CLR(p, f) (p)->flags &= ~(f)
#define F_ISSET(p, f) ((p)->flags & (f))
#define F_SET(p, f) (p)->flags |= (f)
#define LF_CLR(f) ((flags) &= ~(f))
#define LF_ISSET(f) ((flags) & (f))
#define LF_SET(f) ((flags) |= (f))
/*
* Calculate a percentage. The values can overflow 32-bit integer arithmetic
* so we use floating point.
*
* When calculating a bytes-vs-page size percentage, we're getting the inverse
* of the percentage in all cases, that is, we want 100 minus the percentage we
* calculate.
*/
#define DB_PCT(v, total) \
((int)((total) == 0 ? 0 : ((double)(v) * 100) / (total)))
#define DB_PCT_PG(v, total, pgsize) \
((int)((total) == 0 ? 0 : \
100 - ((double)(v) * 100) / (((double)total) * (pgsize))))
/*
* Statistics update shared memory and so are expensive -- don't update the
* values unless we're going to display the results.
*/
#undef STAT
#ifdef HAVE_STATISTICS
#define STAT(x) x
#else
#define STAT(x)
#endif
/*
* Structure used for callback message aggregation.
*
* Display values in XXX_stat_print calls.
*/
typedef struct __db_msgbuf {
char *buf; /* Heap allocated buffer. */
char *cur; /* Current end of message. */
size_t len; /* Allocated length of buffer. */
} DB_MSGBUF;
#define DB_MSGBUF_INIT(a) do { \
(a)->buf = (a)->cur = NULL; \
(a)->len = 0; \
} while (0)
#define DB_MSGBUF_FLUSH(env, a) do { \
if ((a)->buf != NULL) { \
if ((a)->cur != (a)->buf) \
__db_msg(env, "%s", (a)->buf); \
__os_free(env, (a)->buf); \
DB_MSGBUF_INIT(a); \
} \
} while (0)
#define STAT_FMT(msg, fmt, type, v) do { \
DB_MSGBUF __mb; \
DB_MSGBUF_INIT(&__mb); \
__db_msgadd(env, &__mb, fmt, (type)(v)); \
__db_msgadd(env, &__mb, "\t%s", msg); \
DB_MSGBUF_FLUSH(env, &__mb); \
} while (0)
#define STAT_HEX(msg, v) \
__db_msg(env, "%#lx\t%s", (u_long)(v), msg)
#define STAT_ISSET(msg, p) \
__db_msg(env, "%sSet\t%s", (p) == NULL ? "!" : " ", msg)
#define STAT_LONG(msg, v) \
__db_msg(env, "%ld\t%s", (long)(v), msg)
#define STAT_LSN(msg, lsnp) \
__db_msg(env, "%lu/%lu\t%s", \
(u_long)(lsnp)->file, (u_long)(lsnp)->offset, msg)
#define STAT_POINTER(msg, v) \
__db_msg(env, "%#lx\t%s", P_TO_ULONG(v), msg)
#define STAT_STRING(msg, p) do { \
const char *__p = p; /* p may be a function call. */ \
__db_msg(env, "%s\t%s", __p == NULL ? "!Set" : __p, msg); \
} while (0)
#define STAT_ULONG(msg, v) \
__db_msg(env, "%lu\t%s", (u_long)(v), msg)
/*
* There are quite a few places in Berkeley DB where we want to initialize
* a DBT from a string or other random pointer type, using a length typed
* to size_t in most cases. This macro avoids a lot of casting. The macro
* comes in two flavors because we often want to clear the DBT first.
*/
#define DB_SET_DBT(dbt, d, s) do { \
(dbt).data = (void *)(d); \
(dbt).size = (u_int32_t)(s); \
} while (0)
#define DB_INIT_DBT(dbt, d, s) do { \
memset(&(dbt), 0, sizeof(dbt)); \
DB_SET_DBT(dbt, d, s); \
} while (0)
/*******************************************************
* API return values
*******************************************************/
/*
* Return values that are OK for each different call. Most calls have a
* standard 'return of 0 is only OK value', but some, like db->get have
* DB_NOTFOUND as a return value, but it really isn't an error.
*/
#define DB_RETOK_STD(ret) ((ret) == 0)
#define DB_RETOK_DBCDEL(ret) ((ret) == 0 || (ret) == DB_KEYEMPTY || \
(ret) == DB_NOTFOUND)
#define DB_RETOK_DBCGET(ret) ((ret) == 0 || (ret) == DB_KEYEMPTY || \
(ret) == DB_NOTFOUND)
#define DB_RETOK_DBCPUT(ret) ((ret) == 0 || (ret) == DB_KEYEXIST || \
(ret) == DB_NOTFOUND)
#define DB_RETOK_DBDEL(ret) DB_RETOK_DBCDEL(ret)
#define DB_RETOK_DBGET(ret) DB_RETOK_DBCGET(ret)
#define DB_RETOK_DBPUT(ret) ((ret) == 0 || (ret) == DB_KEYEXIST)
#define DB_RETOK_EXISTS(ret) DB_RETOK_DBCGET(ret)
#define DB_RETOK_LGGET(ret) ((ret) == 0 || (ret) == DB_NOTFOUND)
#define DB_RETOK_MPGET(ret) ((ret) == 0 || (ret) == DB_PAGE_NOTFOUND)
#define DB_RETOK_REPPMSG(ret) ((ret) == 0 || \
(ret) == DB_REP_IGNORE || \
(ret) == DB_REP_ISPERM || \
(ret) == DB_REP_NEWMASTER || \
(ret) == DB_REP_NEWSITE || \
(ret) == DB_REP_NOTPERM)
/* Find a reasonable operation-not-supported error. */
#ifdef EOPNOTSUPP
#define DB_OPNOTSUP EOPNOTSUPP
#else
#ifdef ENOTSUP
#define DB_OPNOTSUP ENOTSUP
#else
#define DB_OPNOTSUP EINVAL
#endif
#endif
/*******************************************************
* Files.
*******************************************************/
/*
* We use 1024 as the maximum path length. It's too hard to figure out what
* the real path length is, as it was traditionally stored in <sys/param.h>,
* and that file isn't always available.
*/
#define DB_MAXPATHLEN 1024
#define PATH_DOT "." /* Current working directory. */
/* Path separator character(s). */
#define PATH_SEPARATOR "/\\"
/*******************************************************
* Environment.
*******************************************************/
/* Type passed to __db_appname(). */
typedef enum {
DB_APP_NONE=0, /* No type (region). */
DB_APP_DATA, /* Data file. */
DB_APP_LOG, /* Log file. */
DB_APP_TMP /* Temporary file. */
} APPNAME;
/*
* A set of macros to check if various functionality has been configured.
*
* ALIVE_ON The is_alive function is configured.
* CDB_LOCKING CDB product locking.
* CRYPTO_ON Security has been configured.
* LOCKING_ON Locking has been configured.
* LOGGING_ON Logging has been configured.
* MUTEX_ON Mutexes have been configured.
* MPOOL_ON Memory pool has been configured.
* REP_ON Replication has been configured.
* RPC_ON RPC has been configured.
* TXN_ON Transactions have been configured.
*
* REP_ON is more complex than most: if the BDB library was compiled without
* replication support, ENV->rep_handle will be NULL; if the BDB library has
* replication support, but it was not configured, the region reference will
* be NULL.
*/
#define ALIVE_ON(env) ((env)->dbenv->is_alive != NULL)
#define CDB_LOCKING(env) F_ISSET(env, ENV_CDB)
#define CRYPTO_ON(env) ((env)->crypto_handle != NULL)
#define LOCKING_ON(env) ((env)->lk_handle != NULL)
#define LOGGING_ON(env) ((env)->lg_handle != NULL)
#define MPOOL_ON(env) ((env)->mp_handle != NULL)
#define MUTEX_ON(env) ((env)->mutex_handle != NULL)
#define REP_ON(env) \
((env)->rep_handle != NULL && (env)->rep_handle->region != NULL)
#define RPC_ON(dbenv) ((dbenv)->cl_handle != NULL)
#define TXN_ON(env) ((env)->tx_handle != NULL)
/*
* STD_LOCKING Standard locking, that is, locking was configured and CDB
* was not. We do not do locking in off-page duplicate trees,
* so we check for that in the cursor first.
*/
#define STD_LOCKING(dbc) \
(!F_ISSET(dbc, DBC_OPD) && \
!CDB_LOCKING((dbc)->env) && LOCKING_ON((dbc)->env))
/*
* IS_RECOVERING: The system is running recovery.
*/
#define IS_RECOVERING(env) \
(LOGGING_ON(env) && F_ISSET((env)->lg_handle, DBLOG_RECOVER))
/* Initialization methods are often illegal before/after open is called. */
#define ENV_ILLEGAL_AFTER_OPEN(env, name) \
if (F_ISSET((env), ENV_OPEN_CALLED)) \
return (__db_mi_open(env, name, 1));
#define ENV_ILLEGAL_BEFORE_OPEN(env, name) \
if (!F_ISSET((env), ENV_OPEN_CALLED)) \
return (__db_mi_open(env, name, 0));
/* We're not actually user hostile, honest. */
#define ENV_REQUIRES_CONFIG(env, handle, i, flags) \
if (handle == NULL) \
return (__env_not_config(env, i, flags));
#define ENV_REQUIRES_CONFIG_XX(env, handle, i, flags) \
if ((env)->handle->region == NULL) \
return (__env_not_config(env, i, flags));
#define ENV_NOT_CONFIGURED(env, handle, i, flags) \
if (F_ISSET((env), ENV_OPEN_CALLED)) \
ENV_REQUIRES_CONFIG(env, handle, i, flags)
#define ENV_ENTER(env, ip) do { \
int __ret; \
PANIC_CHECK(env); \
if ((env)->thr_hashtab == NULL) \
ip = NULL; \
else { \
if ((__ret = \
__env_set_state(env, &(ip), THREAD_ACTIVE)) != 0) \
return (__ret); \
} \
} while (0)
#define ENV_GET_THREAD_INFO(env, ip) ENV_ENTER(env, ip)
#ifdef DIAGNOSTIC
#define ENV_LEAVE(env, ip) do { \
if ((ip) != NULL) { \
DB_ASSERT(env, (ip)->dbth_state == THREAD_ACTIVE); \
(ip)->dbth_state = THREAD_OUT; \
} \
} while (0)
#else
#define ENV_LEAVE(env, ip) do { \
if ((ip) != NULL) \
(ip)->dbth_state = THREAD_OUT; \
} while (0)
#endif
#ifdef DIAGNOSTIC
#define CHECK_THREAD(env) do { \
if ((env)->thr_hashtab != NULL) \
(void)__env_set_state(env, NULL, THREAD_VERIFY); \
} while (0)
#ifdef HAVE_STATISTICS
#define CHECK_MTX_THREAD(env, mtx) do { \
if (mtx->alloc_id != MTX_MUTEX_REGION && \
mtx->alloc_id != MTX_ENV_REGION && \
mtx->alloc_id != MTX_APPLICATION) \
CHECK_THREAD(env); \
} while (0)
#else
#define CHECK_MTX_THREAD(env, mtx)
#endif
#else
#define CHECK_THREAD(env)
#define CHECK_MTX_THREAD(env, mtx)
#endif
typedef enum {
THREAD_SLOT_NOT_IN_USE=0,
THREAD_OUT,
THREAD_ACTIVE,
THREAD_BLOCKED,
THREAD_BLOCKED_DEAD
#ifdef DIAGNOSTIC
, THREAD_VERIFY
#endif
} DB_THREAD_STATE;
typedef struct __pin_list {
roff_t b_ref; /* offset to buffer. */
int region; /* region containing buffer. */
} PIN_LIST;
#define PINMAX 4
struct __db_thread_info {
pid_t dbth_pid;
db_threadid_t dbth_tid;
DB_THREAD_STATE dbth_state;
SH_TAILQ_ENTRY dbth_links;
/*
* The following fields track which buffers this thread of
* control has pinned in the mpool buffer cache.
*/
u_int16_t dbth_pincount; /* Number of pins for this thread. */
u_int16_t dbth_pinmax; /* Number of slots allocated. */
roff_t dbth_pinlist; /* List of pins. */
PIN_LIST dbth_pinarray[PINMAX]; /* Initial array of slots. */
};
typedef struct __env_thread_info {
u_int32_t thr_count;
u_int32_t thr_max;
u_int32_t thr_nbucket;
roff_t thr_hashoff;
} THREAD_INFO;
#define DB_EVENT(env, e, einfo) do { \
DB_ENV *__dbenv = (env)->dbenv; \
if (__dbenv->db_event_func != NULL) \
__dbenv->db_event_func(__dbenv, e, einfo); \
} while (0)
typedef struct __flag_map {
u_int32_t inflag, outflag;
} FLAG_MAP;
/*
* Internal database environment structure.
*
* This is the private database environment handle. The public environment
* handle is the DB_ENV structure. The library owns this structure, the user
* owns the DB_ENV structure. The reason there are two structures is because
* the user's configuration outlives any particular DB_ENV->open call, and
* separate structures allows us to easily discard internal information without
* discarding the user's configuration.
*/
struct __env {
DB_ENV *dbenv; /* Linked DB_ENV structure */
/*
* The ENV structure can be used concurrently, so field access is
* protected.
*/
db_mutex_t mtx_env; /* ENV structure mutex */
/*
* Some fields are included in the ENV structure rather than in the
* DB_ENV structure because they are only set as arguments to the
* DB_ENV->open method. In other words, because of the historic API,
* not for any rational reason.
*
* Arguments to DB_ENV->open.
*/
char *db_home; /* Database home */
u_int32_t open_flags; /* Flags */
int db_mode; /* Default open permissions */
pid_t pid_cache; /* Cached process ID */
DB_FH *lockfhp; /* fcntl(2) locking file handle */
DB_LOCKER *env_lref; /* Locker in non-threaded handles */
DB_DISTAB recover_dtab; /* Dispatch table for recover funcs */
int dir_mode; /* Intermediate directory perms. */
/* Thread tracking */
u_int32_t thr_nbucket; /* Number of hash buckets */
DB_HASHTAB *thr_hashtab; /* Hash table of DB_THREAD_INFO */
/* Mutex allocation */
struct {
int alloc_id; /* Allocation ID argument */
u_int32_t flags; /* Flags argument */
} *mutex_iq; /* Initial mutexes queue */
u_int mutex_iq_next; /* Count of initial mutexes */
u_int mutex_iq_max; /* Maximum initial mutexes */
/*
* List of open DB handles for this ENV, used for cursor
* adjustment. Must be protected for multi-threaded support.
*/
db_mutex_t mtx_dblist;
int db_ref; /* DB handle reference count */
TAILQ_HEAD(__dblist, __db) dblist;
/*
* XA support.
*/
int xa_rmid; /* XA Resource Manager ID */
TAILQ_ENTRY(__env) links; /* XA environments */
TAILQ_HEAD(__xa_txn, __db_txn) xa_txn; /* XA active transactions */
/*
* List of open file handles for this ENV. Must be protected
* for multi-threaded support.
*/
TAILQ_HEAD(__fdlist, __fh_t) fdlist;
db_mutex_t mtx_mt; /* Mersenne Twister mutex */
int mti; /* Mersenne Twister index */
u_long *mt; /* Mersenne Twister state vector */
DB_CIPHER *crypto_handle; /* Crypto handle */
DB_LOCKTAB *lk_handle; /* Lock handle */
DB_LOG *lg_handle; /* Log handle */
DB_MPOOL *mp_handle; /* Mpool handle */
DB_MUTEXMGR *mutex_handle; /* Mutex handle */
DB_REP *rep_handle; /* Replication handle */
DB_TXNMGR *tx_handle; /* Txn handle */
/* Application callback to copy data to/from a custom data source */
#define DB_USERCOPY_GETDATA 0x0001
#define DB_USERCOPY_SETDATA 0x0002
int (*dbt_usercopy)
__P((DBT *, u_int32_t, void *, u_int32_t, u_int32_t));
REGINFO *reginfo; /* REGINFO structure reference */
#define DB_TEST_ELECTINIT 1 /* after __rep_elect_init */
#define DB_TEST_ELECTVOTE1 2 /* after sending VOTE1 */
#define DB_TEST_POSTDESTROY 3 /* after destroy op */
#define DB_TEST_POSTLOG 4 /* after logging all pages */
#define DB_TEST_POSTLOGMETA 5 /* after logging meta in btree */
#define DB_TEST_POSTOPEN 6 /* after __os_open */
#define DB_TEST_POSTSYNC 7 /* after syncing the log */
#define DB_TEST_PREDESTROY 8 /* before destroy op */
#define DB_TEST_PREOPEN 9 /* before __os_open */
#define DB_TEST_SUBDB_LOCKS 10 /* subdb locking tests */
int test_abort; /* Abort value for testing */
int test_check; /* Checkpoint value for testing */
int test_copy; /* Copy value for testing */
#define ENV_CDB 0x00000001 /* DB_INIT_CDB */
#define ENV_DBLOCAL 0x00000002 /* Environment for a private DB */
#define ENV_LITTLEENDIAN 0x00000004 /* Little endian system. */
#define ENV_LOCKDOWN 0x00000008 /* DB_LOCKDOWN set */
#define ENV_NO_OUTPUT_SET 0x00000010 /* No output channel set */
#define ENV_OPEN_CALLED 0x00000020 /* DB_ENV->open called */
#define ENV_PRIVATE 0x00000040 /* DB_PRIVATE set */
#define ENV_RECOVER_FATAL 0x00000080 /* Doing fatal recovery in env */
#define ENV_REF_COUNTED 0x00000100 /* Region references this handle */
#define ENV_SYSTEM_MEM 0x00000200 /* DB_SYSTEM_MEM set */
#define ENV_THREAD 0x00000400 /* DB_THREAD set */
u_int32_t flags;
};
/*******************************************************
* Database Access Methods.
*******************************************************/
/*
* DB_IS_THREADED --
* The database handle is free-threaded (was opened with DB_THREAD).
*/
#define DB_IS_THREADED(dbp) \
((dbp)->mutex != MUTEX_INVALID)
/* Initialization methods are often illegal before/after open is called. */
#define DB_ILLEGAL_AFTER_OPEN(dbp, name) \
if (F_ISSET((dbp), DB_AM_OPEN_CALLED)) \
return (__db_mi_open((dbp)->env, name, 1));
#define DB_ILLEGAL_BEFORE_OPEN(dbp, name) \
if (!F_ISSET((dbp), DB_AM_OPEN_CALLED)) \
return (__db_mi_open((dbp)->env, name, 0));
/* Some initialization methods are illegal if environment isn't local. */
#define DB_ILLEGAL_IN_ENV(dbp, name) \
if (!F_ISSET((dbp)->env, ENV_DBLOCAL)) \
return (__db_mi_env((dbp)->env, name));
#define DB_ILLEGAL_METHOD(dbp, flags) { \
int __ret; \
if ((__ret = __dbh_am_chk(dbp, flags)) != 0) \
return (__ret); \
}
/*
* Common DBC->internal fields. Each access method adds additional fields
* to this list, but the initial fields are common.
*/
#define __DBC_INTERNAL \
DBC *opd; /* Off-page duplicate cursor. */\
\
void *page; /* Referenced page. */ \
db_pgno_t root; /* Tree root. */ \
db_pgno_t pgno; /* Referenced page number. */ \
db_indx_t indx; /* Referenced key item index. */\
\
DB_LOCK lock; /* Cursor lock. */ \
db_lockmode_t lock_mode; /* Lock mode. */
struct __dbc_internal {
__DBC_INTERNAL
};
/* Actions that __db_master_update can take. */
typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
/*
* Access-method-common macro for determining whether a cursor
* has been initialized.
*/
#define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID)
/* Free the callback-allocated buffer, if necessary, hanging off of a DBT. */
#define FREE_IF_NEEDED(env, dbt) \
if (F_ISSET((dbt), DB_DBT_APPMALLOC)) { \
__os_ufree((env), (dbt)->data); \
F_CLR((dbt), DB_DBT_APPMALLOC); \
}
/*
* Use memory belonging to object "owner" to return the results of
* any no-DBT-flag get ops on cursor "dbc".
*/
#define SET_RET_MEM(dbc, owner) \
do { \
(dbc)->rskey = &(owner)->my_rskey; \
(dbc)->rkey = &(owner)->my_rkey; \
(dbc)->rdata = &(owner)->my_rdata; \
} while (0)
/* Use the return-data memory src is currently set to use in dest as well. */
#define COPY_RET_MEM(src, dest) \
do { \
(dest)->rskey = (src)->rskey; \
(dest)->rkey = (src)->rkey; \
(dest)->rdata = (src)->rdata; \
} while (0)
/* Reset the returned-memory pointers to their defaults. */
#define RESET_RET_MEM(dbc) \
do { \
(dbc)->rskey = &(dbc)->my_rskey; \
(dbc)->rkey = &(dbc)->my_rkey; \
(dbc)->rdata = &(dbc)->my_rdata; \
} while (0)
/*******************************************************
* Mpool.
*******************************************************/
/*
* File types for DB access methods. Negative numbers are reserved to DB.
*/
#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */
#define DB_FTYPE_NOTSET 0 /* Don't call... */
#define DB_LSN_OFF_NOTSET -1 /* Not yet set. */
#define DB_CLEARLEN_NOTSET UINT32_MAX /* Not yet set. */
/* Structure used as the DB pgin/pgout pgcookie. */
typedef struct __dbpginfo {
size_t db_pagesize; /* Underlying page size. */
u_int32_t flags; /* Some DB_AM flags needed. */
DBTYPE type; /* DB type */
} DB_PGINFO;
/*******************************************************
* Log.
*******************************************************/
/* Initialize an LSN to 'zero'. */
#define ZERO_LSN(LSN) do { \
(LSN).file = 0; \
(LSN).offset = 0; \
} while (0)
#define IS_ZERO_LSN(LSN) ((LSN).file == 0 && (LSN).offset == 0)
#define IS_INIT_LSN(LSN) ((LSN).file == 1 && (LSN).offset == 0)
#define INIT_LSN(LSN) do { \
(LSN).file = 1; \
(LSN).offset = 0; \
} while (0)
#define MAX_LSN(LSN) do { \
(LSN).file = UINT32_MAX; \
(LSN).offset = UINT32_MAX; \
} while (0)
#define IS_MAX_LSN(LSN) \
((LSN).file == UINT32_MAX && (LSN).offset == UINT32_MAX)
/* If logging is turned off, smash the lsn. */
#define LSN_NOT_LOGGED(LSN) do { \
(LSN).file = 0; \
(LSN).offset = 1; \
} while (0)
#define IS_NOT_LOGGED_LSN(LSN) \
((LSN).file == 0 && (LSN).offset == 1)
/*
* LOG_COMPARE -- compare two LSNs.
*/
#define LOG_COMPARE(lsn0, lsn1) \
((lsn0)->file != (lsn1)->file ? \
((lsn0)->file < (lsn1)->file ? -1 : 1) : \
((lsn0)->offset != (lsn1)->offset ? \
((lsn0)->offset < (lsn1)->offset ? -1 : 1) : 0))
/*******************************************************
* Txn.
*******************************************************/
#define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT))
#define NOWAIT_FLAG(txn) \
((txn) != NULL && F_ISSET((txn), TXN_NOWAIT) ? DB_LOCK_NOWAIT : 0)
#define IS_REAL_TXN(txn) \
((txn) != NULL && !F_ISSET(txn, TXN_CDSGROUP))
#define IS_SUBTRANSACTION(txn) \
((txn) != NULL && (txn)->parent != NULL)
/*******************************************************
* Crypto.
*******************************************************/
#define DB_IV_BYTES 16 /* Bytes per IV */
#define DB_MAC_KEY 20 /* Bytes per MAC checksum */
/*******************************************************
* Secondaries over RPC.
*******************************************************/
#ifdef CONFIG_TEST
/*
* These are flags passed to DB->associate calls by the Tcl API if running
* over RPC. The RPC server will mask out these flags before making the real
* DB->associate call.
*
* These flags must coexist with the valid flags to DB->associate (currently
* DB_AUTO_COMMIT and DB_CREATE). DB_AUTO_COMMIT is in the group of
* high-order shared flags (0xff000000), and DB_CREATE is in the low-order
* group (0x00000fff), so we pick a range in between.
*/
#define DB_RPC2ND_MASK 0x00f00000 /* Reserved bits. */
#define DB_RPC2ND_REVERSEDATA 0x00100000 /* callback_n(0) _s_reversedata. */
#define DB_RPC2ND_NOOP 0x00200000 /* callback_n(1) _s_noop */
#define DB_RPC2ND_CONCATKEYDATA 0x00300000 /* callback_n(2) _s_concatkeydata */
#define DB_RPC2ND_CONCATDATAKEY 0x00400000 /* callback_n(3) _s_concatdatakey */
#define DB_RPC2ND_REVERSECONCAT 0x00500000 /* callback_n(4) _s_reverseconcat */
#define DB_RPC2ND_TRUNCDATA 0x00600000 /* callback_n(5) _s_truncdata */
#define DB_RPC2ND_CONSTANT 0x00700000 /* callback_n(6) _s_constant */
#define DB_RPC2ND_GETZIP 0x00800000 /* sj_getzip */
#define DB_RPC2ND_GETNAME 0x00900000 /* sj_getname */
#endif
#if defined(__cplusplus)
}
#endif
/*******************************************************
* Remaining general DB includes.
*******************************************************/
#include "dbinc/globals.h"
#include "dbinc/clock.h"
#include "dbinc/debug.h"
#include "dbinc/region.h"
#include "dbinc_auto/env_ext.h"
#include "dbinc/mutex.h"
#ifdef HAVE_REPLICATION_THREADS
#include "dbinc/repmgr.h"
#endif
#include "dbinc/rep.h"
#include "dbinc/os.h"
#include "dbinc_auto/clib_ext.h"
#include "dbinc_auto/common_ext.h"
/*******************************************************
* Remaining Log.
* These need to be defined after the general includes
* because they need rep.h from above.
*******************************************************/
/*
* Test if the environment is currently logging changes. If we're in recovery
* or we're a replication client, we don't need to log changes because they're
* already in the log, even though we have a fully functional log system.
*/
#define DBENV_LOGGING(env) \
(LOGGING_ON(env) && !IS_REP_CLIENT(env) && (!IS_RECOVERING(env)))
/*
* Test if we need to log a change. By default, we don't log operations without
* associated transactions, unless DIAGNOSTIC, DEBUG_ROP or DEBUG_WOP are on.
* This is because we want to get log records for read/write operations, and, if
* we are trying to debug something, more information is always better.
*
* The DBC_RECOVER flag is set when we're in abort, as well as during recovery;
* thus DBC_LOGGING may be false for a particular dbc even when DBENV_LOGGING
* is true.
*
* We explicitly use LOGGING_ON/IS_REP_CLIENT here because we don't want to pull
* in the log headers, which IS_RECOVERING (and thus DBENV_LOGGING) rely on, and
* because DBC_RECOVER should be set anytime IS_RECOVERING would be true.
*
* If we're not in recovery (master - doing an abort or a client applying
* a txn), then a client's only path through here is on an internal
* operation, and a master's only path through here is a transactional
* operation. Detect if either is not the case.
*/
#if defined(DIAGNOSTIC) || defined(DEBUG_ROP) || defined(DEBUG_WOP)
#define DBC_LOGGING(dbc) __dbc_logging(dbc)
#else
#define DBC_LOGGING(dbc) \
((dbc)->txn != NULL && LOGGING_ON((dbc)->env) && \
!F_ISSET((dbc), DBC_RECOVER) && !IS_REP_CLIENT((dbc)->env))
#endif
#endif /* !_DB_INT_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_load20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_load20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_load20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_load.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_load.c_dependencies
<END>
<BEGIN> FILE_db_load.c_objects
db_load.o
<END>
<BEGIN> FILE_db_load.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_load.c
<END>
<BEGIN> userComments
db_load
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_load22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_load22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_load22.out
<END>
<BEGIN> BUILD_RULE_db_load22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_load.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_load.c_dependencies
<END>
<BEGIN> FILE_db_load.c_objects
db_load.o
<END>
<BEGIN> FILE_db_load.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_load.c
<END>
<BEGIN> userComments
db_load
<END>

View File

@@ -0,0 +1,594 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_printlog.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#include "dbinc/db_page.h"
#include "dbinc/btree.h"
#include "dbinc/fop.h"
#include "dbinc/hash.h"
#include "dbinc/log.h"
#include "dbinc/qam.h"
#include "dbinc/txn.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
int db_printlog_print_app_record __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
int db_printlog_env_init_print __P((ENV *, u_int32_t, DB_DISTAB *));
int db_printlog_env_init_print_42 __P((ENV *, DB_DISTAB *));
int db_printlog_env_init_print_43 __P((ENV *, DB_DISTAB *));
int db_printlog_env_init_print_45 __P((ENV *, DB_DISTAB *));
int db_printlog_lsn_arg __P((char *, DB_LSN *));
int db_printlog_main __P((int, char *[]));
int db_printlog_open_rep_db __P((DB_ENV *, DB **, DBC **));
int db_printlog_usage __P((void));
int db_printlog_version_check __P((void));
const char *progname;
int
db_printlog(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_printlog", args, &argc, &argv);
return (db_printlog_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_printlog_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
DB *dbp;
DBC *dbc;
DBT data, keydbt;
DB_DISTAB dtab;
DB_ENV *dbenv;
DB_LOGC *logc;
DB_LSN key, start, stop, verslsn;
ENV *env;
u_int32_t logcflag, newversion, version;
int ch, cmp, exitval, nflag, rflag, ret, repflag;
char *home, *passwd;
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_printlog_version_check()) != 0)
return (ret);
dbp = NULL;
dbc = NULL;
dbenv = NULL;
logc = NULL;
ZERO_LSN(start);
ZERO_LSN(stop);
exitval = nflag = rflag = repflag = 0;
home = passwd = NULL;
memset(&dtab, 0, sizeof(dtab));
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "b:e:h:NP:rRV")) != EOF)
switch (ch) {
case 'b':
/* Don't use getsubopt(3), not all systems have it. */
if (db_printlog_lsn_arg(optarg, &start))
return (db_printlog_usage());
break;
case 'e':
/* Don't use getsubopt(3), not all systems have it. */
if (db_printlog_lsn_arg(optarg, &stop))
return (db_printlog_usage());
break;
case 'h':
home = optarg;
break;
case 'N':
nflag = 1;
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 'r':
rflag = 1;
break;
case 'R': /* Undocumented */
repflag = 1;
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case '?':
default:
return (db_printlog_usage());
}
argc -= optind;
argv += optind;
if (argc > 0)
return (db_printlog_usage());
/* Handle possible interruptions. */
__db_util_siginit();
/*
* Create an environment object and initialize it for error
* reporting.
*/
if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
goto shutdown;
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (nflag) {
if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) {
dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING");
goto shutdown;
}
if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) {
dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC");
goto shutdown;
}
}
if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto shutdown;
}
/*
* Set up an app-specific dispatch function so that we can gracefully
* handle app-specific log records.
*/
if ((ret = dbenv->set_app_dispatch(
dbenv, db_printlog_print_app_record)) != 0) {
dbenv->err(dbenv, ret, "app_dispatch");
goto shutdown;
}
/*
* An environment is required, but as all we're doing is reading log
* files, we create one if it doesn't already exist. If we create
* it, create it private so it automatically goes away when we're done.
* If we are reading the replication database, do not open the env
* with logging, because we don't want to log the opens.
*/
if (repflag) {
if ((ret = dbenv->open(dbenv, home,
DB_INIT_MPOOL | DB_USE_ENVIRON, 0)) != 0 &&
(ret == DB_VERSION_MISMATCH ||
(ret = dbenv->open(dbenv, home,
DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0))
!= 0)) {
dbenv->err(dbenv, ret, "DB_ENV->open");
goto shutdown;
}
} else if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) != 0 &&
(ret == DB_VERSION_MISMATCH ||
(ret = dbenv->open(dbenv, home,
DB_CREATE | DB_INIT_LOG | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0)) {
dbenv->err(dbenv, ret, "DB_ENV->open");
goto shutdown;
}
env = dbenv->env;
/* Allocate a log cursor. */
if (repflag) {
if ((ret = db_printlog_open_rep_db(dbenv, &dbp, &dbc)) != 0)
goto shutdown;
} else if ((ret = dbenv->log_cursor(dbenv, &logc, 0)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->log_cursor");
goto shutdown;
}
if (IS_ZERO_LSN(start)) {
memset(&keydbt, 0, sizeof(keydbt));
logcflag = rflag ? DB_PREV : DB_NEXT;
} else {
key = start;
logcflag = DB_SET;
}
memset(&data, 0, sizeof(data));
/*
* If we're using the repflag, we're immediately initializing
* the print table. Use the current version. If we're printing
* the log then initialize version to 0 so that we get the
* correct version right away.
*/
if (repflag)
version = DB_LOGVERSION;
else
version = 0;
ZERO_LSN(verslsn);
/* Initialize print callbacks if repflag. */
if (repflag &&
(ret = db_printlog_env_init_print(env, version, &dtab)) != 0) {
dbenv->err(dbenv, ret, "callback: initialization");
goto shutdown;
}
for (; !__db_util_interrupted(); logcflag = rflag ? DB_PREV : DB_NEXT) {
if (repflag) {
ret = dbc->get(dbc, &keydbt, &data, logcflag);
if (ret == 0)
key = ((__rep_control_args *)keydbt.data)->lsn;
} else
ret = logc->get(logc, &key, &data, logcflag);
if (ret != 0) {
if (ret == DB_NOTFOUND)
break;
dbenv->err(dbenv,
ret, repflag ? "DBC->get" : "DB_LOGC->get");
goto shutdown;
}
/*
* We may have reached the end of the range we're displaying.
*/
if (!IS_ZERO_LSN(stop)) {
cmp = LOG_COMPARE(&key, &stop);
if ((rflag && cmp < 0) || (!rflag && cmp > 0))
break;
}
if (!repflag && key.file != verslsn.file) {
/*
* If our log file changed, we need to see if the
* version of the log file changed as well.
* If it changed, reset the print table.
*/
if ((ret = logc->version(logc, &newversion, 0)) != 0) {
dbenv->err(dbenv, ret, "DB_LOGC->version");
goto shutdown;
}
if (version != newversion) {
version = newversion;
if ((ret = db_printlog_env_init_print(env, version,
&dtab)) != 0) {
dbenv->err(dbenv, ret,
"callback: initialization");
goto shutdown;
}
}
}
ret = __db_dispatch(dbenv->env,
&dtab, &data, &key, DB_TXN_PRINT, NULL);
/*
* XXX
* Just in case the underlying routines don't flush.
*/
(void)fflush(stdout);
if (ret != 0) {
dbenv->err(dbenv, ret, "tx: dispatch");
goto shutdown;
}
}
if (0) {
shutdown: exitval = 1;
}
if (logc != NULL && (ret = logc->close(logc, 0)) != 0)
exitval = 1;
if (dbc != NULL && (ret = dbc->close(dbc)) != 0)
exitval = 1;
if (dbp != NULL && (ret = dbp->close(dbp, 0)) != 0)
exitval = 1;
if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (passwd != NULL)
free(passwd);
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
/*
* env_init_print --
*/
int
db_printlog_env_init_print(env, version, dtabp)
ENV *env;
u_int32_t version;
DB_DISTAB *dtabp;
{
int ret;
/*
* We need to prime the print table with the current print
* functions. Then we overwrite only specific entries based on
* each previous version we support.
*/
if ((ret = db_printlog_env_init_print_45(env, dtabp)) != 0)
return (ret);
switch (version) {
/*
* There are no log record/recovery differences between
* 4.4 and 4.5. The log version changed due to checksum.
* There are no log recovery differences between
* 4.5 and 4.6. The name of the rep_gen in txn_checkpoint
* changed (to spare, since we don't use it anymore).
*/
case DB_LOGVERSION_47:
case DB_LOGVERSION_46:
case DB_LOGVERSION_45:
case DB_LOGVERSION_44:
ret = 0;
break;
case DB_LOGVERSION_43:
ret = db_printlog_env_init_print_43(env, dtabp);
break;
case DB_LOGVERSION_42:
ret = db_printlog_env_init_print_42(env, dtabp);
break;
default:
env->dbenv->errx(env->dbenv,
"Unknown version %lu", (u_long)version);
ret = EINVAL;
break;
}
return (ret);
}
int
db_printlog_env_init_print_42(env, dtabp)
ENV *env;
DB_DISTAB *dtabp;
{
int ret;
if ((ret = __db_add_recovery_int(env, dtabp,
__db_relink_42_print, DB___db_relink_42)) != 0)
goto err;
if ((ret = __db_add_recovery_int(env, dtabp,
__db_pg_alloc_42_print, DB___db_pg_alloc_42)) != 0)
goto err;
if ((ret = __db_add_recovery_int(env, dtabp,
__db_pg_free_42_print, DB___db_pg_free_42)) != 0)
goto err;
if ((ret = __db_add_recovery_int(env, dtabp,
__db_pg_freedata_42_print, DB___db_pg_freedata_42)) != 0)
goto err;
#if HAVE_HASH
if ((ret = __db_add_recovery_int(env, dtabp,
__ham_metagroup_42_print, DB___ham_metagroup_42)) != 0)
goto err;
if ((ret = __db_add_recovery_int(env, dtabp,
__ham_groupalloc_42_print, DB___ham_groupalloc_42)) != 0)
goto err;
#endif
if ((ret = __db_add_recovery_int(env, dtabp,
__txn_ckp_42_print, DB___txn_ckp_42)) != 0)
goto err;
if ((ret = __db_add_recovery_int(env, dtabp,
__txn_regop_42_print, DB___txn_regop_42)) != 0)
goto err;
err:
return (ret);
}
int
db_printlog_env_init_print_43(env, dtabp)
ENV *env;
DB_DISTAB *dtabp;
{
int ret;
if ((ret = __db_add_recovery_int(env, dtabp,
__bam_relink_43_print, DB___bam_relink_43)) != 0)
goto err;
/*
* We want to use the 4.2-based txn_regop record.
*/
if ((ret = __db_add_recovery_int(env, dtabp,
__txn_regop_42_print, DB___txn_regop_42)) != 0)
goto err;
err:
return (ret);
}
/*
* env_init_print_45 --
*
*/
int
db_printlog_env_init_print_45(env, dtabp)
ENV *env;
DB_DISTAB *dtabp;
{
int ret;
if ((ret = __bam_init_print(env, dtabp)) != 0)
goto err;
if ((ret = __crdel_init_print(env, dtabp)) != 0)
goto err;
if ((ret = __db_init_print(env, dtabp)) != 0)
goto err;
if ((ret = __dbreg_init_print(env, dtabp)) != 0)
goto err;
if ((ret = __fop_init_print(env, dtabp)) != 0)
goto err;
#ifdef HAVE_HASH
if ((ret = __ham_init_print(env, dtabp)) != 0)
goto err;
#endif
#ifdef HAVE_QUEUE
if ((ret = __qam_init_print(env, dtabp)) != 0)
goto err;
#endif
if ((ret = __txn_init_print(env, dtabp)) != 0)
goto err;
err:
return (ret);
}
int
db_printlog_usage()
{
fprintf(stderr, "usage: %s %s\n", progname,
"[-NrV] [-b file/offset] [-e file/offset] [-h home] [-P password]");
return (EXIT_FAILURE);
}
int
db_printlog_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}
/* Print an unknown, application-specific log record as best we can. */
int
db_printlog_print_app_record(dbenv, dbt, lsnp, op)
DB_ENV *dbenv;
DBT *dbt;
DB_LSN *lsnp;
db_recops op;
{
u_int32_t i, rectype;
int ch;
DB_ASSERT(dbenv->env, op == DB_TXN_PRINT);
COMPQUIET(dbenv, NULL);
COMPQUIET(op, DB_TXN_PRINT);
/*
* Fetch the rectype, which always must be at the beginning of the
* record (if dispatching is to work at all).
*/
memcpy(&rectype, dbt->data, sizeof(rectype));
/*
* Applications may wish to customize the output here based on the
* rectype. We just print the entire log record in the generic
* mixed-hex-and-printable format we use for binary data.
*/
printf("[%lu][%lu]application specific record: rec: %lu\n",
(u_long)lsnp->file, (u_long)lsnp->offset, (u_long)rectype);
printf("\tdata: ");
for (i = 0; i < dbt->size; i++) {
ch = ((u_int8_t *)dbt->data)[i];
printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
}
printf("\n\n");
return (0);
}
int
db_printlog_open_rep_db(dbenv, dbpp, dbcp)
DB_ENV *dbenv;
DB **dbpp;
DBC **dbcp;
{
int ret;
DB *dbp;
*dbpp = NULL;
*dbcp = NULL;
if ((ret = db_create(dbpp, dbenv, 0)) != 0) {
dbenv->err(dbenv, ret, "db_create");
return (ret);
}
dbp = *dbpp;
if ((ret =
dbp->open(dbp, NULL, REPDBNAME, NULL, DB_BTREE, 0, 0)) != 0) {
dbenv->err(dbenv, ret, "DB->open");
goto err;
}
if ((ret = dbp->cursor(dbp, NULL, dbcp, 0)) != 0) {
dbenv->err(dbenv, ret, "DB->cursor");
goto err;
}
return (0);
err: if (*dbpp != NULL)
(void)(*dbpp)->close(*dbpp, 0);
return (ret);
}
/*
* lsn_arg --
* Parse a LSN argument.
*/
int
db_printlog_lsn_arg(arg, lsnp)
char *arg;
DB_LSN *lsnp;
{
u_long uval;
char *p;
/*
* Expected format is: lsn.file/lsn.offset.
*/
if ((p = strchr(arg, '/')) == NULL)
return (1);
*p = '\0';
if (__db_getulong(NULL, progname, arg, 0, UINT32_MAX, &uval))
return (1);
lsnp->file = uval;
if (__db_getulong(NULL, progname, p + 1, 0, UINT32_MAX, &uval))
return (1);
lsnp->offset = uval;
return (0);
}

View File

@@ -0,0 +1,286 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_printlog20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_printlog20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_printlog20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_objects
btree_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_objects
crdel_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_objects
db_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_db_printlog.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_printlog.c_dependencies
<END>
<BEGIN> FILE_db_printlog.c_objects
db_printlog.o
<END>
<BEGIN> FILE_db_printlog.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_objects
dbreg_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_objects
fileops_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_objects
hash_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_objects
qam_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_objects
txn_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../../btree/btree_autop.c \
$(PRJ_DIR)/../../db/crdel_autop.c \
$(PRJ_DIR)/../../db/db_autop.c \
$(PRJ_DIR)/db_printlog.c \
$(PRJ_DIR)/../../dbreg/dbreg_autop.c \
$(PRJ_DIR)/../../fileops/fileops_autop.c \
$(PRJ_DIR)/../../hash/hash_autop.c \
$(PRJ_DIR)/../../qam/qam_autop.c \
$(PRJ_DIR)/../../txn/txn_autop.c
<END>
<BEGIN> userComments
db_printlog
<END>

View File

@@ -0,0 +1,320 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_printlog22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_printlog22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_printlog22.out
<END>
<BEGIN> BUILD_RULE_db_printlog22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_objects
btree_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../btree/btree_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_objects
crdel_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/crdel_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_objects
db_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../db/db_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_db_printlog.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_printlog.c_dependencies
<END>
<BEGIN> FILE_db_printlog.c_objects
db_printlog.o
<END>
<BEGIN> FILE_db_printlog.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_objects
dbreg_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../dbreg/dbreg_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_objects
fileops_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../fileops/fileops_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_objects
hash_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../hash/hash_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_objects
qam_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../qam/qam_autop.c_tool
C/C++ compiler
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependDone
FALSE
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_dependencies
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_objects
txn_autop.o
<END>
<BEGIN> FILE_$(PRJ_DIR)/../../txn/txn_autop.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/../../btree/btree_autop.c \
$(PRJ_DIR)/../../db/crdel_autop.c \
$(PRJ_DIR)/../../db/db_autop.c \
$(PRJ_DIR)/db_printlog.c \
$(PRJ_DIR)/../../dbreg/dbreg_autop.c \
$(PRJ_DIR)/../../fileops/fileops_autop.c \
$(PRJ_DIR)/../../hash/hash_autop.c \
$(PRJ_DIR)/../../qam/qam_autop.c \
$(PRJ_DIR)/../../txn/txn_autop.c
<END>
<BEGIN> userComments
db_printlog
<END>

View File

@@ -0,0 +1,328 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_recover.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
void db_recover_feedback __P((DB_ENV *, int, int));
int db_recover_main __P((int, char *[]));
int db_recover_read_timestamp __P((char *, time_t *));
int db_recover_usage __P((void));
int db_recover_version_check __P((void));
const char *progname;
int newline_needed;
int
db_recover(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_recover", args, &argc, &argv);
return (db_recover_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_recover_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
DB_ENV *dbenv;
time_t timestamp;
u_int32_t flags;
int ch, exitval, fatal_recover, ret, retain_env, set_feedback, verbose;
char *home, *passwd;
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_recover_version_check()) != 0)
return (ret);
home = passwd = NULL;
timestamp = 0;
exitval = fatal_recover = retain_env = set_feedback = verbose = 0;
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "cefh:P:t:Vv")) != EOF)
switch (ch) {
case 'c':
fatal_recover = 1;
break;
case 'e':
retain_env = 1;
break;
case 'f':
set_feedback = 1;
break;
case 'h':
home = optarg;
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 't':
if ((ret = db_recover_read_timestamp(optarg, &timestamp)) != 0)
return (ret);
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case 'v':
verbose = 1;
break;
case '?':
default:
return (db_recover_usage());
}
argc -= optind;
argv += optind;
if (argc != 0)
return (db_recover_usage());
/* Handle possible interruptions. */
__db_util_siginit();
/*
* Create an environment object and initialize it for error
* reporting.
*/
if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
return (EXIT_FAILURE);
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (set_feedback)
(void)dbenv->set_feedback(dbenv, db_recover_feedback);
if (verbose)
(void)dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, 1);
if (timestamp &&
(ret = dbenv->set_tx_timestamp(dbenv, &timestamp)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->set_timestamp");
goto shutdown;
}
if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto shutdown;
}
/*
* Initialize the environment -- we don't actually do anything
* else, that all that's needed to run recovery.
*
* Note that unless the caller specified the -e option, we use a
* private environment, as we're about to create a region, and we
* don't want to to leave it around. If we leave the region around,
* the application that should create it will simply join it instead,
* and will then be running with incorrectly sized (and probably
* terribly small) caches. Applications that use -e should almost
* certainly use DB_CONFIG files in the directory.
*/
flags = 0;
LF_SET(DB_CREATE | DB_INIT_LOG |
DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON);
LF_SET(fatal_recover ? DB_RECOVER_FATAL : DB_RECOVER);
LF_SET(retain_env ? DB_INIT_LOCK : DB_PRIVATE);
if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->open");
goto shutdown;
}
if (0) {
shutdown: exitval = 1;
}
/* Flush to the next line of the output device. */
if (newline_needed)
printf("\n");
/* Clean up the environment. */
if ((ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (passwd != NULL)
free(passwd);
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
/*
* db_recover_feedback --
* Provide feedback on recovery progress.
*/
void
db_recover_feedback(dbenv, opcode, percent)
DB_ENV *dbenv;
int opcode;
int percent;
{
COMPQUIET(dbenv, NULL);
if (opcode == DB_RECOVER) {
printf("\rrecovery %d%% complete", percent);
(void)fflush(stdout);
newline_needed = 1;
}
}
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
/*
* read_timestamp --
* Convert a time argument to Epoch seconds.
*
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
int
db_recover_read_timestamp(arg, timep)
char *arg;
time_t *timep;
{
struct tm *t;
time_t now;
int yearset;
char *p;
/* Start with the current time. */
(void)time(&now);
if ((t = localtime(&now)) == NULL) {
fprintf(stderr,
"%s: localtime: %s\n", progname, strerror(errno));
return (EXIT_FAILURE);
}
/* [[CC]YY]MMDDhhmm[.SS] */
if ((p = strchr(arg, '.')) == NULL)
t->tm_sec = 0; /* Seconds defaults to 0. */
else {
if (strlen(p + 1) != 2)
goto terr;
*p++ = '\0';
t->tm_sec = ATOI2(p);
}
yearset = 0;
switch (strlen(arg)) {
case 12: /* CCYYMMDDhhmm */
t->tm_year = ATOI2(arg);
t->tm_year *= 100;
yearset = 1;
/* FALLTHROUGH */
case 10: /* YYMMDDhhmm */
if (yearset) {
yearset = ATOI2(arg);
t->tm_year += yearset;
} else {
yearset = ATOI2(arg);
if (yearset < 69)
t->tm_year = yearset + 2000;
else
t->tm_year = yearset + 1900;
}
t->tm_year -= 1900; /* Convert to UNIX time. */
/* FALLTHROUGH */
case 8: /* MMDDhhmm */
t->tm_mon = ATOI2(arg);
--t->tm_mon; /* Convert from 01-12 to 00-11 */
t->tm_mday = ATOI2(arg);
t->tm_hour = ATOI2(arg);
t->tm_min = ATOI2(arg);
break;
default:
goto terr;
}
t->tm_isdst = -1; /* Figure out DST. */
*timep = mktime(t);
if (*timep == -1) {
terr: fprintf(stderr,
"%s: out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]",
progname);
return (EXIT_FAILURE);
}
return (0);
}
int
db_recover_usage()
{
(void)fprintf(stderr, "usage: %s %s\n", progname,
"[-cefVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]");
return (EXIT_FAILURE);
}
int
db_recover_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_recover20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_recover20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_recover20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_recover.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_recover.c_dependencies
<END>
<BEGIN> FILE_db_recover.c_objects
db_recover.o
<END>
<BEGIN> FILE_db_recover.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_recover.c
<END>
<BEGIN> userComments
db_recover
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_recover22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_recover22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_recover22.out
<END>
<BEGIN> BUILD_RULE_db_recover22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_recover.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_recover.c_dependencies
<END>
<BEGIN> FILE_db_recover.c_objects
db_recover.o
<END>
<BEGIN> FILE_db_recover.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_recover.c
<END>
<BEGIN> userComments
db_recover
<END>

View File

@@ -0,0 +1,474 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996,2008 Oracle. All rights reserved.
*
* $Id: db_stat.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996,2008 Oracle. All rights reserved.\n";
#endif
typedef enum { T_NOTSET, T_DB,
T_ENV, T_LOCK, T_LOG, T_MPOOL, T_MUTEX, T_REP, T_TXN } test_t;
int db_stat_db_init __P((DB_ENV *, char *, test_t, u_int32_t, int *));
int db_stat_main __P((int, char *[]));
int db_stat_usage __P((void));
int db_stat_version_check __P((void));
const char *progname;
int
db_stat(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("db_stat", args, &argc, &argv);
return (db_stat_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
db_stat_main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind, __db_getopt_reset;
DB_ENV *dbenv;
DB *dbp;
test_t ttype;
u_int32_t cache, flags;
int ch, exitval;
int nflag, private, resize, ret;
char *db, *home, *p, *passwd, *subdb;
if ((progname = __db_rpath(argv[0])) == NULL)
progname = argv[0];
else
++progname;
if ((ret = db_stat_version_check()) != 0)
return (ret);
dbenv = NULL;
dbp = NULL;
ttype = T_NOTSET;
cache = MEGABYTE;
exitval = flags = nflag = private = 0;
db = home = passwd = subdb = NULL;
__db_getopt_reset = 1;
while ((ch = getopt(argc,
argv, "C:cd:Eefgh:L:lM:mNP:R:rs:tVxX:Z")) != EOF)
switch (ch) {
case 'C': case 'c':
if (ttype != T_NOTSET && ttype != T_LOCK)
goto argcombo;
ttype = T_LOCK;
if (ch != 'c')
for (p = optarg; *p; ++p)
switch (*p) {
case 'A':
LF_SET(DB_STAT_ALL);
break;
case 'c':
LF_SET(DB_STAT_LOCK_CONF);
break;
case 'l':
LF_SET(DB_STAT_LOCK_LOCKERS);
break;
case 'm': /* Backward compatible. */
break;
case 'o':
LF_SET(DB_STAT_LOCK_OBJECTS);
break;
case 'p':
LF_SET(DB_STAT_LOCK_PARAMS);
break;
default:
return (db_stat_usage());
}
break;
case 'd':
if (ttype != T_NOTSET && ttype != T_DB)
goto argcombo;
ttype = T_DB;
db = optarg;
break;
case 'E': case 'e':
if (ttype != T_NOTSET && ttype != T_ENV)
goto argcombo;
ttype = T_ENV;
LF_SET(DB_STAT_SUBSYSTEM);
if (ch == 'E')
LF_SET(DB_STAT_ALL);
break;
case 'f':
if (ttype != T_NOTSET && ttype != T_DB)
goto argcombo;
ttype = T_DB;
LF_SET(DB_FAST_STAT);
break;
case 'h':
home = optarg;
break;
case 'L': case 'l':
if (ttype != T_NOTSET && ttype != T_LOG)
goto argcombo;
ttype = T_LOG;
if (ch != 'l')
for (p = optarg; *p; ++p)
switch (*p) {
case 'A':
LF_SET(DB_STAT_ALL);
break;
default:
return (db_stat_usage());
}
break;
case 'M': case 'm':
if (ttype != T_NOTSET && ttype != T_MPOOL)
goto argcombo;
ttype = T_MPOOL;
if (ch != 'm')
for (p = optarg; *p; ++p)
switch (*p) {
case 'A':
LF_SET(DB_STAT_ALL);
break;
case 'h':
LF_SET(DB_STAT_MEMP_HASH);
break;
case 'm': /* Backward compatible. */
break;
default:
return (db_stat_usage());
}
break;
case 'N':
nflag = 1;
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 'R': case 'r':
if (ttype != T_NOTSET && ttype != T_REP)
goto argcombo;
ttype = T_REP;
if (ch != 'r')
for (p = optarg; *p; ++p)
switch (*p) {
case 'A':
LF_SET(DB_STAT_ALL);
break;
default:
return (db_stat_usage());
}
break;
case 's':
if (ttype != T_NOTSET && ttype != T_DB)
goto argcombo;
ttype = T_DB;
subdb = optarg;
break;
case 't':
if (ttype != T_NOTSET) {
argcombo: fprintf(stderr,
"%s: illegal option combination\n",
progname);
return (db_stat_usage());
}
ttype = T_TXN;
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case 'X': case 'x':
if (ttype != T_NOTSET && ttype != T_MUTEX)
goto argcombo;
ttype = T_MUTEX;
if (ch != 'x')
for (p = optarg; *p; ++p)
switch (*p) {
case 'A':
LF_SET(DB_STAT_ALL);
break;
default:
return (db_stat_usage());
}
break;
case 'Z':
LF_SET(DB_STAT_CLEAR);
break;
case '?':
default:
return (db_stat_usage());
}
argc -= optind;
argv += optind;
switch (ttype) {
case T_DB:
if (db == NULL)
return (db_stat_usage());
break;
case T_ENV:
case T_LOCK:
case T_LOG:
case T_MPOOL:
case T_MUTEX:
case T_REP:
case T_TXN:
break;
case T_NOTSET:
return (db_stat_usage());
}
/* Handle possible interruptions. */
__db_util_siginit();
/*
* Create an environment object and initialize it for error
* reporting.
*/
retry: if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
goto err;
}
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (nflag) {
if ((ret = dbenv->set_flags(dbenv, DB_NOLOCKING, 1)) != 0) {
dbenv->err(dbenv, ret, "set_flags: DB_NOLOCKING");
goto err;
}
if ((ret = dbenv->set_flags(dbenv, DB_NOPANIC, 1)) != 0) {
dbenv->err(dbenv, ret, "set_flags: DB_NOPANIC");
goto err;
}
}
if (passwd != NULL &&
(ret = dbenv->set_encrypt(dbenv, passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto err;
}
/* Initialize the environment. */
if (db_stat_db_init(dbenv, home, ttype, cache, &private) != 0)
goto err;
switch (ttype) {
case T_DB:
/* Create the DB object and open the file. */
if ((ret = db_create(&dbp, dbenv, 0)) != 0) {
dbenv->err(dbenv, ret, "db_create");
goto err;
}
/*
* We open the database for writing so we can update the cached
* statistics, but it's OK to fail, we can open read-only and
* proceed.
*
* Turn off error messages for now -- we can't open lots of
* databases read-write (for example, master databases and
* hash databases for which we don't know the hash function).
*/
dbenv->set_errfile(dbenv, NULL);
ret = dbp->open(dbp, NULL, db, subdb, DB_UNKNOWN, 0, 0);
dbenv->set_errfile(dbenv, stderr);
if (ret != 0 && (ret = dbp->open(
dbp, NULL, db, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) {
dbenv->err(dbenv, ret, "DB->open: %s", db);
goto err;
}
/* Check if cache is too small for this DB's pagesize. */
if (private) {
if ((ret = __db_util_cache(dbp, &cache, &resize)) != 0)
goto err;
if (resize) {
(void)dbp->close(dbp, DB_NOSYNC);
dbp = NULL;
(void)dbenv->close(dbenv, 0);
dbenv = NULL;
goto retry;
}
}
if (dbp->stat_print(dbp, flags))
goto err;
break;
case T_ENV:
if (dbenv->stat_print(dbenv, flags))
goto err;
break;
case T_LOCK:
if (dbenv->lock_stat_print(dbenv, flags))
goto err;
break;
case T_LOG:
if (dbenv->log_stat_print(dbenv, flags))
goto err;
break;
case T_MPOOL:
if (dbenv->memp_stat_print(dbenv, flags))
goto err;
break;
case T_MUTEX:
if (dbenv->mutex_stat_print(dbenv, flags))
goto err;
break;
case T_REP:
#ifdef HAVE_REPLICATION_THREADS
if (dbenv->repmgr_stat_print(dbenv, flags))
goto err;
#endif
if (dbenv->rep_stat_print(dbenv, flags))
goto err;
break;
case T_TXN:
if (dbenv->txn_stat_print(dbenv, flags))
goto err;
break;
case T_NOTSET:
dbenv->errx(dbenv, "Unknown statistics flag");
goto err;
}
if (0) {
err: exitval = 1;
}
if (dbp != NULL && (ret = dbp->close(dbp, DB_NOSYNC)) != 0) {
exitval = 1;
dbenv->err(dbenv, ret, "close");
}
if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
if (passwd != NULL)
free(passwd);
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
/*
* db_init --
* Initialize the environment.
*/
int
db_stat_db_init(dbenv, home, ttype, cache, is_private)
DB_ENV *dbenv;
char *home;
test_t ttype;
u_int32_t cache;
int *is_private;
{
u_int32_t oflags;
int ret;
/*
* If our environment open fails, and we're trying to look at a
* shared region, it's a hard failure.
*
* We will probably just drop core if the environment we join does
* not include a memory pool. This is probably acceptable; trying
* to use an existing environment that does not contain a memory
* pool to look at a database can be safely construed as operator
* error, I think.
*/
*is_private = 0;
if ((ret = dbenv->open(dbenv, home, DB_USE_ENVIRON, 0)) == 0)
return (0);
if (ret == DB_VERSION_MISMATCH)
goto err;
if (ttype != T_DB && ttype != T_LOG) {
dbenv->err(dbenv, ret, "DB_ENV->open%s%s",
home == NULL ? "" : ": ", home == NULL ? "" : home);
return (1);
}
/*
* We're looking at a database or set of log files and no environment
* exists. Create one, but make it private so no files are actually
* created. Declare a reasonably large cache so that we don't fail
* when reporting statistics on large databases.
*
* An environment is required to look at databases because we may be
* trying to look at databases in directories other than the current
* one.
*/
if ((ret = dbenv->set_cachesize(dbenv, 0, cache, 1)) != 0) {
dbenv->err(dbenv, ret, "set_cachesize");
return (1);
}
*is_private = 1;
oflags = DB_CREATE | DB_PRIVATE | DB_USE_ENVIRON;
if (ttype == T_DB)
oflags |= DB_INIT_MPOOL;
if (ttype == T_LOG)
oflags |= DB_INIT_LOG;
if ((ret = dbenv->open(dbenv, home, oflags, 0)) == 0)
return (0);
/* An environment is required. */
err: dbenv->err(dbenv, ret, "DB_ENV->open");
return (1);
}
int
db_stat_usage()
{
fprintf(stderr, "usage: %s %s\n", progname,
"-d file [-fN] [-h home] [-P password] [-s database]");
fprintf(stderr, "usage: %s %s\n\t%s\n", progname,
"[-cEelmNrtVxZ] [-C Aclop]",
"[-h home] [-L A] [-M A] [-P password] [-R A] [-X A]");
return (EXIT_FAILURE);
}
int
db_stat_version_check()
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR || v_minor != DB_VERSION_MINOR) {
fprintf(stderr,
"%s: version %d.%d doesn't match library version %d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
v_major, v_minor);
return (EXIT_FAILURE);
}
return (0);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
db_stat20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/db_stat20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_stat20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_db_stat.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_stat.c_dependencies
<END>
<BEGIN> FILE_db_stat.c_objects
db_stat.o
<END>
<BEGIN> FILE_db_stat.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_stat.c
<END>
<BEGIN> userComments
db_stat
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
db_stat22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/db_stat22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_db_stat22.out
<END>
<BEGIN> BUILD_RULE_db_stat22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_db_stat.c_dependDone
FALSE
<END>
<BEGIN> FILE_db_stat.c_dependencies
<END>
<BEGIN> FILE_db_stat.c_objects
db_stat.o
<END>
<BEGIN> FILE_db_stat.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/db_stat.c
<END>
<BEGIN> userComments
db_stat
<END>

View File

@@ -0,0 +1,39 @@
This README describes the steps needed to run a demo example of BerkeleyDB.
1. Read the pages in the Reference Guide that describe building
BerkeleyDB on VxWorks:
$(WIND_BASE)/target/src/BerkeleyDB/docs/ref/build_vxworks/intro.html
$(WIND_BASE)/target/src/BerkeleyDB/docs/ref/build_vxworks/notes.html
$(WIND_BASE)/target/src/BerkeleyDB/docs/ref/build_vxworks/faq.html
2. Launch Tornado 2.0 and open up the BerkeleyDB project.
3. Add the demo project to that workspace:
$(WIND_BASE)/target/src/BerkeleyDB/build_vxworks/demo/dbdemo.wpj
4. Build BerkeleyDB as described in the Reference Guide.
5. Build the dbdemo project.
6. Download BerkeleyDB onto the target.
7. Download the dbdemo project onto the target.
8. Open a windsh to the target and run the demo:
-> dbdemo "<pathname>/<dbname>"
Where pathname is a pathname string pointing to a directory that the
demo can create a database in. That directory should already exist.
The dbname is the name for the database. For example:
-> dbdemo "/tmp/demo.db"
9. The demo program will ask for input. You can type in any string.
The program will add an entry to the database with that string as
the key and the reverse of that string as the data item for that key.
It will continue asking for input until you hit ^D or enter "quit".
Upon doing so, the demo program will display all the keys you have
entered as input and their data items.

View File

@@ -0,0 +1,177 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1997,2008 Oracle. All rights reserved.
*
* $Id: dbdemo.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
extern int getopt(int, char * const *, const char *);
#else
#include <unistd.h>
#endif
#include <db_config.h>
#include <db_int.h>
#define DATABASE "access.db"
int dbdemo_main __P((int, char *[]));
int dbdemo_usage __P((void));
int
dbdemo(args)
char *args;
{
int argc;
char **argv;
__db_util_arg("dbdemo", args, &argc, &argv);
return (dbdemo_main(argc, argv) ? EXIT_FAILURE : EXIT_SUCCESS);
}
#include <stdio.h>
#define ERROR_RETURN ERROR
int
dbdemo_main(argc, argv)
int argc;
char *argv[];
{
extern int optind, __db_getopt_reset;
DB *dbp;
DBC *dbcp;
DBT key, data;
size_t len;
int ch, ret, rflag;
char *database, *p, *t, buf[1024], rbuf[1024];
const char *progname = "dbdemo"; /* Program name. */
rflag = 0;
__db_getopt_reset = 1;
while ((ch = getopt(argc, argv, "r")) != EOF)
switch (ch) {
case 'r':
rflag = 1;
break;
case '?':
default:
return (dbdemo_usage());
}
argc -= optind;
argv += optind;
/* Accept optional database name. */
database = *argv == NULL ? DATABASE : argv[0];
/* Optionally discard the database. */
if (rflag)
(void)remove(database);
/* Create and initialize database object, open the database. */
if ((ret = db_create(&dbp, NULL, 0)) != 0) {
fprintf(stderr,
"%s: db_create: %s\n", progname, db_strerror(ret));
return (EXIT_FAILURE);
}
dbp->set_errfile(dbp, stderr);
dbp->set_errpfx(dbp, progname);
if ((ret = dbp->set_pagesize(dbp, 1024)) != 0) {
dbp->err(dbp, ret, "set_pagesize");
goto err1;
}
if ((ret = dbp->set_cachesize(dbp, 0, 32 * 1024, 0)) != 0) {
dbp->err(dbp, ret, "set_cachesize");
goto err1;
}
if ((ret = dbp->open(dbp,
NULL, database, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
dbp->err(dbp, ret, "%s: open", database);
goto err1;
}
/*
* Insert records into the database, where the key is the user
* input and the data is the user input in reverse order.
*/
memset(&key, 0, sizeof(DBT));
memset(&data, 0, sizeof(DBT));
for (;;) {
printf("input> ");
fflush(stdout);
if (fgets(buf, sizeof(buf), stdin) == NULL)
break;
if (strcmp(buf, "exit\n") == 0 || strcmp(buf, "quit\n") == 0)
break;
if ((len = strlen(buf)) <= 1)
continue;
for (t = rbuf, p = buf + (len - 2); p >= buf;)
*t++ = *p--;
*t++ = '\0';
key.data = buf;
data.data = rbuf;
data.size = key.size = (u_int32_t)len - 1;
switch (ret =
dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE)) {
case 0:
break;
default:
dbp->err(dbp, ret, "DB->put");
if (ret != DB_KEYEXIST)
goto err1;
break;
}
}
printf("\n");
/* Acquire a cursor for the database. */
if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) {
dbp->err(dbp, ret, "DB->cursor");
goto err1;
}
/* Initialize the key/data pair so the flags aren't set. */
memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data));
/* Walk through the database and print out the key/data pairs. */
while ((ret = dbcp->get(dbcp, &key, &data, DB_NEXT)) == 0)
printf("%.*s : %.*s\n",
(int)key.size, (char *)key.data,
(int)data.size, (char *)data.data);
if (ret != DB_NOTFOUND) {
dbp->err(dbp, ret, "DBcursor->get");
goto err2;
}
/* Close everything down. */
if ((ret = dbcp->close(dbcp)) != 0) {
dbp->err(dbp, ret, "DBcursor->close");
goto err1;
}
if ((ret = dbp->close(dbp, 0)) != 0) {
fprintf(stderr,
"%s: DB->close: %s\n", progname, db_strerror(ret));
return (EXIT_FAILURE);
}
return (EXIT_SUCCESS);
err2: (void)dbcp->close(dbcp);
err1: (void)dbp->close(dbp, 0);
return (EXIT_FAILURE);
}
int
dbdemo_usage()
{
(void)fprintf(stderr, "usage: ex_access [-r] [database]\n");
return (EXIT_FAILURE);
}

View File

@@ -0,0 +1,158 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUMgnu_BUILDRULE
dbdemo20.out
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AR
ar386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUMgnu/dbdemo20.a
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_AS
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CC
cc386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS
-g \
-mpentium \
-ansi \
-nostdinc \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CFLAGS_AS
-g \
-mpentium \
-ansi \
-nostdinc \
-fvolatile \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-x \
assembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_CPP
cc386 -E -P -xc
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD
ld386
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDDEPS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_NM
nm386 -g
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUMgnu_MACRO_SIZE
size386
<END>
<BEGIN> BUILD_PENTIUMgnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUMgnu_TC
::tc_PENTIUMgnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_dbdemo20.out
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUMgnu
<END>
<BEGIN> BUILD__LIST
PENTIUMgnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.0
<END>
<BEGIN> FILE_dbdemo.c_dependDone
FALSE
<END>
<BEGIN> FILE_dbdemo.c_dependencies
<END>
<BEGIN> FILE_dbdemo.c_objects
dbdemo.o
<END>
<BEGIN> FILE_dbdemo.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/dbdemo.c
<END>
<BEGIN> userComments
dbdemo
<END>

View File

@@ -0,0 +1,192 @@
Document file - DO NOT EDIT
<BEGIN> BUILD_PENTIUM2gnu_BUILDRULE
dbdemo22.out
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AR
arpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_ARCHIVE
$(PRJ_DIR)/PENTIUM2gnu/dbdemo22.a
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_AS
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC
ccpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CC_ARCH_SPEC
-mcpu=pentiumpro -march=pentiumpro
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-DRW_MULTI_THREAD \
-D_REENTRANT \
-fvolatile \
-fno-builtin \
-fno-defer-pop \
-I$(PRJ_DIR)/.. \
-I$(PRJ_DIR)/../.. \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CFLAGS_AS
-g \
-mcpu=pentiumpro \
-march=pentiumpro \
-ansi \
-nostdlib \
-fno-builtin \
-fno-defer-pop \
-P \
-xassembler-with-cpp \
-I$(WIND_BASE)/target/h \
-DCPU=PENTIUM2 \
-DTOOL_FAMILY=gnu \
-DTOOL=gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_CPP
ccpentium -E -P
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_HEX_FLAGS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD
ldpentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LDFLAGS
-X -N
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL
ccpentium -r -nostdlib -Wl,-X
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_LD_PARTIAL_FLAGS
-X -r
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_NM
nmpentium -g
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEFINE_MACRO
-D
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_DEPEND
-M -w
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_GENERATE_DEPENDENCY_FILE
-MD
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_INCLUDE_DIR
-I
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_LANG_C
-xc
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_OPTION_UNDEFINE_MACRO
-U
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_POST_BUILD_RULE
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_PRJ_LIBS
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_SIZE
sizepentium
<END>
<BEGIN> BUILD_PENTIUM2gnu_MACRO_TOOL_FAMILY
gnu
<END>
<BEGIN> BUILD_PENTIUM2gnu_RO_DEPEND_PATH
{$(WIND_BASE)/target/h/} \
{$(WIND_BASE)/target/src/} \
{$(WIND_BASE)/target/config/}
<END>
<BEGIN> BUILD_PENTIUM2gnu_TC
::tc_PENTIUM2gnu
<END>
<BEGIN> BUILD_RULE_archive
<END>
<BEGIN> BUILD_RULE_dbdemo22.out
<END>
<BEGIN> BUILD_RULE_dbdemo22.pl
<END>
<BEGIN> BUILD_RULE_objects
<END>
<BEGIN> BUILD__CURRENT
PENTIUM2gnu
<END>
<BEGIN> BUILD__LIST
PENTIUM2gnu
<END>
<BEGIN> CORE_INFO_TYPE
::prj_vxApp
<END>
<BEGIN> CORE_INFO_VERSION
2.2
<END>
<BEGIN> FILE_dbdemo.c_dependDone
FALSE
<END>
<BEGIN> FILE_dbdemo.c_dependencies
<END>
<BEGIN> FILE_dbdemo.c_objects
dbdemo.o
<END>
<BEGIN> FILE_dbdemo.c_tool
C/C++ compiler
<END>
<BEGIN> PROJECT_FILES
$(PRJ_DIR)/dbdemo.c
<END>
<BEGIN> userComments
dbdemo
<END>