⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app.c

📁 RT-Linux源码 一个实时操作系统源码
💻 C
字号:
//#include <asm/rt_time.h> #include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <unistd.h>#include <errno.h>#include "control.h"event_info ev1,ev2;#ifndef DEBUG#    error Probably kernel does not produce statistic for this program#endif  int main(){    int i;    int debug_fifo;    printf("TASK 1 \"UNO\"\nTASK 2 \"DOS\"\nTASK 3 \"TRES\"\n");    printf("TASK 4 \"CUATRO\"\nTASK 5 \"CINCO\"\nTASK 6 \"SEIS\"\n:BODY\n");    debug_fifo = open ("/dev/rtf5",O_RDONLY);    if ( debug_fifo == -1 ) {	printf("rtf5: not such device\n");	exit(1);    }    for (i=0; i<1000 ; i++) {  	read( debug_fifo, (char *) &ev2, sizeof(event_info));	if ( i==0 ) ev1 = ev2;    	printf("%s %d %d %d\n", 	    (ev2.state== EXEC) ? "EXEC": "ACTI",	    ev2.id, 	    (int) ((ev2.in-ev1.in)/10), 	    (int) ((ev2.out-ev1.in)/10));    }    close(debug_fifo);    return 0;}

⌨️ 快捷键说明

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