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

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

?? proctrack.c

?? linux集群服務器軟件代碼包
?? C
字號:
/* $Id: proctrack.c,v 1.17 2004/02/17 22:11:59 lars Exp $ *//* * Process tracking object. * * Copyright (c) 2002 International Business Machines * Author:	Alan Robertson <alanr@unix.sh> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * */#include <portability.h>#include <errno.h>#include <sys/wait.h>#include <heartbeat.h>#include <sys/types.h>#include <signal.h>#include <clplumbing/proctrack.h>#include <clplumbing/cl_log.h>#include <clplumbing/Gmain_timeout.h>#define	DEBUGPROCTRACK	debugproctrackint			debugproctrack = 0;static int		LoggingIsEnabled = 1;static GHashTable*	ProcessTable = NULL;static void		InitProcTable(void);static void		ForEachProcHelper(gpointer key, gpointer value,				void * helper);static gboolean TrackedProcTimeoutFunction(gpointer p);static voidInitProcTable(){	if (ProcessTable) {		return;	}	ProcessTable = g_hash_table_new(g_direct_hash, g_direct_equal);}/* Create/Log a new tracked process */voidNewTrackedProc(pid_t pid, int isapgrp, ProcTrackLogType loglevel,	void * privatedata, ProcTrack_ops* ops){	ProcTrack*	p = g_new(ProcTrack, 1);	InitProcTable();	p->pid = pid;	p->isapgrp = isapgrp;	p->loglevel = loglevel;	p->privatedata = privatedata;	p->ops = ops;	p->startticks = time_longclock();	p->starttime = time(NULL);	p->timerid = 0;	p->timeoutseq = -1;	p->killinfo = NULL;	g_hash_table_insert(ProcessTable, GINT_TO_POINTER(pid), p);	/* Tell them that someone registered a process */	if (p->ops->procregistered) {		p->ops->procregistered(p);	}}/* returns TRUE if 'pid' was registered */intReportProcHasDied(int pid, int status){	ProcTrack*		p;	int			signo=0;	int			deathbyexit=0;	int			deathbysig=0;	int			exitcode=0;	int			doreport = 0;	int			debugreporting = 0;	const char *		type;	ProcTrackLogType	level;#ifdef WCOREDUMP	int		didcoredump = 0;#endif	if ((p = GetProcInfo(pid)) == NULL) {		if (DEBUGPROCTRACK) {			cl_log(LOG_DEBUG			,	"Process %d died (%d) but is not tracked."			,	pid, status);		}		type = "untracked process";		level = PT_LOGNONE;	}else{		type = p->ops->proctype(p);		level = p->loglevel;	}	if (WIFEXITED(status)) {		deathbyexit=1;		exitcode = WEXITSTATUS(status);	}else if (WIFSIGNALED(status)) {		deathbysig=1;		signo = WTERMSIG(status);		doreport=1;	}#ifdef WCOREDUMP	if (WCOREDUMP(status)) {		/* Force a report on all core dumping processes */		didcoredump=1;		doreport=1;	}#endif	switch(level) {		case PT_LOGVERBOSE:	doreport=1;					break;		case PT_LOGNONE:	doreport = 0;					break;		case PT_LOGNORMAL:	break;	}	if (!LoggingIsEnabled) {		doreport = 0;	}	if (DEBUGPROCTRACK && !doreport) {		doreport = 1;		debugreporting = 1;	}	if (doreport) {		if (deathbyexit) {			cl_log((exitcode == 0 ? LOG_INFO : LOG_WARNING)			,	"Exiting %s process %d returned rc %d."			,	type, pid, exitcode);		}else if (deathbysig) {			/*			 * Processes being killed isn't an error if			 * we're only logging because of debugging.			 */			cl_log((debugreporting ? LOG_DEBUG : LOG_ERR)			,	"Exiting %s process %d killed by signal %d."			,	type, pid, signo);		}else{			cl_log(LOG_ERR, "Exiting %s process %d went away"			" strangely (!)"			,	type, pid);		}	}#ifdef WCOREDUMP	if (didcoredump) {		/* We report ALL core dumps without exception */		cl_log(LOG_ERR, "Exiting %s process %d dumped core"		,	type, pid);	}#endif	if (p) {		if (p->timerid > 0) {			g_source_remove(p->timerid);			p->timerid = 0;		}		/*		 * From clplumbing/proctrack.h:		 * (ProcTrack* p, int status, int signo, int exitcode		 * ,	int waslogged);		 */		p->ops->procdied(p, status, signo, exitcode,  doreport);		if (p->privatedata) {			/* They may have forgotten to free something... */			cl_log(LOG_ERR, "Exiting %s process %d did not"			" clean up private data!"			,	type, pid);		}		g_hash_table_remove(ProcessTable, GINT_TO_POINTER(pid));		g_free(p);	}	return doreport;}/* Return information associated with the given PID (or NULL) */ProcTrack*GetProcInfo(pid_t pid){	return (ProcessTable	?	g_hash_table_lookup(ProcessTable, GINT_TO_POINTER(pid))	:	NULL);}/* "info" is 0-terminated (terminated by a 0 signal) */intSetTrackedProcTimeouts(pid_t pid, ProcTrackKillInfo* info){	long		mstimeout;	ProcTrack*	pinfo;	pinfo = GetProcInfo(pid);		if (pinfo == NULL) {		return 0;	}	pinfo->timeoutseq = 0;	pinfo->killinfo = info;	mstimeout = pinfo->killinfo[0].mstimeout;	pinfo->timerid = Gmain_timeout_add(mstimeout	,	TrackedProcTimeoutFunction	,	GINT_TO_POINTER(pid));	return pinfo->timerid;}static gbooleanTrackedProcTimeoutFunction(gpointer p){	pid_t		pid = GPOINTER_TO_INT(p);	ProcTrack*	pinfo;	int		nsig;	long		mstimeout;	pinfo = GetProcInfo(pid);		if (pinfo == NULL || pinfo->timeoutseq < 0	||	pinfo->killinfo == NULL) {		return FALSE;	}	pinfo->timerid = 0;	nsig = pinfo->killinfo[pinfo->timeoutseq].signalno;	mstimeout = pinfo->killinfo[pinfo->timeoutseq].mstimeout;	if (nsig == 0) {		return FALSE;	}	cl_log(LOG_WARNING, "%s process (PID %d) timed out"	".  Killing with signal %d."	,	pinfo->ops->proctype(pinfo), (int)pid, nsig);	if (kill(pid, nsig) < 0) {		if (errno == EEXIST) {			/* No point in trying this again ;-) */			return FALSE;		}else{			cl_perror("kill(%d,%d) failed"			,	pid, nsig);		}	}	pinfo->timerid = Gmain_timeout_add(mstimeout	,	TrackedProcTimeoutFunction	,	GINT_TO_POINTER(pid));	return FALSE;}/* Helper struct to allow us to stuff 3 args into one ;-) */struct prochelper {	ProcTrack_ops*	type;	ProcTrackFun	fun;	void*		data;};/* Helper function to call user's function with right args... */static voidForEachProcHelper(gpointer key, gpointer value, void * helper){	ProcTrack*		p = value;	struct prochelper*	ph = helper;	if (ph->type != NULL && ph->type != p->ops) {		return;	}	ph->fun(p, ph->data);}/* * Iterate over the set of tracked processes. * If proctype is NULL, then walk through them all, otherwise only those * of the given type. */voidForEachProc(ProcTrack_ops* proctype, ProcTrackFun f, void * data){	struct prochelper ph;		InitProcTable();	ph.fun = f;	ph.type = proctype;	ph.data = data;	g_hash_table_foreach(ProcessTable, ForEachProcHelper, &ph);}voidDisableProcLogging(){	LoggingIsEnabled = 0;}voidEnableProcLogging(){	LoggingIsEnabled = 1;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区波多野结衣在线观看| 国产精品美女视频| 在线影院国内精品| 99re视频这里只有精品| 成人黄页在线观看| 色综合久久中文综合久久97| 91丨九色porny丨蝌蚪| 91丝袜国产在线播放| 欧美综合天天夜夜久久| 欧美午夜精品久久久久久超碰| 91黄色免费版| 欧美肥胖老妇做爰| 欧美草草影院在线视频| 国产婷婷一区二区| 亚洲视频免费在线观看| 香蕉久久一区二区不卡无毒影院 | 欧美日韩中文国产| 91精品国产一区二区三区蜜臀| 91.com在线观看| 日韩亚洲欧美一区二区三区| 精品久久久网站| 国产精品麻豆久久久| 亚洲欧美激情在线| 日韩国产欧美一区二区三区| 国产在线视频精品一区| 成人午夜看片网址| 欧美三级电影一区| 久久亚洲免费视频| 国产精品国模大尺度视频| 亚洲超碰精品一区二区| 国产九色sp调教91| 色婷婷狠狠综合| 精品99999| 亚洲一区二区三区影院| 久久精品久久精品| 一本到不卡免费一区二区| 337p亚洲精品色噜噜噜| 国产精品福利电影一区二区三区四区| 亚洲国产精品一区二区www在线| 国产中文字幕精品| 91成人在线观看喷潮| 久久久午夜精品理论片中文字幕| 亚洲精选视频在线| 国产精选一区二区三区| 91麻豆精品国产无毒不卡在线观看 | 亚洲国产日日夜夜| 大尺度一区二区| 日韩精品一区二区三区蜜臀| 18欧美乱大交hd1984| 国产精品主播直播| 欧美精品高清视频| 亚洲精品一二三区| 成人激情小说网站| 久久午夜电影网| 青青草成人在线观看| 欧美偷拍一区二区| 一区二区视频在线看| 国产91在线观看丝袜| 日韩视频一区二区三区| 亚洲一区二区成人在线观看| 91小视频免费观看| 中文成人av在线| 国产成人精品午夜视频免费| 久久视频一区二区| 国产精品一区在线| 日韩精品一区二区三区老鸭窝| 日韩激情一区二区| 337p亚洲精品色噜噜| 亚洲一级电影视频| 欧美亚洲国产bt| 亚洲国产日日夜夜| 欧美日本国产视频| 午夜精品福利一区二区蜜股av| 色婷婷综合久久久| ...av二区三区久久精品| 成人精品视频一区二区三区 | 亚洲视频一区二区在线| 成人av在线影院| 亚洲欧美二区三区| 91美女精品福利| 一区二区三区产品免费精品久久75| 91麻豆免费观看| 一区二区三区高清不卡| 欧美午夜电影在线播放| 婷婷综合久久一区二区三区| 日韩区在线观看| 国产揄拍国内精品对白| 国产欧美一区二区精品秋霞影院| 国产精品一区一区| 亚洲图片激情小说| 欧美日韩免费观看一区二区三区| 亚洲v精品v日韩v欧美v专区| 欧美一二三区在线| 国产激情一区二区三区| 《视频一区视频二区| 欧洲另类一二三四区| 日韩和欧美的一区| 久久亚洲精品小早川怜子| 99久久精品99国产精品| 亚洲成人中文在线| 精品日韩欧美一区二区| 丁香婷婷综合色啪| 亚洲小少妇裸体bbw| 日韩欧美中文字幕一区| 国产成a人亚洲精品| 亚洲国产精品一区二区久久| 日韩一级二级三级精品视频| 国产福利精品一区二区| 一区二区高清免费观看影视大全| 制服丝袜中文字幕亚洲| av毛片久久久久**hd| 美女一区二区三区| 中文字幕一区av| 日韩精品一区二区三区在线观看 | 亚洲三级视频在线观看| 欧美一区二区三区小说| av影院午夜一区| 久久精品国产一区二区| 亚洲女同一区二区| 久久影院午夜论| 欧美视频一区二区在线观看| 国产精品香蕉一区二区三区| 亚洲精品一二三区| 久久久久久亚洲综合影院红桃| 一本大道久久a久久综合婷婷| 精品亚洲porn| 日韩经典一区二区| 一区二区三区四区高清精品免费观看 | 日本不卡视频在线| 伊人性伊人情综合网| 中文字幕精品在线不卡| 日韩一区二区三区精品视频| 欧美午夜精品久久久久久超碰| 成人动漫一区二区三区| 国内成+人亚洲+欧美+综合在线| 亚洲综合男人的天堂| 136国产福利精品导航| 国产亚洲成年网址在线观看| 日韩免费成人网| 正在播放一区二区| 欧美人伦禁忌dvd放荡欲情| 91丨porny丨中文| 99久久亚洲一区二区三区青草| 国产美女精品一区二区三区| 激情文学综合丁香| 国产美女精品人人做人人爽| 久久99久久99小草精品免视看| 美女视频黄 久久| 麻豆国产一区二区| 日韩经典中文字幕一区| 日本美女视频一区二区| 日韩高清在线不卡| 首页国产欧美久久| 蜜臀va亚洲va欧美va天堂| 日韩高清不卡一区二区| 日本在线播放一区二区三区| 秋霞午夜av一区二区三区| 日韩有码一区二区三区| 蜜桃av一区二区在线观看 | 精品av久久707| 国产亚洲欧美日韩在线一区| 日本一区二区成人| 亚洲免费电影在线| 亚洲成在人线在线播放| 日本色综合中文字幕| 麻豆一区二区三| 国产不卡视频在线播放| 99久久久久久| 91黄色免费观看| 日韩限制级电影在线观看| 久久免费偷拍视频| 日韩毛片一二三区| 一区二区三区高清不卡| 日本不卡视频在线| 国产精品香蕉一区二区三区| 一本大道av一区二区在线播放 | 欧美aaaaa成人免费观看视频| 捆绑调教美女网站视频一区| 国产91丝袜在线18| 日韩你懂的在线播放| 国产三级欧美三级日产三级99| 最新高清无码专区| 亚洲1区2区3区4区| 国产美女一区二区| 欧美亚洲精品一区| 久久久亚洲欧洲日产国码αv| 综合久久久久久| 捆绑调教一区二区三区| 99精品在线免费| 欧美大片日本大片免费观看| 国产精品视频麻豆| 日韩国产在线一| 91亚洲男人天堂| 精品捆绑美女sm三区| 一区二区三区中文字幕精品精品 | 欧美国产日韩在线观看| 亚洲一区二区在线免费观看视频| 看片网站欧美日韩| 色婷婷狠狠综合| 国产拍揄自揄精品视频麻豆|