|
|
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)
1.1.1.2 ! root 14: int n;
1.1 root 15: {
1.1.1.2 ! root 16: #ifdef DEBUG1
! 17: dotrace("sleep10", &n, 1);
! 18: #endif
1.1 root 19: if (n < 0 || clkruns==0)
20: return(SYSERR);
1.1.1.2 ! root 21: if (n == 0) {
! 22: disable();
! 23: resched();
! 24: restore();
! 25: return(OK);
1.1 root 26: }
1.1.1.2 ! root 27: disable();
! 28: insertd(currpid,clockq,n);
! 29: slnempty = TRUE;
! 30: sltop = &q[q[clockq].qnext].qkey;
! 31: proctab[currpid].pstate = PRSLEEP;
1.1 root 32: resched();
1.1.1.2 ! root 33: restore();
1.1 root 34: return(OK);
35: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.