2 * Copyright (c) 2000 Marcel Moolenaar
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer
10 * in this position and unchanged.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * $FreeBSD: src/sys/compat/linux/linux_ipc.h,v 1.2.2.4 2001/11/05 19:08:22 marcel Exp $
29 * $DragonFly: src/sys/emulation/linux/linux_ipc.h,v 1.7 2003/11/20 06:05:29 dillon Exp $
49 struct linux_msgctl_args
54 struct l_msqid_ds *buf;
57 struct linux_msgget_args
64 struct linux_msgrcv_args
68 struct l_msgbuf *msgp;
74 struct linux_msgsnd_args
78 struct l_msgbuf *msgp;
83 struct linux_semctl_args
92 struct linux_semget_args
100 struct linux_semop_args
102 struct sysmsg sysmsg;
104 struct l_sembuf *tsops;
108 struct linux_shmat_args
110 struct sysmsg sysmsg;
117 struct linux_shmctl_args
119 struct sysmsg sysmsg;
122 struct l_shmid_ds *buf;
125 struct linux_shmdt_args
127 struct sysmsg sysmsg;
131 struct linux_shmget_args
133 struct sysmsg sysmsg;
165 l_ulong shm_tot; /* total allocated shm */
166 l_ulong shm_rss; /* total resident shm */
167 l_ulong shm_swp; /* total swapped shm */
168 l_ulong swap_attempts;
169 l_ulong swap_successes;
189 * The msqid64_ds structure for i386 architecture.
190 * Note extra padding because this structure is passed back and forth
191 * between kernel and user space.
193 * Pad space is left for:
194 * - 64-bit time_t to solve y2038 problem
195 * - 2 miscellaneous 32-bit values
198 struct l_msqid64_ds {
199 struct l_ipc64_perm msg_perm;
200 l_time_t msg_stime; /* last msgsnd time */
202 l_time_t msg_rtime; /* last msgrcv time */
204 l_time_t msg_ctime; /* last change time */
206 l_ulong msg_cbytes; /* current number of bytes on queue */
207 l_ulong msg_qnum; /* number of messages in queue */
208 l_ulong msg_qbytes; /* max number of bytes on queue */
209 l_pid_t msg_lspid; /* pid of last msgsnd */
210 l_pid_t msg_lrpid; /* last receive pid */
216 * The semid64_ds structure for i386 architecture.
217 * Note extra padding because this structure is passed back and forth
218 * between kernel and user space.
220 * Pad space is left for:
221 * - 64-bit time_t to solve y2038 problem
222 * - 2 miscellaneous 32-bit values
225 struct l_semid64_ds {
226 struct l_ipc64_perm sem_perm; /* permissions */
227 l_time_t sem_otime; /* last semop time */
229 l_time_t sem_ctime; /* last change time */
231 l_ulong sem_nsems; /* no. of semaphores in array */
237 * The shmid64_ds structure for i386 architecture.
238 * Note extra padding because this structure is passed back and forth
239 * between kernel and user space.
241 * Pad space is left for:
242 * - 64-bit time_t to solve y2038 problem
243 * - 2 miscellaneous 32-bit values
246 struct l_shmid64_ds {
247 struct l_ipc64_perm shm_perm; /* operation perms */
248 l_size_t shm_segsz; /* size of segment (bytes) */
249 l_time_t shm_atime; /* last attach time */
251 l_time_t shm_dtime; /* last detach time */
253 l_time_t shm_ctime; /* last change time */
255 l_pid_t shm_cpid; /* pid of creator */
256 l_pid_t shm_lpid; /* pid of last operator */
257 l_ulong shm_nattch; /* no. of current attaches */
286 struct l_ipc_perm msg_perm;
287 l_uintptr_t msg_first; /* first message on queue,unused */
288 l_uintptr_t msg_last; /* last message in queue,unused */
289 l_time_t msg_stime; /* last msgsnd time */
290 l_time_t msg_rtime; /* last msgrcv time */
291 l_time_t msg_ctime; /* last change time */
292 l_ulong msg_lcbytes; /* Reuse junk fields for 32 bit */
293 l_ulong msg_lqbytes; /* ditto */
294 l_ushort msg_cbytes; /* current number of bytes on queue */
295 l_ushort msg_qnum; /* number of messages in queue */
296 l_ushort msg_qbytes; /* max number of bytes on queue */
297 l_pid_t msg_lspid; /* pid of last msgsnd */
298 l_pid_t msg_lrpid; /* last receive pid */
302 struct l_ipc_perm sem_perm;
307 void *sem_pending_last;
313 struct l_ipc_perm shm_perm;
326 int linux_msgctl (struct linux_msgctl_args *);
327 int linux_msgget (struct linux_msgget_args *);
328 int linux_msgrcv (struct linux_msgrcv_args *);
329 int linux_msgsnd (struct linux_msgsnd_args *);
331 int linux_semctl (struct linux_semctl_args *);
332 int linux_semget (struct linux_semget_args *);
333 int linux_semop (struct linux_semop_args *);
335 int linux_shmat (struct linux_shmat_args *);
336 int linux_shmctl (struct linux_shmctl_args *);
337 int linux_shmdt (struct linux_shmdt_args *);
338 int linux_shmget (struct linux_shmget_args *);
339 #define LINUX_MSG_INFO 12
340 #define LINUX_IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger */
341 #endif /* __i386__ */
343 #endif /* _LINUX_IPC_H_ */