tsk1.c

来自「pSOSystem系统调用的例程」· C语言 代码 · 共 33 行

C
33
字号
/* tsk1.c - Task #1 */#include <psos.h>#include <prepc.h>#include <stdio.h>#include "misc.h"#include "appl.h"void tsk1(ULONG me, ULONG him, ULONG l3, ULONG l4){	ULONG	rc, got;	char	incoming[LINE_MAX+1];	bprintf("%s Task begin\n", (char *) me);	for (;;) {		if (0 != (rc = q_vreceive(qid, Q_WAIT, 0, incoming,		                          sizeof(incoming), &got)))			fail(rc, "%s q_vreceive(%s) failed", me, Q_NAM);		bprintf("%2d: ", got);		if (got == 0) {			bprintf("<EOF>\n");			break;		}		incoming[got] = '\0';		bprintf("%s\n", incoming);	}	bprintf("%s Task end\n", (char *) me);	/* Resume the root task (well-known tid) */	t_resume(0x00020000);	exit(0);}

⌨️ 快捷键说明

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