1/*-
2 * Copyright (c) 2002 Maxim Sobolev <sobomax@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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
16 *
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.
27 *
28 * $FreeBSD$
29 */
30
31#ifndef _I386_LINUX_LINUX_IPC64_H_
32#define	_I386_LINUX_LINUX_IPC64_H_
33
34/*
35 * The ipc64_perm structure for i386 architecture.
36 * Note extra padding because this structure is passed back and forth
37 * between kernel and user space.
38 *
39 * Pad space is left for:
40 * - 32-bit mode_t and seq
41 * - 2 miscellaneous 32-bit values
42 */
43
44struct l_ipc64_perm
45{
46	l_key_t		key;
47	l_uid_t		uid;
48	l_gid_t		gid;
49	l_uid_t		cuid;
50	l_gid_t		cgid;
51	l_mode_t	mode;
52	l_ushort	__pad1;
53	l_ushort	seq;
54	l_ushort	__pad2;
55	l_ulong		__unused1;
56	l_ulong		__unused2;
57};
58
59/*
60 * The msqid64_ds structure for i386 architecture.
61 * Note extra padding because this structure is passed back and forth
62 * between kernel and user space.
63 *
64 * Pad space is left for:
65 * - 64-bit time_t to solve y2038 problem
66 * - 2 miscellaneous 32-bit values
67 */
68
69struct l_msqid64_ds {
70	struct l_ipc64_perm msg_perm;
71	l_time_t	msg_stime;	/* last msgsnd time */
72	l_ulong		__unused1;
73	l_time_t	msg_rtime;	/* last msgrcv time */
74	l_ulong		__unused2;
75	l_time_t	msg_ctime;	/* last change time */
76	l_ulong		__unused3;
77	l_ulong		msg_cbytes;	/* current number of bytes on queue */
78	l_ulong		msg_qnum;	/* number of messages in queue */
79	l_ulong		msg_qbytes;	/* max number of bytes on queue */
80	l_pid_t		msg_lspid;	/* pid of last msgsnd */
81	l_pid_t		msg_lrpid;	/* last receive pid */
82	l_ulong		__unused4;
83	l_ulong		__unused5;
84};
85
86/*
87 * The semid64_ds structure for i386 architecture.
88 * Note extra padding because this structure is passed back and forth
89 * between kernel and user space.
90 *
91 * Pad space is left for:
92 * - 64-bit time_t to solve y2038 problem
93 * - 2 miscellaneous 32-bit values
94 */
95
96struct l_semid64_ds {
97	struct l_ipc64_perm sem_perm;	/* permissions */
98	l_time_t	sem_otime;	/* last semop time */
99	l_ulong		__unused1;
100	l_time_t	sem_ctime;	/* last change time */
101	l_ulong		__unused2;
102	l_ulong		sem_nsems;	/* no. of semaphores in array */
103	l_ulong		__unused3;
104	l_ulong		__unused4;
105};
106
107/*
108 * The shmid64_ds structure for i386 architecture.
109 * Note extra padding because this structure is passed back and forth
110 * between kernel and user space.
111 *
112 * Pad space is left for:
113 * - 64-bit time_t to solve y2038 problem
114 * - 2 miscellaneous 32-bit values
115 */
116
117struct l_shmid64_ds {
118	struct l_ipc64_perm shm_perm;	/* operation perms */
119	l_size_t	shm_segsz;	/* size of segment (bytes) */
120	l_time_t	shm_atime;	/* last attach time */
121	l_ulong		__unused1;
122	l_time_t	shm_dtime;	/* last detach time */
123	l_ulong		__unused2;
124	l_time_t	shm_ctime;	/* last change time */
125	l_ulong		__unused3;
126	l_pid_t		shm_cpid;	/* pid of creator */
127	l_pid_t		shm_lpid;	/* pid of last operator */
128	l_ulong		shm_nattch;	/* no. of current attaches */
129	l_ulong		__unused4;
130	l_ulong		__unused5;
131};
132
133struct l_shminfo64 {
134	l_ulong   	shmmax;
135	l_ulong   	shmmin;
136	l_ulong   	shmmni;
137	l_ulong   	shmseg;
138	l_ulong   	shmall;
139	l_ulong   	__unused1;
140	l_ulong   	__unused2;
141	l_ulong   	__unused3;
142	l_ulong   	__unused4;
143};
144
145#endif /* !_I386_LINUX_LINUX_IPC64_H_ */
146