|
|
1.1 root 1:
2: /* @(#)msg.h 6.1 */
3: /*
4: ** IPC Message Facility.
5: */
6:
7: /*
8: ** Implementation Constants.
9: */
10:
11: #define PMSG (PZERO + 2) /* message facility sleep priority */
12:
13: /*
14: ** Permission Definitions.
15: */
16:
17: #define MSG_R 0400 /* read permission */
18: #define MSG_W 0200 /* write permission */
19:
20: /*
21: ** ipc_perm Mode Definitions.
22: */
23:
24: #define MSG_RWAIT 01000 /* a reader is waiting for a message */
25: #define MSG_WWAIT 02000 /* a writer is waiting to send */
26:
27: /*
28: ** Message Operation Flags.
29: */
30:
31: #define MSG_NOERROR 010000 /* no error if big message */
32:
33: /*
34: * Defines for Message Limits
35: */
36:
37: #define MSGMAP 100 /* # of entries in msg map */
38: #define MSGMAX 8192 /* max message size */
39: #define MSGMNB 16384 /* max # bytes on queue */
40: #define MSGMNI 50 /* # of message queue identifiers */
41: #define MSGSSZ 8 /* msg segment size (word size multiple) */
42: #define MSGTQL 40 /* # of system message headers */
43: #define MSGSEG 1024 /* # of msg segments (MUST BE < 32768) */
44:
45: #define MSGMAPPTE clrnd(btoc(MSGSEG*MSGSSZ))
46: /* # of pages for message buffer */
47:
48: /*
49: ** Structure Definitions.
50: */
51:
52: /*
53: ** There is one msg queue id data structure for each q in the system.
54: */
55:
56: struct msqid_ds {
57: struct ipc_perm msg_perm; /* operation permission struct */
58: struct msg *msg_first; /* ptr to first message on q */
59: struct msg *msg_last; /* ptr to last message on q */
60: ushort msg_cbytes; /* current # bytes on q */
61: ushort msg_qnum; /* # of messages on q */
62: ushort msg_qbytes; /* max # of bytes on q */
63: ushort msg_lspid; /* pid of last msgsnd */
64: ushort msg_lrpid; /* pid of last msgrcv */
65: time_t msg_stime; /* last msgsnd time */
66: time_t msg_rtime; /* last msgrcv time */
67: time_t msg_ctime; /* last change time */
68: };
69:
70: /*
71: ** There is one msg structure for each message that may be in the system.
72: */
73:
74: struct msg {
75: struct msg *msg_next; /* ptr to next message on q */
76: long msg_type; /* message type */
77: short msg_ts; /* message text size */
78: short msg_spot; /* message text map address */
79: };
80:
81: /*
82: ** User message buffer template for msgsnd and msgrecv system calls.
83: */
84:
85: struct msgbuff {
86: long mtype; /* message type */
87: char mtext[1]; /* message text */
88: };
89:
90: /*
91: ** Message information structure.
92: */
93:
94: struct msginfo {
95: int msgmap, /* # of entries in msg map */
96: msgmax, /* max message size */
97: msgmnb, /* max # bytes on queue */
98: msgmni, /* # of message queue identifiers */
99: msgssz, /* msg segment size (should be word size multiple) */
100: msgtql; /* # of system message headers */
101: ushort msgseg; /* # of msg segments (MUST BE < 32768) */
102: };
103:
104:
105: #ifdef KERNEL
106: extern struct pte Msgmap[];
107: extern char msgutl[];
108: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.