prcutil2.c

来自「T-kernel 的extension源代码」· C语言 代码 · 共 54 行

C
54
字号
/* *---------------------------------------------------------------------- *    T-Kernel / Standard Extension * *    Copyright (C) 2006 by Ken Sakamura. All rights reserved. *    T-Kernel / Standard Extension is distributed  *      under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * *    Version:   1.00.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* *	prcutil2.c (proc) * *	Kernel utility *	Process management related */#include <basic.h>#include <tk/tkernel.h>#include <sys/util.h>#include <sys/pinfo.h>/* * Obtain current task ID *	The result is undefined when called from outside the task. */EXPORT ID GetMyTid( void ){	return tk_get_tid();}/* * Obtain current process ID */EXPORT ID GetMyPid( void ){	PINFO	*pinfo = GetPinfo(TSK_SELF);	return ( pinfo == NULL )? E_CTX: pinfo->procid;}/* * Obtain management information on current process */EXPORT ER GetMyPinfo( PINFO **pinfo ){	*pinfo = GetPinfo(TSK_SELF);	return ( *pinfo == NULL )? E_CTX: E_OK;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?