|
|
1.1 root 1: /* ports.h - isbadport */
2:
1.1.1.2 ! root 3: #define NPORTS 30 /* maximum number of ports */
1.1 root 4: #define MAXMSGS 100 /* maximum messages on all ports*/
5: #define PTFREE '\01' /* port is Free */
6: #define PTLIMBO '\02' /* port is being deleted/reset */
7: #define PTALLOC '\03' /* port is allocated */
8: #define PTEMPTY -1 /* initial semaphore entries */
9:
10: struct ptnode { /* node on list of message ptrs */
1.1.1.2 ! root 11: WORD ptmsg; /* a one-word message */
1.1 root 12: struct ptnode *ptnext; /* address of next node on list */
13: };
14:
15: struct pt { /* entry in the port table */
16: char ptstate; /* port state (FREE/LIMBO/ALLOC)*/
17: int ptssem; /* sender semaphore */
18: int ptrsem; /* receiver semaphore */
19: int ptmaxcnt; /* max messages to be queued */
20: int ptseq; /* sequence changed at creation */
21: struct ptnode *pthead; /* list of message pointers */
22: struct ptnode *pttail; /* tail of message list */
23: };
24:
25: extern struct ptnode *ptfree; /* list of free nodes */
26: extern struct pt ports[]; /* port table */
27: extern int ptnextp; /* next port to examine when */
28: /* looking for a free one */
29: #ifdef MEMMARK
30: extern MARKER ptmark;
31: #endif
32:
1.1.1.2 ! root 33: #define isbadport(pid) ( (pid)<0 || (pid)>=NPORTS )
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.