x_sema.c
来自「关于SHELL方面的」· C语言 代码 · 共 26 行
C
26 行
/* x_sema.c - x_sema */#include <conf.h>#include <kernel.h>#include <mark.h>#include <sem.h>extern struct sema_stat sema_stat;/*------------------------------------------------------------------------ * x_sema - (command sema) format and print semaphore information *------------------------------------------------------------------------ */COMMAND x_sema(stdin, stdout, stderr, nargs, args)int stdin, stdout, stderr, nargs;char *args[];{ char str[80]; sprintf(str, "failures %d maxused %4d (of %d) inuse=%4d (%3d%%)\n", sema_stat.failures, sema_stat.maxuse, NSEM, sema_stat.inuse, (sema_stat.inuse * 100)/NSEM); write(stdout, str, strlen(str)); return OK;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?