File:  [XINU] / xinu / sys / receive.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:40:14 2018 UTC (8 years, 2 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19910600, HEAD
Xinu for 68000/68010

/* receive.c - receive */

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

/*------------------------------------------------------------------------
 *  receive  -  wait for a message and return it
 *------------------------------------------------------------------------
 */
SYSCALL	receive()
{
	struct	pentry	*pptr;
	WORD	msg;

	disable();
	pptr = &proctab[currpid];
	if (pptr->phasmsg == 0) {
		pptr->pstate = PRRECV;
		resched();
	}
	msg = pptr->pmsg;
	pptr->phasmsg = 0;
	restore();
	return(msg);
}

unix.superglobalmegacorp.com

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