📄 prcutil.c
字号:
/* *---------------------------------------------------------------------- * 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. * *---------------------------------------------------------------------- *//* * prcutil.c (proc) * * Kernel utility * Process management related */#include "call.h"#include <sys/pinfo.h>/* * Kernel shared data */#define PinfoLock (__CommArea->PinfoLock)/* Lock access to process management information.*/EXPORT VOID LockPinfo(void){ Lock(PinfoLock);}/* Unlock access to process management information.*/EXPORT VOID UnlockPinfo( void ){ Unlock(PinfoLock);}/* Fetch a pointer to process management information that includes a task specified by taskid. A function value NULL is error.*/EXPORT PINFO* GetPinfo(ID taskid){ return (PINFO*)CallKernelFunc(__CommArea->GetPinfo, taskid, 0);}/* LockPinfo() && GetPinfo(taskid)*/EXPORT PINFO* LockGetPinfo(ID taskid){ LockPinfo(); return GetPinfo(taskid);}/* User-level fetching*/EXPORT W GetUserLevel(ID taskid){ PINFO *p; W level = 0; p = LockGetPinfo(taskid); if ( p != NULL ) { level = p->user->user.level; } UnlockPinfo(); return level;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -