1 /* $NetBSD: svr4_ipc.h,v 1.4 2005/12/11 12:20:26 christos Exp $ */
2
3 /*-
4 * Copyright (c) 1995 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _SVR4_IPC_H_
40 #define _SVR4_IPC_H_
41
42 /*
43 * General IPC
44 */
45 #define SVR4_IPC_RMID 10
46 #define SVR4_IPC_SET 11
47 #define SVR4_IPC_STAT 12
48
49 struct svr4_ipc_perm {
50 svr4_uid_t uid;
51 svr4_gid_t gid;
52 svr4_uid_t cuid;
53 svr4_gid_t cgid;
54 svr4_mode_t mode;
55 u_long seq;
56 svr4_key_t key;
57 long pad[4];
58 };
59
60 /*
61 * Message queues
62 */
63 #define SVR4_msgget 0
64 #define SVR4_msgctl 1
65 #define SVR4_msgrcv 2
66 #define SVR4_msgsnd 3
67
68 struct svr4_msg {
69 struct svr4_msg *msg_next;
70 long msg_type;
71 u_short msg_ts;
72 short msg_spot;
73 };
74
75 struct svr4_msqid_ds {
76 struct svr4_ipc_perm msg_perm;
77 struct svr4_msg *msg_first;
78 struct svr4_msg *msg_last;
79 u_long msg_cbytes;
80 u_long msg_qnum;
81 u_long msg_qbytes;
82 svr4_pid_t msg_lspid;
83 svr4_pid_t msg_lrpid;
84 svr4_time_t msg_stime;
85 long msg_pad1;
86 svr4_time_t msg_rtime;
87 long msg_pad2;
88 svr4_time_t msg_ctime;
89 long msg_pad3;
90 short msg_cv;
91 short msg_qnum_cv;
92 long msg_pad4[3];
93 };
94
95 struct svr4_msgbuf {
96 long mtype; /* message type */
97 char mtext[1]; /* message text */
98 };
99
100 struct svr4_msginfo {
101 int msgmap;
102 int msgmax;
103 int msgmnb;
104 int msgmni;
105 int msgssz;
106 int msgtql;
107 u_short msgseg;
108 };
109
110 /*
111 * Shared memory
112 */
113 #define SVR4_shmat 0
114 #define SVR4_shmctl 1
115 #define SVR4_shmdt 2
116 #define SVR4_shmget 3
117
118 /* shmctl() operations */
119 #define SVR4_SHM_LOCK 3
120 #define SVR4_SHM_UNLOCK 4
121
122 struct svr4_shmid_ds {
123 struct svr4_ipc_perm shm_perm;
124 int shm_segsz;
125 void *shm_amp;
126 u_short shm_lkcnt;
127 svr4_pid_t shm_lpid;
128 svr4_pid_t shm_cpid;
129 u_long shm_nattch;
130 u_long shm_cnattch;
131 svr4_time_t shm_atime;
132 long shm_pad1;
133 svr4_time_t shm_dtime;
134 long shm_pad2;
135 svr4_time_t shm_ctime;
136 long shm_pad3;
137 long shm_pad4[4];
138 };
139
140 /*
141 * Semaphores
142 */
143 #define SVR4_semctl 0
144 #define SVR4_semget 1
145 #define SVR4_semop 2
146
147 /* semctl() operations */
148 #define SVR4_SEM_GETNCNT 3
149 #define SVR4_SEM_GETPID 4
150 #define SVR4_SEM_GETVAL 5
151 #define SVR4_SEM_GETALL 6
152 #define SVR4_SEM_GETZCNT 7
153 #define SVR4_SEM_SETVAL 8
154 #define SVR4_SEM_SETALL 9
155
156 struct svr4_sem {
157 u_short semval;
158 svr4_pid_t sempid;
159 u_short semncnt;
160 u_short semzcnt;
161 u_short semncnt_cv;
162 u_short semzcnt_cv;
163 };
164
165 struct svr4_semid_ds {
166 struct svr4_ipc_perm sem_perm;
167 struct svr4_sem *sem_base;
168 u_short sem_nsems;
169 svr4_time_t sem_otime;
170 long sem_pad1;
171 svr4_time_t sem_ctime;
172 long sem_pad2;
173 long sem_pad3[4];
174 };
175
176 struct svr4_sembuf {
177 u_short sem_num;
178 short sem_op;
179 short sem_flg;
180 };
181
182 #endif /* _SVR4_IPC_H */
Cache object: f5962bafdb8744495602d228098ab562
|