亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? db_server_util.c

?? mysql數據庫源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000-2002 *      Sleepycat Software.  All rights reserved. */#include "db_config.h"#ifndef lintstatic const char revid[] = "$Id: db_server_util.c,v 1.59 2002/03/27 04:32:50 bostic Exp $";#endif /* not lint */#ifndef NO_SYSTEM_INCLUDES#include <sys/types.h>#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#include <rpc/rpc.h>#include <limits.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#endif#include "dbinc_auto/db_server.h"#include "db_int.h"#include "dbinc_auto/clib_ext.h"#include "dbinc/db_server_int.h"#include "dbinc_auto/rpc_server_ext.h"#include "dbinc_auto/common_ext.h"extern int __dbsrv_main	 __P((void));static int add_home __P((char *));static int add_passwd __P((char *));static int env_recover __P((char *));static void __dbclear_child __P((ct_entry *));static LIST_HEAD(cthead, ct_entry) __dbsrv_head;static LIST_HEAD(homehead, home_entry) __dbsrv_home;static long __dbsrv_defto = DB_SERVER_TIMEOUT;static long __dbsrv_maxto = DB_SERVER_MAXTIMEOUT;static long __dbsrv_idleto = DB_SERVER_IDLETIMEOUT;static char *logfile = NULL;static char *prog;static void usage __P((char *));static void version_check __P((void));int __dbsrv_verbose = 0;intmain(argc, argv)	int argc;	char **argv;{	extern char *optarg;	CLIENT *cl;	int ch, ret;	char *passwd;	prog = argv[0];	version_check();	ret = 0;	/*	 * Check whether another server is running or not.  There	 * is a race condition where two servers could be racing to	 * register with the portmapper.  The goal of this check is to	 * forbid running additional servers (like those started from	 * the test suite) if the user is already running one.	 *	 * XXX	 * This does not solve nor prevent two servers from being	 * started at the same time and running recovery at the same	 * time on the same environments.	 */	if ((cl = clnt_create("localhost",	    DB_RPC_SERVERPROG, DB_RPC_SERVERVERS, "tcp")) != NULL) {		fprintf(stderr,		    "%s: Berkeley DB RPC server already running.\n", prog);		clnt_destroy(cl);		return (EXIT_FAILURE);	}	LIST_INIT(&__dbsrv_home);	while ((ch = getopt(argc, argv, "h:I:L:P:t:T:Vv")) != EOF)		switch (ch) {		case 'h':			(void)add_home(optarg);			break;		case 'I':			if (__db_getlong(NULL, prog,			    optarg, 1, LONG_MAX, &__dbsrv_idleto))				return (EXIT_FAILURE);			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",				    prog, strerror(errno));				return (EXIT_FAILURE);			}			if ((ret = add_passwd(passwd)) != 0) {				fprintf(stderr, "%s: strdup: %s\n",				    prog, strerror(ret));				return (EXIT_FAILURE);			}			break;		case 't':			if (__db_getlong(NULL, prog,			    optarg, 1, LONG_MAX, &__dbsrv_defto))				return (EXIT_FAILURE);			break;		case 'T':			if (__db_getlong(NULL, prog,			    optarg, 1, LONG_MAX, &__dbsrv_maxto))				return (EXIT_FAILURE);			break;		case 'V':			printf("%s\n", db_version(NULL, NULL, NULL));			return (EXIT_SUCCESS);		case 'v':			__dbsrv_verbose = 1;			break;		default:			usage(prog);		}	/*	 * Check default timeout against maximum timeout	 */	if (__dbsrv_defto > __dbsrv_maxto)		__dbsrv_defto = __dbsrv_maxto;	/*	 * Check default timeout against idle timeout	 * It would be bad to timeout environments sooner than txns.	 */	if (__dbsrv_defto > __dbsrv_idleto)		fprintf(stderr,		    "%s: WARNING: Idle timeout %ld is less than resource timeout %ld\n",		    prog, __dbsrv_idleto, __dbsrv_defto);	LIST_INIT(&__dbsrv_head);	/*	 * If a client crashes during an RPC, our reply to it	 * generates a SIGPIPE.  Ignore SIGPIPE so we don't exit unnecessarily.	 */#ifdef SIGPIPE	signal(SIGPIPE, SIG_IGN);#endif	if (logfile != NULL && __db_util_logset("berkeley_db_svc", logfile))		return (EXIT_FAILURE);	/*	 * Now that we are ready to start, run recovery on all the	 * environments specified.	 */	if (env_recover(prog) != 0)		return (EXIT_FAILURE);	/*	 * We've done our setup, now call the generated server loop	 */	if (__dbsrv_verbose)		printf("%s:  Ready to receive requests\n", prog);	__dbsrv_main();	/* NOTREACHED */	abort();}static voidusage(prog)	char *prog;{	fprintf(stderr, "usage: %s %s\n\t%s\n", prog,	    "[-Vv] [-h home] [-P passwd]",	    "[-I idletimeout] [-L logfile] [-t def_timeout] [-T maxtimeout]");	exit(EXIT_FAILURE);}static voidversion_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 || v_patch != DB_VERSION_PATCH) {		fprintf(stderr,	"%s: version %d.%d.%d doesn't match library version %d.%d.%d\n",		    prog, DB_VERSION_MAJOR, DB_VERSION_MINOR,		    DB_VERSION_PATCH, v_major, v_minor, v_patch);		exit(EXIT_FAILURE);	}}/* * PUBLIC: void __dbsrv_settimeout __P((ct_entry *, u_int32_t)); */void__dbsrv_settimeout(ctp, to)	ct_entry *ctp;	u_int32_t to;{	if (to > (u_int32_t)__dbsrv_maxto)		ctp->ct_timeout = __dbsrv_maxto;	else if (to <= 0)		ctp->ct_timeout = __dbsrv_defto;	else		ctp->ct_timeout = to;}/* * PUBLIC: void __dbsrv_timeout __P((int)); */void__dbsrv_timeout(force)	int force;{	static long to_hint = -1;	time_t t;	long to;	ct_entry *ctp, *nextctp;	if ((t = time(NULL)) == -1)		return;	/*	 * Check hint.  If hint is further in the future	 * than now, no work to do.	 */	if (!force && to_hint > 0 && t < to_hint)		return;	to_hint = -1;	/*	 * Timeout transactions or cursors holding DB resources.	 * Do this before timing out envs to properly release resources.	 *	 * !!!	 * We can just loop through this list looking for cursors and txns.	 * We do not need to verify txn and cursor relationships at this	 * point because we maintain the list in LIFO order *and* we	 * maintain activity in the ultimate txn parent of any cursor	 * so either everything in a txn is timing out, or nothing.	 * So, since we are LIFO, we will correctly close/abort all the	 * appropriate handles, in the correct order.	 */	for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL; ctp = nextctp) {		nextctp = LIST_NEXT(ctp, entries);		switch (ctp->ct_type) {		case CT_TXN:			to = *(ctp->ct_activep) + ctp->ct_timeout;			/* TIMEOUT */			if (to < t) {				if (__dbsrv_verbose)					printf("Timing out txn id %ld\n",					    ctp->ct_id);				(void)((DB_TXN *)ctp->ct_anyp)->				    abort((DB_TXN *)ctp->ct_anyp);				__dbdel_ctp(ctp);				/*				 * If we timed out an txn, we may have closed				 * all sorts of ctp's.				 * So start over with a guaranteed good ctp.				 */				nextctp = LIST_FIRST(&__dbsrv_head);			} else if ((to_hint > 0 && to_hint > to) ||			    to_hint == -1)				to_hint = to;			break;		case CT_CURSOR:		case (CT_JOINCUR | CT_CURSOR):			to = *(ctp->ct_activep) + ctp->ct_timeout;			/* TIMEOUT */			if (to < t) {				if (__dbsrv_verbose)					printf("Timing out cursor %ld\n",					    ctp->ct_id);				(void)__dbc_close_int(ctp);				/*				 * Start over with a guaranteed good ctp.				 */				nextctp = LIST_FIRST(&__dbsrv_head);			} else if ((to_hint > 0 && to_hint > to) ||			    to_hint == -1)				to_hint = to;			break;		default:			break;		}	}	/*	 * Timeout idle handles.	 * If we are forcing a timeout, we'll close all env handles.	 */	for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL; ctp = nextctp) {		nextctp = LIST_NEXT(ctp, entries);		if (ctp->ct_type != CT_ENV)			continue;		to = *(ctp->ct_activep) + ctp->ct_idle;		/* TIMEOUT */		if (to < t || force) {			if (__dbsrv_verbose)				printf("Timing out env id %ld\n", ctp->ct_id);			(void)__dbenv_close_int(ctp->ct_id, 0, 1);			/*			 * If we timed out an env, we may have closed			 * all sorts of ctp's (maybe even all of them.			 * So start over with a guaranteed good ctp.			 */			nextctp = LIST_FIRST(&__dbsrv_head);		}	}}/* * RECURSIVE FUNCTION.  We need to clear/free any number of levels of nested * layers. */static void__dbclear_child(parent)	ct_entry *parent;{	ct_entry *ctp, *nextctp;	for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;	    ctp = nextctp) {		nextctp = LIST_NEXT(ctp, entries);		if (ctp->ct_type == 0)			continue;		if (ctp->ct_parent == parent) {			__dbclear_child(ctp);			/*			 * Need to do this here because le_next may			 * have changed with the recursive call and we			 * don't want to point to a removed entry.			 */			nextctp = LIST_NEXT(ctp, entries);			__dbclear_ctp(ctp);		}	}}/* * PUBLIC: void __dbclear_ctp __P((ct_entry *)); */void__dbclear_ctp(ctp)	ct_entry *ctp;{	LIST_REMOVE(ctp, entries);	__os_free(NULL, ctp);}/* * PUBLIC: void __dbdel_ctp __P((ct_entry *)); */void__dbdel_ctp(parent)	ct_entry *parent;{	__dbclear_child(parent);	__dbclear_ctp(parent);}/* * PUBLIC: ct_entry *new_ct_ent __P((int *)); */ct_entry *new_ct_ent(errp)	int *errp;{	time_t t;	ct_entry *ctp, *octp;	int ret;	if ((ret = __os_malloc(NULL, sizeof(ct_entry), &ctp)) != 0) {		*errp = ret;		return (NULL);	}	memset(ctp, 0, sizeof(ct_entry));	/*	 * Get the time as ID.  We may service more than one request per	 * second however.  If we are, then increment id value until we	 * find an unused one.  We insert entries in LRU fashion at the	 * head of the list.  So, if the first entry doesn't match, then

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人白浆超碰人人人人| 91在线国产观看| 国产成人免费在线视频| 懂色中文一区二区在线播放| 狂野欧美性猛交blacked| 视频一区中文字幕国产| 国产在线视视频有精品| 在线视频国内自拍亚洲视频| 日韩女优制服丝袜电影| 国产精品另类一区| 日韩av午夜在线观看| 成人综合在线视频| 91成人免费在线视频| 日韩欧美国产系列| 国产精品乱码久久久久久 | 不卡av免费在线观看| 欧美一级生活片| 亚洲色图制服丝袜| 国产一区在线观看麻豆| 欧美日韩久久久| 精品国产乱码久久久久久牛牛| 国产女主播一区| 亚洲成av人片在线观看无码| av网站一区二区三区| 欧美大尺度电影在线| 樱桃国产成人精品视频| 国产精品88888| 欧美精品欧美精品系列| 国产精品乱码一区二区三区软件 | 亚洲同性同志一二三专区| 精品一区二区在线看| 欧美视频日韩视频在线观看| 日本一区二区电影| 免费亚洲电影在线| 欧美久久久久免费| ●精品国产综合乱码久久久久| 蜜桃视频一区二区三区在线观看| 99re成人精品视频| 国产亚洲欧美激情| 精品一区二区三区在线播放视频| 欧美精品v国产精品v日韩精品| 亚洲欧美另类综合偷拍| 成人一道本在线| 久久久99久久精品欧美| 极品销魂美女一区二区三区| 欧美久久一二区| 日韩中文字幕不卡| 欧美一区二区三区性视频| 亚洲制服丝袜av| 欧美在线视频全部完| 一区二区三区在线观看视频| 色94色欧美sute亚洲13| 亚洲乱码精品一二三四区日韩在线| 91同城在线观看| 亚洲精品ww久久久久久p站| 不卡视频免费播放| 亚洲婷婷国产精品电影人久久| 激情成人综合网| 精品免费99久久| 精品一区二区久久| 精品国产乱码久久久久久图片| 久久99这里只有精品| www国产精品av| 国产成人精品网址| ㊣最新国产の精品bt伙计久久| 粗大黑人巨茎大战欧美成人| 精品国产不卡一区二区三区| 国产91在线观看| 日韩毛片精品高清免费| 欧美网站大全在线观看| 日韩vs国产vs欧美| 久久先锋影音av| 9l国产精品久久久久麻豆| 亚洲一区在线播放| 日韩午夜激情av| 99视频一区二区| 亚洲黄色小视频| 欧美色爱综合网| 久久99精品久久久久久| 中文无字幕一区二区三区| 色婷婷精品久久二区二区蜜臂av | 91麻豆精品国产自产在线| 国产成人精品免费| 日本vs亚洲vs韩国一区三区二区| 中文字幕一区视频| 欧美精品一区二区久久久| 欧美视频在线播放| 99精品国产91久久久久久| 国产精品一区二区果冻传媒| 亚洲第一搞黄网站| 亚洲老司机在线| 中文字幕在线一区二区三区| 久久夜色精品国产噜噜av | 日本久久一区二区| 粉嫩av一区二区三区粉嫩| 精品制服美女丁香| 蜜桃视频一区二区| 丝袜美腿亚洲一区| 亚洲一区av在线| 亚洲精品免费视频| 国产精品电影院| 日本一区二区三区免费乱视频| 欧美变态tickling挠脚心| 欧美一级电影网站| 欧美久久久久久久久| 欧美日韩一二三区| 欧美性受xxxx| 欧美三级电影在线观看| 在线免费不卡电影| 欧美影院一区二区三区| 欧美性猛交xxxx乱大交退制版 | 欧美一区二区三区播放老司机| 在线观看一区二区视频| 91美女片黄在线观看91美女| 91视频国产观看| 色偷偷久久一区二区三区| 91色综合久久久久婷婷| 色欧美乱欧美15图片| 91久久精品午夜一区二区| 91在线你懂得| 欧美午夜精品电影| 欧美一区二区三区免费观看视频| 日韩欧美亚洲一区二区| 日韩一区二区三免费高清| 精品久久久三级丝袜| 久久久久久日产精品| 国产精品美女久久久久av爽李琼| 中文字幕中文字幕在线一区| 尤物在线观看一区| 奇米色一区二区| 国产大陆亚洲精品国产| 成人高清免费在线播放| 色婷婷综合久久久久中文一区二区 | 国产亚洲福利社区一区| 成人欧美一区二区三区小说 | 国产精品久久免费看| 一区二区三区在线观看网站| 日韩成人一区二区三区在线观看| 激情久久五月天| 不卡的av网站| 欧美日韩美女一区二区| 精品电影一区二区| 中文字幕一区二区三区不卡| 亚洲高清一区二区三区| 麻豆精品久久精品色综合| 成人白浆超碰人人人人| 91超碰这里只有精品国产| 久久久久成人黄色影片| 亚洲精品美腿丝袜| 国内不卡的二区三区中文字幕| 97久久精品人人做人人爽50路| 91精选在线观看| 国产精品传媒视频| 蜜臀99久久精品久久久久久软件| 播五月开心婷婷综合| 91精品福利在线一区二区三区| 国产精品午夜春色av| 偷拍与自拍一区| 成人a区在线观看| 欧美一区二区三区公司| 1000部国产精品成人观看| 免费国产亚洲视频| av成人免费在线观看| 欧美mv日韩mv| 亚洲午夜在线电影| 国产不卡在线视频| 欧美精品在线一区二区| 1024成人网| 成人精品国产一区二区4080| 91精品国产欧美一区二区18| 亚洲免费观看高清完整版在线观看熊 | 91麻豆精品国产91久久久更新时间 | 精品三级在线观看| 亚洲国产视频在线| 99久久国产综合精品女不卡| 久久夜色精品国产噜噜av| 天天综合色天天| 91玉足脚交白嫩脚丫在线播放| 欧美精品一区二区三区久久久| 天使萌一区二区三区免费观看| 色婷婷亚洲精品| 国产精品国产馆在线真实露脸| 国产精一区二区三区| 欧美成人三级在线| 首页欧美精品中文字幕| 欧美性极品少妇| 一区二区三区在线看| 色婷婷av久久久久久久| 亚洲天堂免费在线观看视频| 成人污污视频在线观看| 久久久噜噜噜久久中文字幕色伊伊 | 蓝色福利精品导航| 日韩欧美国产wwwww| 五月天婷婷综合| 欧美丰满一区二区免费视频| 亚洲第一狼人社区| 欧美午夜精品一区二区三区 | 久久国产日韩欧美精品| 日韩三级免费观看| 另类小说视频一区二区|