1 /*-
2 * Copyright (c) 2002 Doug Rabson
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 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: releng/11.2/sys/compat/freebsd32/freebsd32_ipc.h 329177 2018-02-12 18:40:19Z brooks $
27 */
28
29 #ifndef _COMPAT_FREEBSD32_FREEBSD32_IPC_H_
30 #define _COMPAT_FREEBSD32_FREEBSD32_IPC_H_
31
32 struct ipc_perm32 {
33 uid_t cuid;
34 gid_t cgid;
35 uid_t uid;
36 gid_t gid;
37 mode_t mode;
38 uint16_t seq;
39 uint32_t key;
40 };
41
42 struct semid_ds32 {
43 struct ipc_perm32 sem_perm;
44 uint32_t sem_base;
45 unsigned short sem_nsems;
46 int32_t sem_otime;
47 int32_t sem_ctime;
48 };
49
50 #ifdef _KERNEL
51 struct semid_kernel32 {
52 /* Data structure exposed to user space. */
53 struct semid_ds32 u;
54
55 /* Kernel-private components of the semaphore. */
56 int32_t label;
57 int32_t cred;
58 };
59 #endif /* _KERNEL */
60
61
62 union semun32 {
63 int val;
64 uint32_t buf;
65 uint32_t array;
66 };
67
68 struct msqid_ds32 {
69 struct ipc_perm32 msg_perm;
70 uint32_t msg_first;
71 uint32_t msg_last;
72 uint32_t msg_cbytes;
73 uint32_t msg_qnum;
74 uint32_t msg_qbytes;
75 pid_t msg_lspid;
76 pid_t msg_lrpid;
77 int32_t msg_stime;
78 int32_t msg_rtime;
79 int32_t msg_ctime;
80 };
81
82 #ifdef _KERNEL
83 struct msqid_kernel32 {
84 /* Data structure exposed to user space. */
85 struct msqid_ds32 u;
86
87 /* Kernel-private components of the message queue. */
88 uint32_t label;
89 uint32_t cred;
90 };
91 #endif
92
93 struct shmid_ds32 {
94 struct ipc_perm32 shm_perm;
95 int32_t shm_segsz;
96 pid_t shm_lpid;
97 pid_t shm_cpid;
98 int shm_nattch;
99 int32_t shm_atime;
100 int32_t shm_dtime;
101 int32_t shm_ctime;
102 };
103
104 #ifdef _KERNEL
105 struct shmid_kernel32 {
106 struct shmid_ds32 u;
107 int32_t *object;
108 int32_t *label;
109 int32_t *cred;
110 };
111 #endif
112
113 struct shm_info32 {
114 int32_t used_ids;
115 uint32_t shm_tot;
116 uint32_t shm_rss;
117 uint32_t shm_swp;
118 uint32_t swap_attempts;
119 uint32_t swap_successes;
120 };
121
122 struct shminfo32 {
123 uint32_t shmmax;
124 uint32_t shmmin;
125 uint32_t shmmni;
126 uint32_t shmseg;
127 uint32_t shmall;
128 };
129
130 #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
131 defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
132 struct ipc_perm32_old {
133 uint16_t cuid;
134 uint16_t cgid;
135 uint16_t uid;
136 uint16_t gid;
137 uint16_t mode;
138 uint16_t seq;
139 uint32_t key;
140 };
141
142 struct semid_ds32_old {
143 struct ipc_perm32_old sem_perm;
144 uint32_t sem_base;
145 unsigned short sem_nsems;
146 int32_t sem_otime;
147 int32_t sem_pad1;
148 int32_t sem_ctime;
149 int32_t sem_pad2;
150 int32_t sem_pad3[4];
151 };
152
153 struct msqid_ds32_old {
154 struct ipc_perm32_old msg_perm;
155 uint32_t msg_first;
156 uint32_t msg_last;
157 uint32_t msg_cbytes;
158 uint32_t msg_qnum;
159 uint32_t msg_qbytes;
160 pid_t msg_lspid;
161 pid_t msg_lrpid;
162 int32_t msg_stime;
163 int32_t msg_pad1;
164 int32_t msg_rtime;
165 int32_t msg_pad2;
166 int32_t msg_ctime;
167 int32_t msg_pad3;
168 int32_t msg_pad4[4];
169 };
170
171 struct shmid_ds32_old {
172 struct ipc_perm32_old shm_perm;
173 int32_t shm_segsz;
174 pid_t shm_lpid;
175 pid_t shm_cpid;
176 int16_t shm_nattch;
177 int32_t shm_atime;
178 int32_t shm_dtime;
179 int32_t shm_ctime;
180 uint32_t shm_internal;
181 };
182
183 void freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32,
184 struct ipc_perm *ip);
185 void freebsd32_ipcperm_old_out(struct ipc_perm *ip,
186 struct ipc_perm32_old *ip32);
187 #endif
188
189 void freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip);
190 void freebsd32_ipcperm_out(struct ipc_perm *ip, struct ipc_perm32 *ip32);
191
192 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_IPC_H_ */
Cache object: 22537dc878b8b6e08757c8fe4acd0e80
|