|
|
1.1 root 1: /* sendf.c - sendf */
2:
3: #include <conf.h>
4: #include <kernel.h>
5: #include <proc.h>
6:
7: /*------------------------------------------------------------------------
8: * sendf -- sendf a message to another process, forcing delivery
9: *------------------------------------------------------------------------
10: */
11: SYSCALL sendf(pid, msg)
12: int pid;
1.1.1.2 ! root 13: WORD msg;
1.1 root 14: {
15: struct pentry *pptr;
16:
1.1.1.2 ! root 17: disable();
1.1 root 18: if (isbadpid(pid)||((pptr= &proctab[pid])->pstate == PRFREE)) {
1.1.1.2 ! root 19: restore();
1.1 root 20: return(SYSERR);
21: }
22: pptr->pmsg = msg;
1.1.1.2 ! root 23: pptr->phasmsg++;
1.1 root 24: if (pptr->pstate == PRRECV)
25: ready(pid, RESCHYES);
26: return(OK);
27: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.