File:  [XINU] / xinu / sys / TEST / test.c.pshell
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:04 2018 UTC (8 years, 3 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* test.c - main */

#include <conf.h>
#include <kernel.h>
#include <network.h>

/*------------------------------------------------------------------------
 *  main  --  run UDP echo server and Xinu pseudo-shell
 *------------------------------------------------------------------------
 */
main()
{
	int	eserver();
	Bool	first;

	/* start UDP echo server */

	resume( create(eserver, 400, 30, "UDPecho", 0) );

	for (first=TRUE ; TRUE ; first=FALSE) {
		pshell(first);
	}
}

static	struct	xgram	buff;	/* Here because the stack is small */

/*------------------------------------------------------------------------
 *  eserver  -  implement UDP echo server that runs in background
 *------------------------------------------------------------------------
 */
eserver()
{
	int	echodev;
	int	len;

	echodev = open(NETWORK, ANYFPORT, UECHO);

	while (TRUE) {
		len = read(echodev, &buff, sizeof(struct xgram));
		if (len == SYSERR)
			continue;
		write(echodev, &buff, len);
	}
}

/*------------------------------------------------------------------------
 *  dumpit  -  really just to add dump routines to memory image for debug
 *------------------------------------------------------------------------
 */
dumpit()
{
/*T*/
	prdump();
	rfdump();
	dgdump();
	adump();
/*T*/
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.