|
|
1.1 ! root 1: /* preset.c - preset */ ! 2: ! 3: #include <conf.h> ! 4: #include <kernel.h> ! 5: #include <mark.h> ! 6: #include <ports.h> ! 7: ! 8: /*------------------------------------------------------------------------ ! 9: * preset -- reset a port, freeing waiting processes and messages ! 10: *------------------------------------------------------------------------ ! 11: */ ! 12: SYSCALL preset(portid, dispose) ! 13: int portid; ! 14: int (*dispose)(); ! 15: { ! 16: PStype ps; ! 17: struct pt *ptptr; ! 18: ! 19: disable(ps); ! 20: if ( isbadport(portid) || ! 21: #ifdef MEMMARK ! 22: unmarked(ptmark) || ! 23: #endif ! 24: (ptptr= &ports[portid])->ptstate != PTALLOC ) { ! 25: restore(ps); ! 26: return(SYSERR); ! 27: } ! 28: _ptclear(ptptr, PTALLOC, dispose); ! 29: restore(ps); ! 30: return(OK); ! 31: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.