|
|
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; ! 13: int msg; ! 14: { ! 15: struct pentry *pptr; ! 16: PStype ps; ! 17: ! 18: disable(ps); ! 19: if (isbadpid(pid)||((pptr= &proctab[pid])->pstate == PRFREE)) { ! 20: restore(ps); ! 21: return(SYSERR); ! 22: } ! 23: pptr->pmsg = msg; ! 24: pptr->phasmsg = TRUE; ! 25: if (pptr->pstate == PRRECV) ! 26: ready(pid, RESCHYES); ! 27: #ifdef RTCLOCK ! 28: else if (pptr->pstate == PRTRECV) { ! 29: unsleep(pid); ! 30: ready(pid, RESCHYES); ! 31: } ! 32: #endif ! 33: restore(ps); ! 34: return(OK); ! 35: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.