|
|
1.1 root 1: /* sleep10.c - sleep10 */
2:
3: #include <conf.h>
4: #include <kernel.h>
5: #include <proc.h>
6: #include <q.h>
7: #include <sleep.h>
8:
9: /*------------------------------------------------------------------------
10: * sleep10 -- delay the caller for a time specified in tenths of seconds
11: *------------------------------------------------------------------------
12: */
13: SYSCALL sleep10(n)
14: int n;
15: {
16: PStype ps;
17:
18: if (n < 0 || clkruns==0)
19: return(SYSERR);
20: disable(ps);
21: if (n == 0) { /* sleep10(0) -> end time slice */
22: ;
23: } else {
24: insertd(currpid,clockq,n);
25: slnempty = TRUE;
26: sltop = (short *) & q[q[clockq].qnext].qkey;
27: proctab[currpid].pstate = PRSLEEP;
28: }
29: resched();
30: restore(ps);
31: return(OK);
32: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.