File: | obj-scan-build/pflocal/ioServer.c |
Location: | line 193, column 2 |
Description: | Assigned value is garbage or undefined |
1 | /* Module io */ |
2 | |
3 | #ifndef _GNU_SOURCE1 |
4 | #define _GNU_SOURCE1 1 |
5 | #endif |
6 | |
7 | #define EXPORT_BOOLEAN |
8 | #include <mach/boolean.h> |
9 | #include <mach/kern_return.h> |
10 | #include <mach/message.h> |
11 | #include <mach/mig_errors.h> |
12 | #include <mach/mig_support.h> |
13 | |
14 | #ifndef mig_internalstatic |
15 | #define mig_internalstatic static |
16 | #endif |
17 | |
18 | #ifndef mig_external |
19 | #define mig_external |
20 | #endif |
21 | |
22 | #ifndef mig_unlikely |
23 | #define mig_unlikely(X)__builtin_expect (!! (X), 0) __builtin_expect (!! (X), 0) |
24 | #endif |
25 | |
26 | #ifndef TypeCheck1 |
27 | #define TypeCheck1 1 |
28 | #endif |
29 | |
30 | #ifndef UseExternRCSId1 |
31 | #define UseExternRCSId1 1 |
32 | #endif |
33 | |
34 | #define BAD_TYPECHECK(type, check)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) mig_unlikely (({\__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) |
35 | union { mach_msg_type_t t; unsigned32_t w; } _t, _c;\__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) |
36 | _t.t = *(type); _c.t = *(check);_t.w != _c.w; }))__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) |
37 | #define msgh_request_portmsgh_local_port msgh_local_port |
38 | #define MACH_MSGH_BITS_REQUEST(bits)(((bits) & 0x0000ff00) >> 8) MACH_MSGH_BITS_LOCAL(bits)(((bits) & 0x0000ff00) >> 8) |
39 | #define msgh_reply_portmsgh_remote_port msgh_remote_port |
40 | #define MACH_MSGH_BITS_REPLY(bits)((bits) & 0x000000ff) MACH_MSGH_BITS_REMOTE(bits)((bits) & 0x000000ff) |
41 | |
42 | #include <hurd/ports.h> |
43 | #include <mach/std_types.h> |
44 | #include <mach/mach_types.h> |
45 | #include <device/device_types.h> |
46 | #include <device/net_status.h> |
47 | #include <sys/types.h> |
48 | #include <sys/stat.h> |
49 | #include <sys/statfs.h> |
50 | #include <sys/resource.h> |
51 | #include <sys/utsname.h> |
52 | #include <hurd/hurd_types.h> |
53 | #include "mig-decls.h" |
54 | |
55 | /* Routine io_write */ |
56 | mig_internalstatic void _Xio_write |
57 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
58 | { |
59 | typedef struct { |
60 | mach_msg_header_t Head; |
61 | mach_msg_type_long_t dataType; |
62 | char data[2048]; |
63 | mach_msg_type_t offsetType; |
64 | loff_t offset; |
65 | } Request; |
66 | |
67 | typedef struct { |
68 | mach_msg_header_t Head; |
69 | mach_msg_type_t RetCodeType; |
70 | kern_return_t RetCode; |
71 | mach_msg_type_t amountType; |
72 | vm_size_t amount; |
73 | } Reply; |
74 | |
75 | Request *In0P = (Request *) InHeadP; |
76 | Request *In1P; |
77 | Reply *OutP = (Reply *) OutHeadP; |
78 | mig_external kern_return_t S_io_write |
79 | (sock_user_t io_object, data_t data, mach_msg_type_number_t dataCnt, loff_t offset, vm_size_t *amount); |
80 | |
81 | #if TypeCheck1 |
82 | boolean_t msgh_simple = msgh_simple; |
83 | #endif /* TypeCheck */ |
84 | |
85 | unsigned int msgh_size; |
86 | unsigned int msgh_size_delta; |
87 | |
88 | const mach_msg_type_t offsetCheck = { |
89 | /* msgt_name = */ 11, |
90 | /* msgt_size = */ 64, |
91 | /* msgt_number = */ 1, |
92 | /* msgt_inline = */ TRUE((boolean_t) 1), |
93 | /* msgt_longform = */ FALSE((boolean_t) 0), |
94 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
95 | /* msgt_unused = */ 0 |
96 | }; |
97 | |
98 | const mach_msg_type_t amountType = { |
99 | /* msgt_name = */ 2, |
100 | /* msgt_size = */ 32, |
101 | /* msgt_number = */ 1, |
102 | /* msgt_inline = */ TRUE((boolean_t) 1), |
103 | /* msgt_longform = */ FALSE((boolean_t) 0), |
104 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
105 | /* msgt_unused = */ 0 |
106 | }; |
107 | |
108 | sock_user_t io_object; |
109 | |
110 | #if TypeCheck1 |
111 | msgh_size = In0P->Head.msgh_size; |
112 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
113 | if (mig_unlikely ((msgh_size < 48))__builtin_expect (!! ((msgh_size < 48)), 0)) |
114 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
115 | #endif /* TypeCheck */ |
116 | |
117 | #if TypeCheck1 |
118 | if (mig_unlikely ((In0P->dataType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In0P->dataType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->dataType.msgtl_name != 8) || (In0P->dataType.msgtl_size != 8)), 0) |
119 | (In0P->dataType.msgtl_name != 8) ||__builtin_expect (!! ((In0P->dataType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->dataType.msgtl_name != 8) || (In0P->dataType.msgtl_size != 8)), 0) |
120 | (In0P->dataType.msgtl_size != 8))__builtin_expect (!! ((In0P->dataType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->dataType.msgtl_name != 8) || (In0P->dataType.msgtl_size != 8)), 0)) |
121 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
122 | #endif /* TypeCheck */ |
123 | |
124 | msgh_size_delta = (In0P->dataType.msgtl_header.msgt_inline) ? (In0P->dataType.msgtl_number + 3) & ~3 : sizeof(char *); |
125 | #if TypeCheck1 |
126 | if (mig_unlikely (msgh_size != 48 + msgh_size_delta)__builtin_expect (!! (msgh_size != 48 + msgh_size_delta), 0)) |
127 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
128 | #endif /* TypeCheck */ |
129 | |
130 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
131 | |
132 | #if TypeCheck1 |
133 | if (BAD_TYPECHECK(&In1P->offsetType, &offsetCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In1P->offsetType); _c.t = *(& offsetCheck);_t.w != _c.w; })), 0)) |
134 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
135 | #endif /* TypeCheck */ |
136 | |
137 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
138 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
139 | else |
140 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
141 | |
142 | OutP->RetCode = S_io_write(io_object, (In0P->dataType.msgtl_header.msgt_inline) ? In0P->data : *((char **)In0P->data), In0P->dataType.msgtl_number, In1P->offset, &OutP->amount); |
143 | if (OutP->RetCode == KERN_SUCCESS0) |
144 | if (!In0P->dataType.msgtl_header.msgt_inline) |
145 | __mig_deallocate(* (vm_offset_t *) In0P->data, In0P->dataType.msgtl_number); |
146 | end_using_sock_user_port(io_object); |
147 | if (OutP->RetCode != KERN_SUCCESS0) |
148 | return; |
149 | |
150 | OutP->Head.msgh_size = 40; |
151 | |
152 | OutP->amountType = amountType; |
153 | } |
154 | |
155 | /* Default implementation of S_io_write */ |
156 | #ifdef MIG_EOPNOTSUPP |
157 | kern_return_t __attribute__ ((weak)) |
158 | S_io_write |
159 | ( |
160 | sock_user_t io_object, |
161 | data_t data, |
162 | mach_msg_type_number_t dataCnt, |
163 | loff_t offset, |
164 | vm_size_t *amount |
165 | ) { return MIG_EOPNOTSUPP; } |
166 | #endif /* MIG_EOPNOTSUPP */ |
167 | |
168 | /* Routine io_read */ |
169 | mig_internalstatic void _Xio_read |
170 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
171 | { |
172 | typedef struct { |
173 | mach_msg_header_t Head; |
174 | mach_msg_type_t offsetType; |
175 | loff_t offset; |
176 | mach_msg_type_t amountType; |
177 | vm_size_t amount; |
178 | } Request; |
179 | |
180 | typedef struct { |
181 | mach_msg_header_t Head; |
182 | mach_msg_type_t RetCodeType; |
183 | kern_return_t RetCode; |
184 | mach_msg_type_long_t dataType; |
185 | char data[2048]; |
186 | } Reply; |
187 | |
188 | Request *In0P = (Request *) InHeadP; |
189 | Reply *OutP = (Reply *) OutHeadP; |
190 | mig_external kern_return_t S_io_read |
191 | (sock_user_t io_object, data_t *data, mach_msg_type_number_t *dataCnt, loff_t offset, vm_size_t amount); |
192 | |
193 | boolean_t msgh_simple = msgh_simple; |
Assigned value is garbage or undefined | |
194 | const mach_msg_type_t offsetCheck = { |
195 | /* msgt_name = */ 11, |
196 | /* msgt_size = */ 64, |
197 | /* msgt_number = */ 1, |
198 | /* msgt_inline = */ TRUE((boolean_t) 1), |
199 | /* msgt_longform = */ FALSE((boolean_t) 0), |
200 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
201 | /* msgt_unused = */ 0 |
202 | }; |
203 | |
204 | const mach_msg_type_t amountCheck = { |
205 | /* msgt_name = */ 2, |
206 | /* msgt_size = */ 32, |
207 | /* msgt_number = */ 1, |
208 | /* msgt_inline = */ TRUE((boolean_t) 1), |
209 | /* msgt_longform = */ FALSE((boolean_t) 0), |
210 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
211 | /* msgt_unused = */ 0 |
212 | }; |
213 | |
214 | const mach_msg_type_long_t dataType = { |
215 | { |
216 | /* msgt_name = */ 0, |
217 | /* msgt_size = */ 0, |
218 | /* msgt_number = */ 0, |
219 | /* msgt_inline = */ TRUE((boolean_t) 1), |
220 | /* msgt_longform = */ TRUE((boolean_t) 1), |
221 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
222 | /* msgt_unused = */ 0 |
223 | }, |
224 | /* msgtl_name = */ 8, |
225 | /* msgtl_size = */ 8, |
226 | /* msgtl_number = */ 2048, |
227 | }; |
228 | |
229 | sock_user_t io_object; |
230 | mach_msg_type_number_t dataCnt; |
231 | |
232 | char *dataP; |
233 | |
234 | #if TypeCheck1 |
235 | if (mig_unlikely ((In0P->Head.msgh_size != 44) ||__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
236 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
237 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
238 | #endif /* TypeCheck */ |
239 | |
240 | #if TypeCheck1 |
241 | if (BAD_TYPECHECK(&In0P->offsetType, &offsetCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->offsetType); _c.t = *(& offsetCheck);_t.w != _c.w; })), 0)) |
242 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
243 | #endif /* TypeCheck */ |
244 | |
245 | #if TypeCheck1 |
246 | if (BAD_TYPECHECK(&In0P->amountType, &amountCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->amountType); _c.t = *(& amountCheck);_t.w != _c.w; })), 0)) |
247 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
248 | #endif /* TypeCheck */ |
249 | |
250 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
251 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
252 | else |
253 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
254 | |
255 | dataP = OutP->data; |
256 | dataCnt = 2048; |
257 | |
258 | OutP->RetCode = S_io_read(io_object, &dataP, &dataCnt, In0P->offset, In0P->amount); |
259 | end_using_sock_user_port(io_object); |
260 | if (OutP->RetCode != KERN_SUCCESS0) |
261 | return; |
262 | |
263 | msgh_simple = TRUE((boolean_t) 1); |
264 | |
265 | OutP->dataType = dataType; |
266 | if (dataP != OutP->data) { |
267 | OutP->dataType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
268 | OutP->dataType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
269 | *((char **)OutP->data) = dataP; |
270 | msgh_simple = FALSE((boolean_t) 0); |
271 | } |
272 | |
273 | OutP->dataType.msgtl_number = dataCnt; |
274 | OutP->Head.msgh_size = 44 + ((OutP->dataType.msgtl_header.msgt_inline) ? (dataCnt + 3) & ~3 : sizeof(char *)); |
275 | |
276 | if (!msgh_simple) |
277 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
278 | } |
279 | |
280 | /* Default implementation of S_io_read */ |
281 | #ifdef MIG_EOPNOTSUPP |
282 | kern_return_t __attribute__ ((weak)) |
283 | S_io_read |
284 | ( |
285 | sock_user_t io_object, |
286 | data_t *data, |
287 | mach_msg_type_number_t *dataCnt, |
288 | loff_t offset, |
289 | vm_size_t amount |
290 | ) { return MIG_EOPNOTSUPP; } |
291 | #endif /* MIG_EOPNOTSUPP */ |
292 | |
293 | /* Routine io_seek */ |
294 | mig_internalstatic void _Xio_seek |
295 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
296 | { |
297 | typedef struct { |
298 | mach_msg_header_t Head; |
299 | mach_msg_type_t offsetType; |
300 | loff_t offset; |
301 | mach_msg_type_t whenceType; |
302 | int whence; |
303 | } Request; |
304 | |
305 | typedef struct { |
306 | mach_msg_header_t Head; |
307 | mach_msg_type_t RetCodeType; |
308 | kern_return_t RetCode; |
309 | mach_msg_type_t newpType; |
310 | loff_t newp; |
311 | } Reply; |
312 | |
313 | Request *In0P = (Request *) InHeadP; |
314 | Reply *OutP = (Reply *) OutHeadP; |
315 | mig_external kern_return_t S_io_seek |
316 | (sock_user_t io_object, loff_t offset, int whence, loff_t *newp); |
317 | |
318 | const mach_msg_type_t offsetCheck = { |
319 | /* msgt_name = */ 11, |
320 | /* msgt_size = */ 64, |
321 | /* msgt_number = */ 1, |
322 | /* msgt_inline = */ TRUE((boolean_t) 1), |
323 | /* msgt_longform = */ FALSE((boolean_t) 0), |
324 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
325 | /* msgt_unused = */ 0 |
326 | }; |
327 | |
328 | const mach_msg_type_t whenceCheck = { |
329 | /* msgt_name = */ 2, |
330 | /* msgt_size = */ 32, |
331 | /* msgt_number = */ 1, |
332 | /* msgt_inline = */ TRUE((boolean_t) 1), |
333 | /* msgt_longform = */ FALSE((boolean_t) 0), |
334 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
335 | /* msgt_unused = */ 0 |
336 | }; |
337 | |
338 | const mach_msg_type_t newpType = { |
339 | /* msgt_name = */ 11, |
340 | /* msgt_size = */ 64, |
341 | /* msgt_number = */ 1, |
342 | /* msgt_inline = */ TRUE((boolean_t) 1), |
343 | /* msgt_longform = */ FALSE((boolean_t) 0), |
344 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
345 | /* msgt_unused = */ 0 |
346 | }; |
347 | |
348 | sock_user_t io_object; |
349 | |
350 | #if TypeCheck1 |
351 | if (mig_unlikely ((In0P->Head.msgh_size != 44) ||__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
352 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
353 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
354 | #endif /* TypeCheck */ |
355 | |
356 | #if TypeCheck1 |
357 | if (BAD_TYPECHECK(&In0P->offsetType, &offsetCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->offsetType); _c.t = *(& offsetCheck);_t.w != _c.w; })), 0)) |
358 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
359 | #endif /* TypeCheck */ |
360 | |
361 | #if TypeCheck1 |
362 | if (BAD_TYPECHECK(&In0P->whenceType, &whenceCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->whenceType); _c.t = *(& whenceCheck);_t.w != _c.w; })), 0)) |
363 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
364 | #endif /* TypeCheck */ |
365 | |
366 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
367 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
368 | else |
369 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
370 | |
371 | OutP->RetCode = S_io_seek(io_object, In0P->offset, In0P->whence, &OutP->newp); |
372 | end_using_sock_user_port(io_object); |
373 | if (OutP->RetCode != KERN_SUCCESS0) |
374 | return; |
375 | |
376 | OutP->Head.msgh_size = 44; |
377 | |
378 | OutP->newpType = newpType; |
379 | } |
380 | |
381 | /* Default implementation of S_io_seek */ |
382 | #ifdef MIG_EOPNOTSUPP |
383 | kern_return_t __attribute__ ((weak)) |
384 | S_io_seek |
385 | ( |
386 | sock_user_t io_object, |
387 | loff_t offset, |
388 | int whence, |
389 | loff_t *newp |
390 | ) { return MIG_EOPNOTSUPP; } |
391 | #endif /* MIG_EOPNOTSUPP */ |
392 | |
393 | /* Routine io_readable */ |
394 | mig_internalstatic void _Xio_readable |
395 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
396 | { |
397 | typedef struct { |
398 | mach_msg_header_t Head; |
399 | } Request; |
400 | |
401 | typedef struct { |
402 | mach_msg_header_t Head; |
403 | mach_msg_type_t RetCodeType; |
404 | kern_return_t RetCode; |
405 | mach_msg_type_t amountType; |
406 | vm_size_t amount; |
407 | } Reply; |
408 | |
409 | Request *In0P = (Request *) InHeadP; |
410 | Reply *OutP = (Reply *) OutHeadP; |
411 | mig_external kern_return_t S_io_readable |
412 | (sock_user_t io_object, vm_size_t *amount); |
413 | |
414 | const mach_msg_type_t amountType = { |
415 | /* msgt_name = */ 2, |
416 | /* msgt_size = */ 32, |
417 | /* msgt_number = */ 1, |
418 | /* msgt_inline = */ TRUE((boolean_t) 1), |
419 | /* msgt_longform = */ FALSE((boolean_t) 0), |
420 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
421 | /* msgt_unused = */ 0 |
422 | }; |
423 | |
424 | sock_user_t io_object; |
425 | |
426 | #if TypeCheck1 |
427 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
428 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
429 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
430 | #endif /* TypeCheck */ |
431 | |
432 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
433 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
434 | else |
435 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
436 | |
437 | OutP->RetCode = S_io_readable(io_object, &OutP->amount); |
438 | end_using_sock_user_port(io_object); |
439 | if (OutP->RetCode != KERN_SUCCESS0) |
440 | return; |
441 | |
442 | OutP->Head.msgh_size = 40; |
443 | |
444 | OutP->amountType = amountType; |
445 | } |
446 | |
447 | /* Default implementation of S_io_readable */ |
448 | #ifdef MIG_EOPNOTSUPP |
449 | kern_return_t __attribute__ ((weak)) |
450 | S_io_readable |
451 | ( |
452 | sock_user_t io_object, |
453 | vm_size_t *amount |
454 | ) { return MIG_EOPNOTSUPP; } |
455 | #endif /* MIG_EOPNOTSUPP */ |
456 | |
457 | /* Routine io_set_all_openmodes */ |
458 | mig_internalstatic void _Xio_set_all_openmodes |
459 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
460 | { |
461 | typedef struct { |
462 | mach_msg_header_t Head; |
463 | mach_msg_type_t newbitsType; |
464 | int newbits; |
465 | } Request; |
466 | |
467 | typedef struct { |
468 | mach_msg_header_t Head; |
469 | mach_msg_type_t RetCodeType; |
470 | kern_return_t RetCode; |
471 | } Reply; |
472 | |
473 | Request *In0P = (Request *) InHeadP; |
474 | Reply *OutP = (Reply *) OutHeadP; |
475 | mig_external kern_return_t S_io_set_all_openmodes |
476 | (sock_user_t io_object, int newbits); |
477 | |
478 | const mach_msg_type_t newbitsCheck = { |
479 | /* msgt_name = */ 2, |
480 | /* msgt_size = */ 32, |
481 | /* msgt_number = */ 1, |
482 | /* msgt_inline = */ TRUE((boolean_t) 1), |
483 | /* msgt_longform = */ FALSE((boolean_t) 0), |
484 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
485 | /* msgt_unused = */ 0 |
486 | }; |
487 | |
488 | sock_user_t io_object; |
489 | |
490 | #if TypeCheck1 |
491 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
492 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
493 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
494 | #endif /* TypeCheck */ |
495 | |
496 | #if TypeCheck1 |
497 | if (BAD_TYPECHECK(&In0P->newbitsType, &newbitsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->newbitsType); _c.t = *(& newbitsCheck);_t.w != _c.w; })), 0)) |
498 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
499 | #endif /* TypeCheck */ |
500 | |
501 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
502 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
503 | else |
504 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
505 | |
506 | OutP->RetCode = S_io_set_all_openmodes(io_object, In0P->newbits); |
507 | end_using_sock_user_port(io_object); |
508 | } |
509 | |
510 | /* Default implementation of S_io_set_all_openmodes */ |
511 | #ifdef MIG_EOPNOTSUPP |
512 | kern_return_t __attribute__ ((weak)) |
513 | S_io_set_all_openmodes |
514 | ( |
515 | sock_user_t io_object, |
516 | int newbits |
517 | ) { return MIG_EOPNOTSUPP; } |
518 | #endif /* MIG_EOPNOTSUPP */ |
519 | |
520 | /* Routine io_get_openmodes */ |
521 | mig_internalstatic void _Xio_get_openmodes |
522 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
523 | { |
524 | typedef struct { |
525 | mach_msg_header_t Head; |
526 | } Request; |
527 | |
528 | typedef struct { |
529 | mach_msg_header_t Head; |
530 | mach_msg_type_t RetCodeType; |
531 | kern_return_t RetCode; |
532 | mach_msg_type_t bitsType; |
533 | int bits; |
534 | } Reply; |
535 | |
536 | Request *In0P = (Request *) InHeadP; |
537 | Reply *OutP = (Reply *) OutHeadP; |
538 | mig_external kern_return_t S_io_get_openmodes |
539 | (sock_user_t io_object, int *bits); |
540 | |
541 | const mach_msg_type_t bitsType = { |
542 | /* msgt_name = */ 2, |
543 | /* msgt_size = */ 32, |
544 | /* msgt_number = */ 1, |
545 | /* msgt_inline = */ TRUE((boolean_t) 1), |
546 | /* msgt_longform = */ FALSE((boolean_t) 0), |
547 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
548 | /* msgt_unused = */ 0 |
549 | }; |
550 | |
551 | sock_user_t io_object; |
552 | |
553 | #if TypeCheck1 |
554 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
555 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
556 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
557 | #endif /* TypeCheck */ |
558 | |
559 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
560 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
561 | else |
562 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
563 | |
564 | OutP->RetCode = S_io_get_openmodes(io_object, &OutP->bits); |
565 | end_using_sock_user_port(io_object); |
566 | if (OutP->RetCode != KERN_SUCCESS0) |
567 | return; |
568 | |
569 | OutP->Head.msgh_size = 40; |
570 | |
571 | OutP->bitsType = bitsType; |
572 | } |
573 | |
574 | /* Default implementation of S_io_get_openmodes */ |
575 | #ifdef MIG_EOPNOTSUPP |
576 | kern_return_t __attribute__ ((weak)) |
577 | S_io_get_openmodes |
578 | ( |
579 | sock_user_t io_object, |
580 | int *bits |
581 | ) { return MIG_EOPNOTSUPP; } |
582 | #endif /* MIG_EOPNOTSUPP */ |
583 | |
584 | /* Routine io_set_some_openmodes */ |
585 | mig_internalstatic void _Xio_set_some_openmodes |
586 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
587 | { |
588 | typedef struct { |
589 | mach_msg_header_t Head; |
590 | mach_msg_type_t bits_to_setType; |
591 | int bits_to_set; |
592 | } Request; |
593 | |
594 | typedef struct { |
595 | mach_msg_header_t Head; |
596 | mach_msg_type_t RetCodeType; |
597 | kern_return_t RetCode; |
598 | } Reply; |
599 | |
600 | Request *In0P = (Request *) InHeadP; |
601 | Reply *OutP = (Reply *) OutHeadP; |
602 | mig_external kern_return_t S_io_set_some_openmodes |
603 | (sock_user_t io_object, int bits_to_set); |
604 | |
605 | const mach_msg_type_t bits_to_setCheck = { |
606 | /* msgt_name = */ 2, |
607 | /* msgt_size = */ 32, |
608 | /* msgt_number = */ 1, |
609 | /* msgt_inline = */ TRUE((boolean_t) 1), |
610 | /* msgt_longform = */ FALSE((boolean_t) 0), |
611 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
612 | /* msgt_unused = */ 0 |
613 | }; |
614 | |
615 | sock_user_t io_object; |
616 | |
617 | #if TypeCheck1 |
618 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
619 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
620 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
621 | #endif /* TypeCheck */ |
622 | |
623 | #if TypeCheck1 |
624 | if (BAD_TYPECHECK(&In0P->bits_to_setType, &bits_to_setCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->bits_to_setType); _c.t = *(&bits_to_setCheck);_t.w != _c.w; })), 0)) |
625 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
626 | #endif /* TypeCheck */ |
627 | |
628 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
629 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
630 | else |
631 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
632 | |
633 | OutP->RetCode = S_io_set_some_openmodes(io_object, In0P->bits_to_set); |
634 | end_using_sock_user_port(io_object); |
635 | } |
636 | |
637 | /* Default implementation of S_io_set_some_openmodes */ |
638 | #ifdef MIG_EOPNOTSUPP |
639 | kern_return_t __attribute__ ((weak)) |
640 | S_io_set_some_openmodes |
641 | ( |
642 | sock_user_t io_object, |
643 | int bits_to_set |
644 | ) { return MIG_EOPNOTSUPP; } |
645 | #endif /* MIG_EOPNOTSUPP */ |
646 | |
647 | /* Routine io_clear_some_openmodes */ |
648 | mig_internalstatic void _Xio_clear_some_openmodes |
649 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
650 | { |
651 | typedef struct { |
652 | mach_msg_header_t Head; |
653 | mach_msg_type_t bits_to_clearType; |
654 | int bits_to_clear; |
655 | } Request; |
656 | |
657 | typedef struct { |
658 | mach_msg_header_t Head; |
659 | mach_msg_type_t RetCodeType; |
660 | kern_return_t RetCode; |
661 | } Reply; |
662 | |
663 | Request *In0P = (Request *) InHeadP; |
664 | Reply *OutP = (Reply *) OutHeadP; |
665 | mig_external kern_return_t S_io_clear_some_openmodes |
666 | (sock_user_t io_object, int bits_to_clear); |
667 | |
668 | const mach_msg_type_t bits_to_clearCheck = { |
669 | /* msgt_name = */ 2, |
670 | /* msgt_size = */ 32, |
671 | /* msgt_number = */ 1, |
672 | /* msgt_inline = */ TRUE((boolean_t) 1), |
673 | /* msgt_longform = */ FALSE((boolean_t) 0), |
674 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
675 | /* msgt_unused = */ 0 |
676 | }; |
677 | |
678 | sock_user_t io_object; |
679 | |
680 | #if TypeCheck1 |
681 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
682 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
683 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
684 | #endif /* TypeCheck */ |
685 | |
686 | #if TypeCheck1 |
687 | if (BAD_TYPECHECK(&In0P->bits_to_clearType, &bits_to_clearCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->bits_to_clearType); _c.t = *(&bits_to_clearCheck);_t.w != _c.w; })), 0)) |
688 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
689 | #endif /* TypeCheck */ |
690 | |
691 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
692 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
693 | else |
694 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
695 | |
696 | OutP->RetCode = S_io_clear_some_openmodes(io_object, In0P->bits_to_clear); |
697 | end_using_sock_user_port(io_object); |
698 | } |
699 | |
700 | /* Default implementation of S_io_clear_some_openmodes */ |
701 | #ifdef MIG_EOPNOTSUPP |
702 | kern_return_t __attribute__ ((weak)) |
703 | S_io_clear_some_openmodes |
704 | ( |
705 | sock_user_t io_object, |
706 | int bits_to_clear |
707 | ) { return MIG_EOPNOTSUPP; } |
708 | #endif /* MIG_EOPNOTSUPP */ |
709 | |
710 | /* Routine io_async */ |
711 | mig_internalstatic void _Xio_async |
712 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
713 | { |
714 | typedef struct { |
715 | mach_msg_header_t Head; |
716 | mach_msg_type_t notify_portType; |
717 | mach_port_t notify_port; |
718 | } Request; |
719 | |
720 | typedef struct { |
721 | mach_msg_header_t Head; |
722 | mach_msg_type_t RetCodeType; |
723 | kern_return_t RetCode; |
724 | mach_msg_type_t async_id_portType; |
725 | mach_port_t async_id_port; |
726 | } Reply; |
727 | |
728 | Request *In0P = (Request *) InHeadP; |
729 | Reply *OutP = (Reply *) OutHeadP; |
730 | mig_external kern_return_t S_io_async |
731 | (sock_user_t io_object, mach_port_t notify_port, mach_port_t *async_id_port, mach_msg_type_name_t *async_id_portPoly); |
732 | |
733 | boolean_t msgh_simple = msgh_simple; |
734 | const mach_msg_type_t notify_portCheck = { |
735 | /* msgt_name = */ 17, |
736 | /* msgt_size = */ 32, |
737 | /* msgt_number = */ 1, |
738 | /* msgt_inline = */ TRUE((boolean_t) 1), |
739 | /* msgt_longform = */ FALSE((boolean_t) 0), |
740 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
741 | /* msgt_unused = */ 0 |
742 | }; |
743 | |
744 | const mach_msg_type_t async_id_portType = { |
745 | /* msgt_name = */ -1, |
746 | /* msgt_size = */ 32, |
747 | /* msgt_number = */ 1, |
748 | /* msgt_inline = */ TRUE((boolean_t) 1), |
749 | /* msgt_longform = */ FALSE((boolean_t) 0), |
750 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
751 | /* msgt_unused = */ 0 |
752 | }; |
753 | |
754 | sock_user_t io_object; |
755 | mach_msg_type_name_t async_id_portPoly; |
756 | |
757 | #if TypeCheck1 |
758 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0) |
759 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
760 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
761 | #endif /* TypeCheck */ |
762 | |
763 | #if TypeCheck1 |
764 | if (BAD_TYPECHECK(&In0P->notify_portType, ¬ify_portCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->notify_portType); _c.t = *(¬ify_portCheck);_t.w != _c.w; })), 0)) |
765 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
766 | #endif /* TypeCheck */ |
767 | |
768 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
769 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
770 | else |
771 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
772 | |
773 | OutP->RetCode = S_io_async(io_object, In0P->notify_port, &OutP->async_id_port, &async_id_portPoly); |
774 | end_using_sock_user_port(io_object); |
775 | if (OutP->RetCode != KERN_SUCCESS0) |
776 | return; |
777 | |
778 | msgh_simple = TRUE((boolean_t) 1); |
779 | OutP->Head.msgh_size = 40; |
780 | |
781 | OutP->async_id_portType = async_id_portType; |
782 | |
783 | if (MACH_MSG_TYPE_PORT_ANY(async_id_portPoly)(((async_id_portPoly) >= 16) && ((async_id_portPoly ) <= 21))) |
784 | msgh_simple = FALSE((boolean_t) 0); |
785 | |
786 | OutP->async_id_portType.msgt_name = async_id_portPoly; |
787 | |
788 | if (!msgh_simple) |
789 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
790 | } |
791 | |
792 | /* Default implementation of S_io_async */ |
793 | #ifdef MIG_EOPNOTSUPP |
794 | kern_return_t __attribute__ ((weak)) |
795 | S_io_async |
796 | ( |
797 | sock_user_t io_object, |
798 | mach_port_t notify_port, |
799 | mach_port_t *async_id_port, |
800 | mach_msg_type_name_t *async_id_portPoly |
801 | ) { return MIG_EOPNOTSUPP; } |
802 | #endif /* MIG_EOPNOTSUPP */ |
803 | |
804 | /* Routine io_mod_owner */ |
805 | mig_internalstatic void _Xio_mod_owner |
806 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
807 | { |
808 | typedef struct { |
809 | mach_msg_header_t Head; |
810 | mach_msg_type_t ownerType; |
811 | pid_t owner; |
812 | } Request; |
813 | |
814 | typedef struct { |
815 | mach_msg_header_t Head; |
816 | mach_msg_type_t RetCodeType; |
817 | kern_return_t RetCode; |
818 | } Reply; |
819 | |
820 | Request *In0P = (Request *) InHeadP; |
821 | Reply *OutP = (Reply *) OutHeadP; |
822 | mig_external kern_return_t S_io_mod_owner |
823 | (sock_user_t io_object, pid_t owner); |
824 | |
825 | const mach_msg_type_t ownerCheck = { |
826 | /* msgt_name = */ 2, |
827 | /* msgt_size = */ 32, |
828 | /* msgt_number = */ 1, |
829 | /* msgt_inline = */ TRUE((boolean_t) 1), |
830 | /* msgt_longform = */ FALSE((boolean_t) 0), |
831 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
832 | /* msgt_unused = */ 0 |
833 | }; |
834 | |
835 | sock_user_t io_object; |
836 | |
837 | #if TypeCheck1 |
838 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
839 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
840 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
841 | #endif /* TypeCheck */ |
842 | |
843 | #if TypeCheck1 |
844 | if (BAD_TYPECHECK(&In0P->ownerType, &ownerCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->ownerType); _c.t = *(& ownerCheck);_t.w != _c.w; })), 0)) |
845 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
846 | #endif /* TypeCheck */ |
847 | |
848 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
849 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
850 | else |
851 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
852 | |
853 | OutP->RetCode = S_io_mod_owner(io_object, In0P->owner); |
854 | end_using_sock_user_port(io_object); |
855 | } |
856 | |
857 | /* Default implementation of S_io_mod_owner */ |
858 | #ifdef MIG_EOPNOTSUPP |
859 | kern_return_t __attribute__ ((weak)) |
860 | S_io_mod_owner |
861 | ( |
862 | sock_user_t io_object, |
863 | pid_t owner |
864 | ) { return MIG_EOPNOTSUPP; } |
865 | #endif /* MIG_EOPNOTSUPP */ |
866 | |
867 | /* Routine io_get_owner */ |
868 | mig_internalstatic void _Xio_get_owner |
869 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
870 | { |
871 | typedef struct { |
872 | mach_msg_header_t Head; |
873 | } Request; |
874 | |
875 | typedef struct { |
876 | mach_msg_header_t Head; |
877 | mach_msg_type_t RetCodeType; |
878 | kern_return_t RetCode; |
879 | mach_msg_type_t ownerType; |
880 | pid_t owner; |
881 | } Reply; |
882 | |
883 | Request *In0P = (Request *) InHeadP; |
884 | Reply *OutP = (Reply *) OutHeadP; |
885 | mig_external kern_return_t S_io_get_owner |
886 | (sock_user_t io_object, pid_t *owner); |
887 | |
888 | const mach_msg_type_t ownerType = { |
889 | /* msgt_name = */ 2, |
890 | /* msgt_size = */ 32, |
891 | /* msgt_number = */ 1, |
892 | /* msgt_inline = */ TRUE((boolean_t) 1), |
893 | /* msgt_longform = */ FALSE((boolean_t) 0), |
894 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
895 | /* msgt_unused = */ 0 |
896 | }; |
897 | |
898 | sock_user_t io_object; |
899 | |
900 | #if TypeCheck1 |
901 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
902 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
903 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
904 | #endif /* TypeCheck */ |
905 | |
906 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
907 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
908 | else |
909 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
910 | |
911 | OutP->RetCode = S_io_get_owner(io_object, &OutP->owner); |
912 | end_using_sock_user_port(io_object); |
913 | if (OutP->RetCode != KERN_SUCCESS0) |
914 | return; |
915 | |
916 | OutP->Head.msgh_size = 40; |
917 | |
918 | OutP->ownerType = ownerType; |
919 | } |
920 | |
921 | /* Default implementation of S_io_get_owner */ |
922 | #ifdef MIG_EOPNOTSUPP |
923 | kern_return_t __attribute__ ((weak)) |
924 | S_io_get_owner |
925 | ( |
926 | sock_user_t io_object, |
927 | pid_t *owner |
928 | ) { return MIG_EOPNOTSUPP; } |
929 | #endif /* MIG_EOPNOTSUPP */ |
930 | |
931 | /* Routine io_get_icky_async_id */ |
932 | mig_internalstatic void _Xio_get_icky_async_id |
933 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
934 | { |
935 | typedef struct { |
936 | mach_msg_header_t Head; |
937 | } Request; |
938 | |
939 | typedef struct { |
940 | mach_msg_header_t Head; |
941 | mach_msg_type_t RetCodeType; |
942 | kern_return_t RetCode; |
943 | mach_msg_type_t icky_async_id_portType; |
944 | mach_port_t icky_async_id_port; |
945 | } Reply; |
946 | |
947 | Request *In0P = (Request *) InHeadP; |
948 | Reply *OutP = (Reply *) OutHeadP; |
949 | mig_external kern_return_t S_io_get_icky_async_id |
950 | (sock_user_t io_object, mach_port_t *icky_async_id_port, mach_msg_type_name_t *icky_async_id_portPoly); |
951 | |
952 | boolean_t msgh_simple = msgh_simple; |
953 | const mach_msg_type_t icky_async_id_portType = { |
954 | /* msgt_name = */ -1, |
955 | /* msgt_size = */ 32, |
956 | /* msgt_number = */ 1, |
957 | /* msgt_inline = */ TRUE((boolean_t) 1), |
958 | /* msgt_longform = */ FALSE((boolean_t) 0), |
959 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
960 | /* msgt_unused = */ 0 |
961 | }; |
962 | |
963 | sock_user_t io_object; |
964 | mach_msg_type_name_t icky_async_id_portPoly; |
965 | |
966 | #if TypeCheck1 |
967 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
968 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
969 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
970 | #endif /* TypeCheck */ |
971 | |
972 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
973 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
974 | else |
975 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
976 | |
977 | OutP->RetCode = S_io_get_icky_async_id(io_object, &OutP->icky_async_id_port, &icky_async_id_portPoly); |
978 | end_using_sock_user_port(io_object); |
979 | if (OutP->RetCode != KERN_SUCCESS0) |
980 | return; |
981 | |
982 | msgh_simple = TRUE((boolean_t) 1); |
983 | OutP->Head.msgh_size = 40; |
984 | |
985 | OutP->icky_async_id_portType = icky_async_id_portType; |
986 | |
987 | if (MACH_MSG_TYPE_PORT_ANY(icky_async_id_portPoly)(((icky_async_id_portPoly) >= 16) && ((icky_async_id_portPoly ) <= 21))) |
988 | msgh_simple = FALSE((boolean_t) 0); |
989 | |
990 | OutP->icky_async_id_portType.msgt_name = icky_async_id_portPoly; |
991 | |
992 | if (!msgh_simple) |
993 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
994 | } |
995 | |
996 | /* Default implementation of S_io_get_icky_async_id */ |
997 | #ifdef MIG_EOPNOTSUPP |
998 | kern_return_t __attribute__ ((weak)) |
999 | S_io_get_icky_async_id |
1000 | ( |
1001 | sock_user_t io_object, |
1002 | mach_port_t *icky_async_id_port, |
1003 | mach_msg_type_name_t *icky_async_id_portPoly |
1004 | ) { return MIG_EOPNOTSUPP; } |
1005 | #endif /* MIG_EOPNOTSUPP */ |
1006 | |
1007 | /* Routine io_select */ |
1008 | mig_internalstatic void _Xio_select |
1009 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1010 | { |
1011 | typedef struct { |
1012 | mach_msg_header_t Head; |
1013 | mach_msg_type_t select_typeType; |
1014 | int select_type; |
1015 | } Request; |
1016 | |
1017 | typedef struct { |
1018 | mach_msg_header_t Head; |
1019 | mach_msg_type_t RetCodeType; |
1020 | kern_return_t RetCode; |
1021 | mach_msg_type_t select_typeType; |
1022 | int select_type; |
1023 | } Reply; |
1024 | |
1025 | Request *In0P = (Request *) InHeadP; |
1026 | Reply *OutP = (Reply *) OutHeadP; |
1027 | mig_external kern_return_t S_io_select |
1028 | (sock_user_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int *select_type); |
1029 | |
1030 | const mach_msg_type_t select_typeCheck = { |
1031 | /* msgt_name = */ 2, |
1032 | /* msgt_size = */ 32, |
1033 | /* msgt_number = */ 1, |
1034 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1035 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1036 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1037 | /* msgt_unused = */ 0 |
1038 | }; |
1039 | |
1040 | const mach_msg_type_t select_typeType = { |
1041 | /* msgt_name = */ 2, |
1042 | /* msgt_size = */ 32, |
1043 | /* msgt_number = */ 1, |
1044 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1045 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1046 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1047 | /* msgt_unused = */ 0 |
1048 | }; |
1049 | |
1050 | sock_user_t io_object; |
1051 | mach_port_t reply; |
1052 | |
1053 | #if TypeCheck1 |
1054 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1055 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1056 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1057 | #endif /* TypeCheck */ |
1058 | |
1059 | #if TypeCheck1 |
1060 | if (BAD_TYPECHECK(&In0P->select_typeType, &select_typeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->select_typeType); _c.t = *(&select_typeCheck);_t.w != _c.w; })), 0)) |
1061 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1062 | #endif /* TypeCheck */ |
1063 | |
1064 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1065 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1066 | else |
1067 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1068 | |
1069 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
1070 | |
1071 | OutP->RetCode = S_io_select(io_object, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &In0P->select_type); |
1072 | end_using_sock_user_port(io_object); |
1073 | if (OutP->RetCode != KERN_SUCCESS0) |
1074 | return; |
1075 | |
1076 | OutP->Head.msgh_size = 40; |
1077 | |
1078 | OutP->select_typeType = select_typeType; |
1079 | |
1080 | OutP->select_type = In0P->select_type; |
1081 | } |
1082 | |
1083 | /* Default implementation of S_io_select */ |
1084 | #ifdef MIG_EOPNOTSUPP |
1085 | kern_return_t __attribute__ ((weak)) |
1086 | S_io_select |
1087 | ( |
1088 | sock_user_t io_object, |
1089 | mach_port_t reply, |
1090 | mach_msg_type_name_t replyPoly, |
1091 | int *select_type |
1092 | ) { return MIG_EOPNOTSUPP; } |
1093 | #endif /* MIG_EOPNOTSUPP */ |
1094 | |
1095 | /* Routine io_stat */ |
1096 | mig_internalstatic void _Xio_stat |
1097 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1098 | { |
1099 | typedef struct { |
1100 | mach_msg_header_t Head; |
1101 | } Request; |
1102 | |
1103 | typedef struct { |
1104 | mach_msg_header_t Head; |
1105 | mach_msg_type_t RetCodeType; |
1106 | kern_return_t RetCode; |
1107 | mach_msg_type_t stat_infoType; |
1108 | io_statbuf_t stat_info; |
1109 | } Reply; |
1110 | |
1111 | Request *In0P = (Request *) InHeadP; |
1112 | Reply *OutP = (Reply *) OutHeadP; |
1113 | mig_external kern_return_t S_io_stat |
1114 | (sock_user_t stat_object, io_statbuf_t *stat_info); |
1115 | |
1116 | const mach_msg_type_t stat_infoType = { |
1117 | /* msgt_name = */ 2, |
1118 | /* msgt_size = */ 32, |
1119 | /* msgt_number = */ 32, |
1120 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1121 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1122 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1123 | /* msgt_unused = */ 0 |
1124 | }; |
1125 | |
1126 | sock_user_t stat_object; |
1127 | |
1128 | #if TypeCheck1 |
1129 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1130 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1131 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1132 | #endif /* TypeCheck */ |
1133 | |
1134 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1135 | stat_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1136 | else |
1137 | stat_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1138 | |
1139 | OutP->RetCode = S_io_stat(stat_object, &OutP->stat_info); |
1140 | end_using_sock_user_port(stat_object); |
1141 | if (OutP->RetCode != KERN_SUCCESS0) |
1142 | return; |
1143 | |
1144 | OutP->Head.msgh_size = 164; |
1145 | |
1146 | OutP->stat_infoType = stat_infoType; |
1147 | } |
1148 | |
1149 | /* Default implementation of S_io_stat */ |
1150 | #ifdef MIG_EOPNOTSUPP |
1151 | kern_return_t __attribute__ ((weak)) |
1152 | S_io_stat |
1153 | ( |
1154 | sock_user_t stat_object, |
1155 | io_statbuf_t *stat_info |
1156 | ) { return MIG_EOPNOTSUPP; } |
1157 | #endif /* MIG_EOPNOTSUPP */ |
1158 | |
1159 | /* SimpleRoutine io_reauthenticate */ |
1160 | mig_internalstatic void _Xio_reauthenticate |
1161 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1162 | { |
1163 | typedef struct { |
1164 | mach_msg_header_t Head; |
1165 | mach_msg_type_t rendezvous2Type; |
1166 | mach_port_t rendezvous2; |
1167 | } Request; |
1168 | |
1169 | typedef struct { |
1170 | mach_msg_header_t Head; |
1171 | mach_msg_type_t RetCodeType; |
1172 | kern_return_t RetCode; |
1173 | } Reply; |
1174 | |
1175 | Request *In0P = (Request *) InHeadP; |
1176 | Reply *OutP = (Reply *) OutHeadP; |
1177 | mig_external kern_return_t S_io_reauthenticate |
1178 | (sock_user_t auth_object, mach_port_t rendezvous2); |
1179 | |
1180 | const mach_msg_type_t rendezvous2Check = { |
1181 | /* msgt_name = */ 17, |
1182 | /* msgt_size = */ 32, |
1183 | /* msgt_number = */ 1, |
1184 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1185 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1186 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1187 | /* msgt_unused = */ 0 |
1188 | }; |
1189 | |
1190 | sock_user_t auth_object; |
1191 | |
1192 | #if TypeCheck1 |
1193 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1194 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1195 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1196 | #endif /* TypeCheck */ |
1197 | |
1198 | #if TypeCheck1 |
1199 | if (BAD_TYPECHECK(&In0P->rendezvous2Type, &rendezvous2Check)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->rendezvous2Type); _c.t = *(&rendezvous2Check);_t.w != _c.w; })), 0)) |
1200 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1201 | #endif /* TypeCheck */ |
1202 | |
1203 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1204 | auth_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1205 | else |
1206 | auth_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1207 | |
1208 | OutP->RetCode = S_io_reauthenticate(auth_object, In0P->rendezvous2); |
1209 | end_using_sock_user_port(auth_object); |
1210 | } |
1211 | |
1212 | /* Default implementation of S_io_reauthenticate */ |
1213 | #ifdef MIG_EOPNOTSUPP |
1214 | kern_return_t __attribute__ ((weak)) |
1215 | S_io_reauthenticate |
1216 | ( |
1217 | sock_user_t auth_object, |
1218 | mach_port_t rendezvous2 |
1219 | ) { return MIG_EOPNOTSUPP; } |
1220 | #endif /* MIG_EOPNOTSUPP */ |
1221 | |
1222 | /* Routine io_restrict_auth */ |
1223 | mig_internalstatic void _Xio_restrict_auth |
1224 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1225 | { |
1226 | typedef struct { |
1227 | mach_msg_header_t Head; |
1228 | mach_msg_type_long_t uidsType; |
1229 | uid_t uids[512]; |
1230 | mach_msg_type_long_t gidsType; |
1231 | uid_t gids[512]; |
1232 | } Request; |
1233 | |
1234 | typedef struct { |
1235 | mach_msg_header_t Head; |
1236 | mach_msg_type_t RetCodeType; |
1237 | kern_return_t RetCode; |
1238 | mach_msg_type_t new_objectType; |
1239 | mach_port_t new_object; |
1240 | } Reply; |
1241 | |
1242 | Request *In0P = (Request *) InHeadP; |
1243 | Request *In1P; |
1244 | Reply *OutP = (Reply *) OutHeadP; |
1245 | mig_external kern_return_t S_io_restrict_auth |
1246 | (sock_user_t io_object, mach_port_t *new_object, mach_msg_type_name_t *new_objectPoly, idarray_t uids, mach_msg_type_number_t uidsCnt, idarray_t gids, mach_msg_type_number_t gidsCnt); |
1247 | |
1248 | boolean_t msgh_simple = msgh_simple; |
1249 | unsigned int msgh_size; |
1250 | unsigned int msgh_size_delta; |
1251 | |
1252 | const mach_msg_type_t new_objectType = { |
1253 | /* msgt_name = */ -1, |
1254 | /* msgt_size = */ 32, |
1255 | /* msgt_number = */ 1, |
1256 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1257 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1258 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1259 | /* msgt_unused = */ 0 |
1260 | }; |
1261 | |
1262 | sock_user_t io_object; |
1263 | mach_msg_type_name_t new_objectPoly; |
1264 | |
1265 | #if TypeCheck1 |
1266 | msgh_size = In0P->Head.msgh_size; |
1267 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
1268 | if (mig_unlikely ((msgh_size < 48))__builtin_expect (!! ((msgh_size < 48)), 0)) |
1269 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1270 | #endif /* TypeCheck */ |
1271 | |
1272 | #if TypeCheck1 |
1273 | if (mig_unlikely ((In0P->uidsType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In0P->uidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->uidsType.msgtl_name != 2) || (In0P->uidsType.msgtl_size != 32)), 0) |
1274 | (In0P->uidsType.msgtl_name != 2) ||__builtin_expect (!! ((In0P->uidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->uidsType.msgtl_name != 2) || (In0P->uidsType.msgtl_size != 32)), 0) |
1275 | (In0P->uidsType.msgtl_size != 32))__builtin_expect (!! ((In0P->uidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->uidsType.msgtl_name != 2) || (In0P->uidsType.msgtl_size != 32)), 0)) |
1276 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1277 | #endif /* TypeCheck */ |
1278 | |
1279 | msgh_size_delta = (In0P->uidsType.msgtl_header.msgt_inline) ? 4 * In0P->uidsType.msgtl_number : sizeof(uid_t *); |
1280 | #if TypeCheck1 |
1281 | if (mig_unlikely (msgh_size < 48 + msgh_size_delta)__builtin_expect (!! (msgh_size < 48 + msgh_size_delta), 0 )) |
1282 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1283 | msgh_size -= msgh_size_delta; |
1284 | #endif /* TypeCheck */ |
1285 | |
1286 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
1287 | |
1288 | #if TypeCheck1 |
1289 | if (mig_unlikely ((In1P->gidsType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In1P->gidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->gidsType.msgtl_name != 2) || (In1P->gidsType.msgtl_size != 32)), 0) |
1290 | (In1P->gidsType.msgtl_name != 2) ||__builtin_expect (!! ((In1P->gidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->gidsType.msgtl_name != 2) || (In1P->gidsType.msgtl_size != 32)), 0) |
1291 | (In1P->gidsType.msgtl_size != 32))__builtin_expect (!! ((In1P->gidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->gidsType.msgtl_name != 2) || (In1P->gidsType.msgtl_size != 32)), 0)) |
1292 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1293 | #endif /* TypeCheck */ |
1294 | |
1295 | #if TypeCheck1 |
1296 | if (mig_unlikely (msgh_size != 48 + ((In1P->gidsType.msgtl_header.msgt_inline) ? 4 * In1P->gidsType.msgtl_number : sizeof(uid_t *)))__builtin_expect (!! (msgh_size != 48 + ((In1P->gidsType.msgtl_header .msgt_inline) ? 4 * In1P->gidsType.msgtl_number : sizeof(uid_t *))), 0)) |
1297 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1298 | #endif /* TypeCheck */ |
1299 | |
1300 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1301 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1302 | else |
1303 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1304 | |
1305 | OutP->RetCode = S_io_restrict_auth(io_object, &OutP->new_object, &new_objectPoly, (In0P->uidsType.msgtl_header.msgt_inline) ? In0P->uids : *((uid_t **)In0P->uids), In0P->uidsType.msgtl_number, (In1P->gidsType.msgtl_header.msgt_inline) ? In1P->gids : *((uid_t **)In1P->gids), In1P->gidsType.msgtl_number); |
1306 | if (OutP->RetCode == KERN_SUCCESS0) |
1307 | if (!In1P->gidsType.msgtl_header.msgt_inline) |
1308 | __mig_deallocate(* (vm_offset_t *) In1P->gids, 4 * In1P->gidsType.msgtl_number); |
1309 | if (OutP->RetCode == KERN_SUCCESS0) |
1310 | if (!In0P->uidsType.msgtl_header.msgt_inline) |
1311 | __mig_deallocate(* (vm_offset_t *) In0P->uids, 4 * In0P->uidsType.msgtl_number); |
1312 | end_using_sock_user_port(io_object); |
1313 | if (OutP->RetCode != KERN_SUCCESS0) |
1314 | return; |
1315 | |
1316 | msgh_simple = TRUE((boolean_t) 1); |
1317 | OutP->Head.msgh_size = 40; |
1318 | |
1319 | OutP->new_objectType = new_objectType; |
1320 | |
1321 | if (MACH_MSG_TYPE_PORT_ANY(new_objectPoly)(((new_objectPoly) >= 16) && ((new_objectPoly) <= 21))) |
1322 | msgh_simple = FALSE((boolean_t) 0); |
1323 | |
1324 | OutP->new_objectType.msgt_name = new_objectPoly; |
1325 | |
1326 | if (!msgh_simple) |
1327 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1328 | } |
1329 | |
1330 | /* Default implementation of S_io_restrict_auth */ |
1331 | #ifdef MIG_EOPNOTSUPP |
1332 | kern_return_t __attribute__ ((weak)) |
1333 | S_io_restrict_auth |
1334 | ( |
1335 | sock_user_t io_object, |
1336 | mach_port_t *new_object, |
1337 | mach_msg_type_name_t *new_objectPoly, |
1338 | idarray_t uids, |
1339 | mach_msg_type_number_t uidsCnt, |
1340 | idarray_t gids, |
1341 | mach_msg_type_number_t gidsCnt |
1342 | ) { return MIG_EOPNOTSUPP; } |
1343 | #endif /* MIG_EOPNOTSUPP */ |
1344 | |
1345 | /* Routine io_duplicate */ |
1346 | mig_internalstatic void _Xio_duplicate |
1347 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1348 | { |
1349 | typedef struct { |
1350 | mach_msg_header_t Head; |
1351 | } Request; |
1352 | |
1353 | typedef struct { |
1354 | mach_msg_header_t Head; |
1355 | mach_msg_type_t RetCodeType; |
1356 | kern_return_t RetCode; |
1357 | mach_msg_type_t newportType; |
1358 | mach_port_t newport; |
1359 | } Reply; |
1360 | |
1361 | Request *In0P = (Request *) InHeadP; |
1362 | Reply *OutP = (Reply *) OutHeadP; |
1363 | mig_external kern_return_t S_io_duplicate |
1364 | (sock_user_t io_object, mach_port_t *newport, mach_msg_type_name_t *newportPoly); |
1365 | |
1366 | boolean_t msgh_simple = msgh_simple; |
1367 | const mach_msg_type_t newportType = { |
1368 | /* msgt_name = */ -1, |
1369 | /* msgt_size = */ 32, |
1370 | /* msgt_number = */ 1, |
1371 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1372 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1373 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1374 | /* msgt_unused = */ 0 |
1375 | }; |
1376 | |
1377 | sock_user_t io_object; |
1378 | mach_msg_type_name_t newportPoly; |
1379 | |
1380 | #if TypeCheck1 |
1381 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1382 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1383 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1384 | #endif /* TypeCheck */ |
1385 | |
1386 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1387 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1388 | else |
1389 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1390 | |
1391 | OutP->RetCode = S_io_duplicate(io_object, &OutP->newport, &newportPoly); |
1392 | end_using_sock_user_port(io_object); |
1393 | if (OutP->RetCode != KERN_SUCCESS0) |
1394 | return; |
1395 | |
1396 | msgh_simple = TRUE((boolean_t) 1); |
1397 | OutP->Head.msgh_size = 40; |
1398 | |
1399 | OutP->newportType = newportType; |
1400 | |
1401 | if (MACH_MSG_TYPE_PORT_ANY(newportPoly)(((newportPoly) >= 16) && ((newportPoly) <= 21) )) |
1402 | msgh_simple = FALSE((boolean_t) 0); |
1403 | |
1404 | OutP->newportType.msgt_name = newportPoly; |
1405 | |
1406 | if (!msgh_simple) |
1407 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1408 | } |
1409 | |
1410 | /* Default implementation of S_io_duplicate */ |
1411 | #ifdef MIG_EOPNOTSUPP |
1412 | kern_return_t __attribute__ ((weak)) |
1413 | S_io_duplicate |
1414 | ( |
1415 | sock_user_t io_object, |
1416 | mach_port_t *newport, |
1417 | mach_msg_type_name_t *newportPoly |
1418 | ) { return MIG_EOPNOTSUPP; } |
1419 | #endif /* MIG_EOPNOTSUPP */ |
1420 | |
1421 | /* Routine io_server_version */ |
1422 | mig_internalstatic void _Xio_server_version |
1423 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1424 | { |
1425 | typedef struct { |
1426 | mach_msg_header_t Head; |
1427 | } Request; |
1428 | |
1429 | typedef struct { |
1430 | mach_msg_header_t Head; |
1431 | mach_msg_type_t RetCodeType; |
1432 | kern_return_t RetCode; |
1433 | mach_msg_type_t server_nameType; |
1434 | string_t server_name; |
1435 | mach_msg_type_t server_major_versionType; |
1436 | int server_major_version; |
1437 | mach_msg_type_t server_minor_versionType; |
1438 | int server_minor_version; |
1439 | mach_msg_type_t server_edit_levelType; |
1440 | int server_edit_level; |
1441 | } Reply; |
1442 | |
1443 | Request *In0P = (Request *) InHeadP; |
1444 | Reply *OutP = (Reply *) OutHeadP; |
1445 | mig_external kern_return_t S_io_server_version |
1446 | (sock_user_t vers_object, string_t server_name, int *server_major_version, int *server_minor_version, int *server_edit_level); |
1447 | |
1448 | const mach_msg_type_t server_nameType = { |
1449 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
1450 | /* msgt_size = */ 8, |
1451 | /* msgt_number = */ 1024, |
1452 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1453 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1454 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1455 | /* msgt_unused = */ 0 |
1456 | }; |
1457 | |
1458 | const mach_msg_type_t server_major_versionType = { |
1459 | /* msgt_name = */ 2, |
1460 | /* msgt_size = */ 32, |
1461 | /* msgt_number = */ 1, |
1462 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1463 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1464 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1465 | /* msgt_unused = */ 0 |
1466 | }; |
1467 | |
1468 | const mach_msg_type_t server_minor_versionType = { |
1469 | /* msgt_name = */ 2, |
1470 | /* msgt_size = */ 32, |
1471 | /* msgt_number = */ 1, |
1472 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1473 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1474 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1475 | /* msgt_unused = */ 0 |
1476 | }; |
1477 | |
1478 | const mach_msg_type_t server_edit_levelType = { |
1479 | /* msgt_name = */ 2, |
1480 | /* msgt_size = */ 32, |
1481 | /* msgt_number = */ 1, |
1482 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1483 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1484 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1485 | /* msgt_unused = */ 0 |
1486 | }; |
1487 | |
1488 | sock_user_t vers_object; |
1489 | |
1490 | #if TypeCheck1 |
1491 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1492 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1493 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1494 | #endif /* TypeCheck */ |
1495 | |
1496 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1497 | vers_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1498 | else |
1499 | vers_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1500 | |
1501 | OutP->RetCode = S_io_server_version(vers_object, OutP->server_name, &OutP->server_major_version, &OutP->server_minor_version, &OutP->server_edit_level); |
1502 | end_using_sock_user_port(vers_object); |
1503 | if (OutP->RetCode != KERN_SUCCESS0) |
1504 | return; |
1505 | |
1506 | OutP->Head.msgh_size = 1084; |
1507 | |
1508 | OutP->server_nameType = server_nameType; |
1509 | |
1510 | OutP->server_major_versionType = server_major_versionType; |
1511 | |
1512 | OutP->server_minor_versionType = server_minor_versionType; |
1513 | |
1514 | OutP->server_edit_levelType = server_edit_levelType; |
1515 | } |
1516 | |
1517 | /* Default implementation of S_io_server_version */ |
1518 | #ifdef MIG_EOPNOTSUPP |
1519 | kern_return_t __attribute__ ((weak)) |
1520 | S_io_server_version |
1521 | ( |
1522 | sock_user_t vers_object, |
1523 | string_t server_name, |
1524 | int *server_major_version, |
1525 | int *server_minor_version, |
1526 | int *server_edit_level |
1527 | ) { return MIG_EOPNOTSUPP; } |
1528 | #endif /* MIG_EOPNOTSUPP */ |
1529 | |
1530 | /* Routine io_map */ |
1531 | mig_internalstatic void _Xio_map |
1532 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1533 | { |
1534 | typedef struct { |
1535 | mach_msg_header_t Head; |
1536 | } Request; |
1537 | |
1538 | typedef struct { |
1539 | mach_msg_header_t Head; |
1540 | mach_msg_type_t RetCodeType; |
1541 | kern_return_t RetCode; |
1542 | mach_msg_type_t memobjrdType; |
1543 | mach_port_t memobjrd; |
1544 | mach_msg_type_t memobjwtType; |
1545 | mach_port_t memobjwt; |
1546 | } Reply; |
1547 | |
1548 | Request *In0P = (Request *) InHeadP; |
1549 | Reply *OutP = (Reply *) OutHeadP; |
1550 | mig_external kern_return_t S_io_map |
1551 | (sock_user_t io_object, mach_port_t *memobjrd, mach_msg_type_name_t *memobjrdPoly, mach_port_t *memobjwt, mach_msg_type_name_t *memobjwtPoly); |
1552 | |
1553 | boolean_t msgh_simple = msgh_simple; |
1554 | const mach_msg_type_t memobjrdType = { |
1555 | /* msgt_name = */ -1, |
1556 | /* msgt_size = */ 32, |
1557 | /* msgt_number = */ 1, |
1558 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1559 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1560 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1561 | /* msgt_unused = */ 0 |
1562 | }; |
1563 | |
1564 | const mach_msg_type_t memobjwtType = { |
1565 | /* msgt_name = */ -1, |
1566 | /* msgt_size = */ 32, |
1567 | /* msgt_number = */ 1, |
1568 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1569 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1570 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1571 | /* msgt_unused = */ 0 |
1572 | }; |
1573 | |
1574 | sock_user_t io_object; |
1575 | mach_msg_type_name_t memobjrdPoly; |
1576 | mach_msg_type_name_t memobjwtPoly; |
1577 | |
1578 | #if TypeCheck1 |
1579 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1580 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1581 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1582 | #endif /* TypeCheck */ |
1583 | |
1584 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1585 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1586 | else |
1587 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1588 | |
1589 | OutP->RetCode = S_io_map(io_object, &OutP->memobjrd, &memobjrdPoly, &OutP->memobjwt, &memobjwtPoly); |
1590 | end_using_sock_user_port(io_object); |
1591 | if (OutP->RetCode != KERN_SUCCESS0) |
1592 | return; |
1593 | |
1594 | msgh_simple = TRUE((boolean_t) 1); |
1595 | OutP->Head.msgh_size = 48; |
1596 | |
1597 | OutP->memobjrdType = memobjrdType; |
1598 | |
1599 | if (MACH_MSG_TYPE_PORT_ANY(memobjrdPoly)(((memobjrdPoly) >= 16) && ((memobjrdPoly) <= 21 ))) |
1600 | msgh_simple = FALSE((boolean_t) 0); |
1601 | |
1602 | OutP->memobjrdType.msgt_name = memobjrdPoly; |
1603 | |
1604 | OutP->memobjwtType = memobjwtType; |
1605 | |
1606 | if (MACH_MSG_TYPE_PORT_ANY(memobjwtPoly)(((memobjwtPoly) >= 16) && ((memobjwtPoly) <= 21 ))) |
1607 | msgh_simple = FALSE((boolean_t) 0); |
1608 | |
1609 | OutP->memobjwtType.msgt_name = memobjwtPoly; |
1610 | |
1611 | if (!msgh_simple) |
1612 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1613 | } |
1614 | |
1615 | /* Default implementation of S_io_map */ |
1616 | #ifdef MIG_EOPNOTSUPP |
1617 | kern_return_t __attribute__ ((weak)) |
1618 | S_io_map |
1619 | ( |
1620 | sock_user_t io_object, |
1621 | mach_port_t *memobjrd, |
1622 | mach_msg_type_name_t *memobjrdPoly, |
1623 | mach_port_t *memobjwt, |
1624 | mach_msg_type_name_t *memobjwtPoly |
1625 | ) { return MIG_EOPNOTSUPP; } |
1626 | #endif /* MIG_EOPNOTSUPP */ |
1627 | |
1628 | /* Routine io_map_cntl */ |
1629 | mig_internalstatic void _Xio_map_cntl |
1630 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1631 | { |
1632 | typedef struct { |
1633 | mach_msg_header_t Head; |
1634 | } Request; |
1635 | |
1636 | typedef struct { |
1637 | mach_msg_header_t Head; |
1638 | mach_msg_type_t RetCodeType; |
1639 | kern_return_t RetCode; |
1640 | mach_msg_type_t memobjType; |
1641 | mach_port_t memobj; |
1642 | } Reply; |
1643 | |
1644 | Request *In0P = (Request *) InHeadP; |
1645 | Reply *OutP = (Reply *) OutHeadP; |
1646 | mig_external kern_return_t S_io_map_cntl |
1647 | (sock_user_t io_object, mach_port_t *memobj, mach_msg_type_name_t *memobjPoly); |
1648 | |
1649 | boolean_t msgh_simple = msgh_simple; |
1650 | const mach_msg_type_t memobjType = { |
1651 | /* msgt_name = */ -1, |
1652 | /* msgt_size = */ 32, |
1653 | /* msgt_number = */ 1, |
1654 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1655 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1656 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1657 | /* msgt_unused = */ 0 |
1658 | }; |
1659 | |
1660 | sock_user_t io_object; |
1661 | mach_msg_type_name_t memobjPoly; |
1662 | |
1663 | #if TypeCheck1 |
1664 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1665 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1666 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1667 | #endif /* TypeCheck */ |
1668 | |
1669 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1670 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1671 | else |
1672 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1673 | |
1674 | OutP->RetCode = S_io_map_cntl(io_object, &OutP->memobj, &memobjPoly); |
1675 | end_using_sock_user_port(io_object); |
1676 | if (OutP->RetCode != KERN_SUCCESS0) |
1677 | return; |
1678 | |
1679 | msgh_simple = TRUE((boolean_t) 1); |
1680 | OutP->Head.msgh_size = 40; |
1681 | |
1682 | OutP->memobjType = memobjType; |
1683 | |
1684 | if (MACH_MSG_TYPE_PORT_ANY(memobjPoly)(((memobjPoly) >= 16) && ((memobjPoly) <= 21))) |
1685 | msgh_simple = FALSE((boolean_t) 0); |
1686 | |
1687 | OutP->memobjType.msgt_name = memobjPoly; |
1688 | |
1689 | if (!msgh_simple) |
1690 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1691 | } |
1692 | |
1693 | /* Default implementation of S_io_map_cntl */ |
1694 | #ifdef MIG_EOPNOTSUPP |
1695 | kern_return_t __attribute__ ((weak)) |
1696 | S_io_map_cntl |
1697 | ( |
1698 | sock_user_t io_object, |
1699 | mach_port_t *memobj, |
1700 | mach_msg_type_name_t *memobjPoly |
1701 | ) { return MIG_EOPNOTSUPP; } |
1702 | #endif /* MIG_EOPNOTSUPP */ |
1703 | |
1704 | /* Routine io_get_conch */ |
1705 | mig_internalstatic void _Xio_get_conch |
1706 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1707 | { |
1708 | typedef struct { |
1709 | mach_msg_header_t Head; |
1710 | } Request; |
1711 | |
1712 | typedef struct { |
1713 | mach_msg_header_t Head; |
1714 | mach_msg_type_t RetCodeType; |
1715 | kern_return_t RetCode; |
1716 | } Reply; |
1717 | |
1718 | Request *In0P = (Request *) InHeadP; |
1719 | Reply *OutP = (Reply *) OutHeadP; |
1720 | mig_external kern_return_t S_io_get_conch |
1721 | (sock_user_t io_object); |
1722 | |
1723 | sock_user_t io_object; |
1724 | |
1725 | #if TypeCheck1 |
1726 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1727 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1728 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1729 | #endif /* TypeCheck */ |
1730 | |
1731 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1732 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1733 | else |
1734 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1735 | |
1736 | OutP->RetCode = S_io_get_conch(io_object); |
1737 | end_using_sock_user_port(io_object); |
1738 | } |
1739 | |
1740 | /* Default implementation of S_io_get_conch */ |
1741 | #ifdef MIG_EOPNOTSUPP |
1742 | kern_return_t __attribute__ ((weak)) |
1743 | S_io_get_conch |
1744 | ( |
1745 | sock_user_t io_object |
1746 | ) { return MIG_EOPNOTSUPP; } |
1747 | #endif /* MIG_EOPNOTSUPP */ |
1748 | |
1749 | /* Routine io_release_conch */ |
1750 | mig_internalstatic void _Xio_release_conch |
1751 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1752 | { |
1753 | typedef struct { |
1754 | mach_msg_header_t Head; |
1755 | } Request; |
1756 | |
1757 | typedef struct { |
1758 | mach_msg_header_t Head; |
1759 | mach_msg_type_t RetCodeType; |
1760 | kern_return_t RetCode; |
1761 | } Reply; |
1762 | |
1763 | Request *In0P = (Request *) InHeadP; |
1764 | Reply *OutP = (Reply *) OutHeadP; |
1765 | mig_external kern_return_t S_io_release_conch |
1766 | (sock_user_t io_object); |
1767 | |
1768 | sock_user_t io_object; |
1769 | |
1770 | #if TypeCheck1 |
1771 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1772 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1773 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1774 | #endif /* TypeCheck */ |
1775 | |
1776 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1777 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1778 | else |
1779 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1780 | |
1781 | OutP->RetCode = S_io_release_conch(io_object); |
1782 | end_using_sock_user_port(io_object); |
1783 | } |
1784 | |
1785 | /* Default implementation of S_io_release_conch */ |
1786 | #ifdef MIG_EOPNOTSUPP |
1787 | kern_return_t __attribute__ ((weak)) |
1788 | S_io_release_conch |
1789 | ( |
1790 | sock_user_t io_object |
1791 | ) { return MIG_EOPNOTSUPP; } |
1792 | #endif /* MIG_EOPNOTSUPP */ |
1793 | |
1794 | /* Routine io_eofnotify */ |
1795 | mig_internalstatic void _Xio_eofnotify |
1796 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1797 | { |
1798 | typedef struct { |
1799 | mach_msg_header_t Head; |
1800 | } Request; |
1801 | |
1802 | typedef struct { |
1803 | mach_msg_header_t Head; |
1804 | mach_msg_type_t RetCodeType; |
1805 | kern_return_t RetCode; |
1806 | } Reply; |
1807 | |
1808 | Request *In0P = (Request *) InHeadP; |
1809 | Reply *OutP = (Reply *) OutHeadP; |
1810 | mig_external kern_return_t S_io_eofnotify |
1811 | (sock_user_t io_object); |
1812 | |
1813 | sock_user_t io_object; |
1814 | |
1815 | #if TypeCheck1 |
1816 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1817 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1818 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1819 | #endif /* TypeCheck */ |
1820 | |
1821 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1822 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1823 | else |
1824 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1825 | |
1826 | OutP->RetCode = S_io_eofnotify(io_object); |
1827 | end_using_sock_user_port(io_object); |
1828 | } |
1829 | |
1830 | /* Default implementation of S_io_eofnotify */ |
1831 | #ifdef MIG_EOPNOTSUPP |
1832 | kern_return_t __attribute__ ((weak)) |
1833 | S_io_eofnotify |
1834 | ( |
1835 | sock_user_t io_object |
1836 | ) { return MIG_EOPNOTSUPP; } |
1837 | #endif /* MIG_EOPNOTSUPP */ |
1838 | |
1839 | /* Routine io_prenotify */ |
1840 | mig_internalstatic void _Xio_prenotify |
1841 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1842 | { |
1843 | typedef struct { |
1844 | mach_msg_header_t Head; |
1845 | mach_msg_type_t write_startType; |
1846 | vm_offset_t write_start; |
1847 | mach_msg_type_t write_endType; |
1848 | vm_offset_t write_end; |
1849 | } Request; |
1850 | |
1851 | typedef struct { |
1852 | mach_msg_header_t Head; |
1853 | mach_msg_type_t RetCodeType; |
1854 | kern_return_t RetCode; |
1855 | } Reply; |
1856 | |
1857 | Request *In0P = (Request *) InHeadP; |
1858 | Reply *OutP = (Reply *) OutHeadP; |
1859 | mig_external kern_return_t S_io_prenotify |
1860 | (sock_user_t io_object, vm_offset_t write_start, vm_offset_t write_end); |
1861 | |
1862 | const mach_msg_type_t write_startCheck = { |
1863 | /* msgt_name = */ 2, |
1864 | /* msgt_size = */ 32, |
1865 | /* msgt_number = */ 1, |
1866 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1867 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1868 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1869 | /* msgt_unused = */ 0 |
1870 | }; |
1871 | |
1872 | const mach_msg_type_t write_endCheck = { |
1873 | /* msgt_name = */ 2, |
1874 | /* msgt_size = */ 32, |
1875 | /* msgt_number = */ 1, |
1876 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1877 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1878 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1879 | /* msgt_unused = */ 0 |
1880 | }; |
1881 | |
1882 | sock_user_t io_object; |
1883 | |
1884 | #if TypeCheck1 |
1885 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1886 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1887 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1888 | #endif /* TypeCheck */ |
1889 | |
1890 | #if TypeCheck1 |
1891 | if (BAD_TYPECHECK(&In0P->write_startType, &write_startCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_startType); _c.t = *(&write_startCheck);_t.w != _c.w; })), 0)) |
1892 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1893 | #endif /* TypeCheck */ |
1894 | |
1895 | #if TypeCheck1 |
1896 | if (BAD_TYPECHECK(&In0P->write_endType, &write_endCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_endType); _c.t = * (&write_endCheck);_t.w != _c.w; })), 0)) |
1897 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1898 | #endif /* TypeCheck */ |
1899 | |
1900 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1901 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1902 | else |
1903 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1904 | |
1905 | OutP->RetCode = S_io_prenotify(io_object, In0P->write_start, In0P->write_end); |
1906 | end_using_sock_user_port(io_object); |
1907 | } |
1908 | |
1909 | /* Default implementation of S_io_prenotify */ |
1910 | #ifdef MIG_EOPNOTSUPP |
1911 | kern_return_t __attribute__ ((weak)) |
1912 | S_io_prenotify |
1913 | ( |
1914 | sock_user_t io_object, |
1915 | vm_offset_t write_start, |
1916 | vm_offset_t write_end |
1917 | ) { return MIG_EOPNOTSUPP; } |
1918 | #endif /* MIG_EOPNOTSUPP */ |
1919 | |
1920 | /* Routine io_postnotify */ |
1921 | mig_internalstatic void _Xio_postnotify |
1922 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1923 | { |
1924 | typedef struct { |
1925 | mach_msg_header_t Head; |
1926 | mach_msg_type_t write_startType; |
1927 | vm_offset_t write_start; |
1928 | mach_msg_type_t write_endType; |
1929 | vm_offset_t write_end; |
1930 | } Request; |
1931 | |
1932 | typedef struct { |
1933 | mach_msg_header_t Head; |
1934 | mach_msg_type_t RetCodeType; |
1935 | kern_return_t RetCode; |
1936 | } Reply; |
1937 | |
1938 | Request *In0P = (Request *) InHeadP; |
1939 | Reply *OutP = (Reply *) OutHeadP; |
1940 | mig_external kern_return_t S_io_postnotify |
1941 | (sock_user_t io_object, vm_offset_t write_start, vm_offset_t write_end); |
1942 | |
1943 | const mach_msg_type_t write_startCheck = { |
1944 | /* msgt_name = */ 2, |
1945 | /* msgt_size = */ 32, |
1946 | /* msgt_number = */ 1, |
1947 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1948 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1949 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1950 | /* msgt_unused = */ 0 |
1951 | }; |
1952 | |
1953 | const mach_msg_type_t write_endCheck = { |
1954 | /* msgt_name = */ 2, |
1955 | /* msgt_size = */ 32, |
1956 | /* msgt_number = */ 1, |
1957 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1958 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1959 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1960 | /* msgt_unused = */ 0 |
1961 | }; |
1962 | |
1963 | sock_user_t io_object; |
1964 | |
1965 | #if TypeCheck1 |
1966 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1967 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1968 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1969 | #endif /* TypeCheck */ |
1970 | |
1971 | #if TypeCheck1 |
1972 | if (BAD_TYPECHECK(&In0P->write_startType, &write_startCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_startType); _c.t = *(&write_startCheck);_t.w != _c.w; })), 0)) |
1973 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1974 | #endif /* TypeCheck */ |
1975 | |
1976 | #if TypeCheck1 |
1977 | if (BAD_TYPECHECK(&In0P->write_endType, &write_endCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_endType); _c.t = * (&write_endCheck);_t.w != _c.w; })), 0)) |
1978 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1979 | #endif /* TypeCheck */ |
1980 | |
1981 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
1982 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
1983 | else |
1984 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
1985 | |
1986 | OutP->RetCode = S_io_postnotify(io_object, In0P->write_start, In0P->write_end); |
1987 | end_using_sock_user_port(io_object); |
1988 | } |
1989 | |
1990 | /* Default implementation of S_io_postnotify */ |
1991 | #ifdef MIG_EOPNOTSUPP |
1992 | kern_return_t __attribute__ ((weak)) |
1993 | S_io_postnotify |
1994 | ( |
1995 | sock_user_t io_object, |
1996 | vm_offset_t write_start, |
1997 | vm_offset_t write_end |
1998 | ) { return MIG_EOPNOTSUPP; } |
1999 | #endif /* MIG_EOPNOTSUPP */ |
2000 | |
2001 | /* Routine io_readnotify */ |
2002 | mig_internalstatic void _Xio_readnotify |
2003 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2004 | { |
2005 | typedef struct { |
2006 | mach_msg_header_t Head; |
2007 | } Request; |
2008 | |
2009 | typedef struct { |
2010 | mach_msg_header_t Head; |
2011 | mach_msg_type_t RetCodeType; |
2012 | kern_return_t RetCode; |
2013 | } Reply; |
2014 | |
2015 | Request *In0P = (Request *) InHeadP; |
2016 | Reply *OutP = (Reply *) OutHeadP; |
2017 | mig_external kern_return_t S_io_readnotify |
2018 | (sock_user_t io_object); |
2019 | |
2020 | sock_user_t io_object; |
2021 | |
2022 | #if TypeCheck1 |
2023 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2024 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2025 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2026 | #endif /* TypeCheck */ |
2027 | |
2028 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
2029 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
2030 | else |
2031 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
2032 | |
2033 | OutP->RetCode = S_io_readnotify(io_object); |
2034 | end_using_sock_user_port(io_object); |
2035 | } |
2036 | |
2037 | /* Default implementation of S_io_readnotify */ |
2038 | #ifdef MIG_EOPNOTSUPP |
2039 | kern_return_t __attribute__ ((weak)) |
2040 | S_io_readnotify |
2041 | ( |
2042 | sock_user_t io_object |
2043 | ) { return MIG_EOPNOTSUPP; } |
2044 | #endif /* MIG_EOPNOTSUPP */ |
2045 | |
2046 | /* Routine io_readsleep */ |
2047 | mig_internalstatic void _Xio_readsleep |
2048 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2049 | { |
2050 | typedef struct { |
2051 | mach_msg_header_t Head; |
2052 | } Request; |
2053 | |
2054 | typedef struct { |
2055 | mach_msg_header_t Head; |
2056 | mach_msg_type_t RetCodeType; |
2057 | kern_return_t RetCode; |
2058 | } Reply; |
2059 | |
2060 | Request *In0P = (Request *) InHeadP; |
2061 | Reply *OutP = (Reply *) OutHeadP; |
2062 | mig_external kern_return_t S_io_readsleep |
2063 | (sock_user_t io_object); |
2064 | |
2065 | sock_user_t io_object; |
2066 | |
2067 | #if TypeCheck1 |
2068 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2069 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2070 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2071 | #endif /* TypeCheck */ |
2072 | |
2073 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
2074 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
2075 | else |
2076 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
2077 | |
2078 | OutP->RetCode = S_io_readsleep(io_object); |
2079 | end_using_sock_user_port(io_object); |
2080 | } |
2081 | |
2082 | /* Default implementation of S_io_readsleep */ |
2083 | #ifdef MIG_EOPNOTSUPP |
2084 | kern_return_t __attribute__ ((weak)) |
2085 | S_io_readsleep |
2086 | ( |
2087 | sock_user_t io_object |
2088 | ) { return MIG_EOPNOTSUPP; } |
2089 | #endif /* MIG_EOPNOTSUPP */ |
2090 | |
2091 | /* Routine io_sigio */ |
2092 | mig_internalstatic void _Xio_sigio |
2093 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2094 | { |
2095 | typedef struct { |
2096 | mach_msg_header_t Head; |
2097 | } Request; |
2098 | |
2099 | typedef struct { |
2100 | mach_msg_header_t Head; |
2101 | mach_msg_type_t RetCodeType; |
2102 | kern_return_t RetCode; |
2103 | } Reply; |
2104 | |
2105 | Request *In0P = (Request *) InHeadP; |
2106 | Reply *OutP = (Reply *) OutHeadP; |
2107 | mig_external kern_return_t S_io_sigio |
2108 | (sock_user_t io_object); |
2109 | |
2110 | sock_user_t io_object; |
2111 | |
2112 | #if TypeCheck1 |
2113 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2114 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2115 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2116 | #endif /* TypeCheck */ |
2117 | |
2118 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
2119 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
2120 | else |
2121 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
2122 | |
2123 | OutP->RetCode = S_io_sigio(io_object); |
2124 | end_using_sock_user_port(io_object); |
2125 | } |
2126 | |
2127 | /* Default implementation of S_io_sigio */ |
2128 | #ifdef MIG_EOPNOTSUPP |
2129 | kern_return_t __attribute__ ((weak)) |
2130 | S_io_sigio |
2131 | ( |
2132 | sock_user_t io_object |
2133 | ) { return MIG_EOPNOTSUPP; } |
2134 | #endif /* MIG_EOPNOTSUPP */ |
2135 | |
2136 | /* Routine io_pathconf */ |
2137 | mig_internalstatic void _Xio_pathconf |
2138 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2139 | { |
2140 | typedef struct { |
2141 | mach_msg_header_t Head; |
2142 | mach_msg_type_t nameType; |
2143 | int name; |
2144 | } Request; |
2145 | |
2146 | typedef struct { |
2147 | mach_msg_header_t Head; |
2148 | mach_msg_type_t RetCodeType; |
2149 | kern_return_t RetCode; |
2150 | mach_msg_type_t valueType; |
2151 | int value; |
2152 | } Reply; |
2153 | |
2154 | Request *In0P = (Request *) InHeadP; |
2155 | Reply *OutP = (Reply *) OutHeadP; |
2156 | mig_external kern_return_t S_io_pathconf |
2157 | (sock_user_t io_object, int name, int *value); |
2158 | |
2159 | const mach_msg_type_t nameCheck = { |
2160 | /* msgt_name = */ 2, |
2161 | /* msgt_size = */ 32, |
2162 | /* msgt_number = */ 1, |
2163 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2164 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2165 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2166 | /* msgt_unused = */ 0 |
2167 | }; |
2168 | |
2169 | const mach_msg_type_t valueType = { |
2170 | /* msgt_name = */ 2, |
2171 | /* msgt_size = */ 32, |
2172 | /* msgt_number = */ 1, |
2173 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2174 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2175 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2176 | /* msgt_unused = */ 0 |
2177 | }; |
2178 | |
2179 | sock_user_t io_object; |
2180 | |
2181 | #if TypeCheck1 |
2182 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2183 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2184 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2185 | #endif /* TypeCheck */ |
2186 | |
2187 | #if TypeCheck1 |
2188 | if (BAD_TYPECHECK(&In0P->nameType, &nameCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->nameType); _c.t = *(& nameCheck);_t.w != _c.w; })), 0)) |
2189 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2190 | #endif /* TypeCheck */ |
2191 | |
2192 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
2193 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
2194 | else |
2195 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
2196 | |
2197 | OutP->RetCode = S_io_pathconf(io_object, In0P->name, &OutP->value); |
2198 | end_using_sock_user_port(io_object); |
2199 | if (OutP->RetCode != KERN_SUCCESS0) |
2200 | return; |
2201 | |
2202 | OutP->Head.msgh_size = 40; |
2203 | |
2204 | OutP->valueType = valueType; |
2205 | } |
2206 | |
2207 | /* Default implementation of S_io_pathconf */ |
2208 | #ifdef MIG_EOPNOTSUPP |
2209 | kern_return_t __attribute__ ((weak)) |
2210 | S_io_pathconf |
2211 | ( |
2212 | sock_user_t io_object, |
2213 | int name, |
2214 | int *value |
2215 | ) { return MIG_EOPNOTSUPP; } |
2216 | #endif /* MIG_EOPNOTSUPP */ |
2217 | |
2218 | /* Routine io_identity */ |
2219 | mig_internalstatic void _Xio_identity |
2220 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2221 | { |
2222 | typedef struct { |
2223 | mach_msg_header_t Head; |
2224 | } Request; |
2225 | |
2226 | typedef struct { |
2227 | mach_msg_header_t Head; |
2228 | mach_msg_type_t RetCodeType; |
2229 | kern_return_t RetCode; |
2230 | mach_msg_type_t idportType; |
2231 | mach_port_t idport; |
2232 | mach_msg_type_t fsidportType; |
2233 | mach_port_t fsidport; |
2234 | mach_msg_type_t filenoType; |
2235 | ino64_t fileno; |
2236 | } Reply; |
2237 | |
2238 | Request *In0P = (Request *) InHeadP; |
2239 | Reply *OutP = (Reply *) OutHeadP; |
2240 | mig_external kern_return_t S_io_identity |
2241 | (sock_user_t io_object, mach_port_t *idport, mach_msg_type_name_t *idportPoly, mach_port_t *fsidport, mach_msg_type_name_t *fsidportPoly, ino64_t *fileno); |
2242 | |
2243 | boolean_t msgh_simple = msgh_simple; |
2244 | const mach_msg_type_t idportType = { |
2245 | /* msgt_name = */ -1, |
2246 | /* msgt_size = */ 32, |
2247 | /* msgt_number = */ 1, |
2248 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2249 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2250 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2251 | /* msgt_unused = */ 0 |
2252 | }; |
2253 | |
2254 | const mach_msg_type_t fsidportType = { |
2255 | /* msgt_name = */ -1, |
2256 | /* msgt_size = */ 32, |
2257 | /* msgt_number = */ 1, |
2258 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2259 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2260 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2261 | /* msgt_unused = */ 0 |
2262 | }; |
2263 | |
2264 | const mach_msg_type_t filenoType = { |
2265 | /* msgt_name = */ 11, |
2266 | /* msgt_size = */ 64, |
2267 | /* msgt_number = */ 1, |
2268 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2269 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2270 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2271 | /* msgt_unused = */ 0 |
2272 | }; |
2273 | |
2274 | sock_user_t io_object; |
2275 | mach_msg_type_name_t idportPoly; |
2276 | mach_msg_type_name_t fsidportPoly; |
2277 | |
2278 | #if TypeCheck1 |
2279 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2280 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2281 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2282 | #endif /* TypeCheck */ |
2283 | |
2284 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
2285 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
2286 | else |
2287 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
2288 | |
2289 | OutP->RetCode = S_io_identity(io_object, &OutP->idport, &idportPoly, &OutP->fsidport, &fsidportPoly, &OutP->fileno); |
2290 | end_using_sock_user_port(io_object); |
2291 | if (OutP->RetCode != KERN_SUCCESS0) |
2292 | return; |
2293 | |
2294 | msgh_simple = TRUE((boolean_t) 1); |
2295 | OutP->Head.msgh_size = 60; |
2296 | |
2297 | OutP->idportType = idportType; |
2298 | |
2299 | if (MACH_MSG_TYPE_PORT_ANY(idportPoly)(((idportPoly) >= 16) && ((idportPoly) <= 21))) |
2300 | msgh_simple = FALSE((boolean_t) 0); |
2301 | |
2302 | OutP->idportType.msgt_name = idportPoly; |
2303 | |
2304 | OutP->fsidportType = fsidportType; |
2305 | |
2306 | if (MACH_MSG_TYPE_PORT_ANY(fsidportPoly)(((fsidportPoly) >= 16) && ((fsidportPoly) <= 21 ))) |
2307 | msgh_simple = FALSE((boolean_t) 0); |
2308 | |
2309 | OutP->fsidportType.msgt_name = fsidportPoly; |
2310 | |
2311 | OutP->filenoType = filenoType; |
2312 | |
2313 | if (!msgh_simple) |
2314 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
2315 | } |
2316 | |
2317 | /* Default implementation of S_io_identity */ |
2318 | #ifdef MIG_EOPNOTSUPP |
2319 | kern_return_t __attribute__ ((weak)) |
2320 | S_io_identity |
2321 | ( |
2322 | sock_user_t io_object, |
2323 | mach_port_t *idport, |
2324 | mach_msg_type_name_t *idportPoly, |
2325 | mach_port_t *fsidport, |
2326 | mach_msg_type_name_t *fsidportPoly, |
2327 | ino64_t *fileno |
2328 | ) { return MIG_EOPNOTSUPP; } |
2329 | #endif /* MIG_EOPNOTSUPP */ |
2330 | |
2331 | /* Routine io_revoke */ |
2332 | mig_internalstatic void _Xio_revoke |
2333 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2334 | { |
2335 | typedef struct { |
2336 | mach_msg_header_t Head; |
2337 | } Request; |
2338 | |
2339 | typedef struct { |
2340 | mach_msg_header_t Head; |
2341 | mach_msg_type_t RetCodeType; |
2342 | kern_return_t RetCode; |
2343 | } Reply; |
2344 | |
2345 | Request *In0P = (Request *) InHeadP; |
2346 | Reply *OutP = (Reply *) OutHeadP; |
2347 | mig_external kern_return_t S_io_revoke |
2348 | (sock_user_t io_object); |
2349 | |
2350 | sock_user_t io_object; |
2351 | |
2352 | #if TypeCheck1 |
2353 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2354 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2355 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2356 | #endif /* TypeCheck */ |
2357 | |
2358 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
2359 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
2360 | else |
2361 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
2362 | |
2363 | OutP->RetCode = S_io_revoke(io_object); |
2364 | end_using_sock_user_port(io_object); |
2365 | } |
2366 | |
2367 | /* Default implementation of S_io_revoke */ |
2368 | #ifdef MIG_EOPNOTSUPP |
2369 | kern_return_t __attribute__ ((weak)) |
2370 | S_io_revoke |
2371 | ( |
2372 | sock_user_t io_object |
2373 | ) { return MIG_EOPNOTSUPP; } |
2374 | #endif /* MIG_EOPNOTSUPP */ |
2375 | |
2376 | /* Routine io_select_timeout */ |
2377 | mig_internalstatic void _Xio_select_timeout |
2378 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2379 | { |
2380 | typedef struct { |
2381 | mach_msg_header_t Head; |
2382 | mach_msg_type_t timeoutType; |
2383 | timespec_t timeout; |
2384 | mach_msg_type_t select_typeType; |
2385 | int select_type; |
2386 | } Request; |
2387 | |
2388 | typedef struct { |
2389 | mach_msg_header_t Head; |
2390 | mach_msg_type_t RetCodeType; |
2391 | kern_return_t RetCode; |
2392 | mach_msg_type_t select_typeType; |
2393 | int select_type; |
2394 | } Reply; |
2395 | |
2396 | Request *In0P = (Request *) InHeadP; |
2397 | Reply *OutP = (Reply *) OutHeadP; |
2398 | mig_external kern_return_t S_io_select_timeout |
2399 | (sock_user_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, timespec_t timeout, int *select_type); |
2400 | |
2401 | const mach_msg_type_t timeoutCheck = { |
2402 | /* msgt_name = */ 2, |
2403 | /* msgt_size = */ 32, |
2404 | /* msgt_number = */ 2, |
2405 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2406 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2407 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2408 | /* msgt_unused = */ 0 |
2409 | }; |
2410 | |
2411 | const mach_msg_type_t select_typeCheck = { |
2412 | /* msgt_name = */ 2, |
2413 | /* msgt_size = */ 32, |
2414 | /* msgt_number = */ 1, |
2415 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2416 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2417 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2418 | /* msgt_unused = */ 0 |
2419 | }; |
2420 | |
2421 | const mach_msg_type_t select_typeType = { |
2422 | /* msgt_name = */ 2, |
2423 | /* msgt_size = */ 32, |
2424 | /* msgt_number = */ 1, |
2425 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2426 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2427 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2428 | /* msgt_unused = */ 0 |
2429 | }; |
2430 | |
2431 | sock_user_t io_object; |
2432 | mach_port_t reply; |
2433 | |
2434 | #if TypeCheck1 |
2435 | if (mig_unlikely ((In0P->Head.msgh_size != 44) ||__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2436 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2437 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2438 | #endif /* TypeCheck */ |
2439 | |
2440 | #if TypeCheck1 |
2441 | if (BAD_TYPECHECK(&In0P->timeoutType, &timeoutCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->timeoutType); _c.t = *(& timeoutCheck);_t.w != _c.w; })), 0)) |
2442 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2443 | #endif /* TypeCheck */ |
2444 | |
2445 | #if TypeCheck1 |
2446 | if (BAD_TYPECHECK(&In0P->select_typeType, &select_typeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->select_typeType); _c.t = *(&select_typeCheck);_t.w != _c.w; })), 0)) |
2447 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2448 | #endif /* TypeCheck */ |
2449 | |
2450 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
2451 | io_object = begin_using_sock_user_payload(In0P->Head.msgh_protected_payload); |
2452 | else |
2453 | io_object = begin_using_sock_user_port(In0P->Head.msgh_request_portmsgh_local_port); |
2454 | |
2455 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
2456 | |
2457 | OutP->RetCode = S_io_select_timeout(io_object, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->timeout, &In0P->select_type); |
2458 | end_using_sock_user_port(io_object); |
2459 | if (OutP->RetCode != KERN_SUCCESS0) |
2460 | return; |
2461 | |
2462 | OutP->Head.msgh_size = 40; |
2463 | |
2464 | OutP->select_typeType = select_typeType; |
2465 | |
2466 | OutP->select_type = In0P->select_type; |
2467 | } |
2468 | |
2469 | /* Default implementation of S_io_select_timeout */ |
2470 | #ifdef MIG_EOPNOTSUPP |
2471 | kern_return_t __attribute__ ((weak)) |
2472 | S_io_select_timeout |
2473 | ( |
2474 | sock_user_t io_object, |
2475 | mach_port_t reply, |
2476 | mach_msg_type_name_t replyPoly, |
2477 | timespec_t timeout, |
2478 | int *select_type |
2479 | ) { return MIG_EOPNOTSUPP; } |
2480 | #endif /* MIG_EOPNOTSUPP */ |
2481 | |
2482 | mig_routine_t io_server_routines[] = { |
2483 | _Xio_write, |
2484 | _Xio_read, |
2485 | _Xio_seek, |
2486 | _Xio_readable, |
2487 | _Xio_set_all_openmodes, |
2488 | _Xio_get_openmodes, |
2489 | _Xio_set_some_openmodes, |
2490 | _Xio_clear_some_openmodes, |
2491 | _Xio_async, |
2492 | _Xio_mod_owner, |
2493 | _Xio_get_owner, |
2494 | _Xio_get_icky_async_id, |
2495 | _Xio_select, |
2496 | _Xio_stat, |
2497 | _Xio_reauthenticate, |
2498 | _Xio_restrict_auth, |
2499 | _Xio_duplicate, |
2500 | _Xio_server_version, |
2501 | _Xio_map, |
2502 | _Xio_map_cntl, |
2503 | _Xio_get_conch, |
2504 | _Xio_release_conch, |
2505 | _Xio_eofnotify, |
2506 | _Xio_prenotify, |
2507 | _Xio_postnotify, |
2508 | _Xio_readnotify, |
2509 | _Xio_readsleep, |
2510 | _Xio_sigio, |
2511 | _Xio_pathconf, |
2512 | _Xio_identity, |
2513 | _Xio_revoke, |
2514 | _Xio_select_timeout, |
2515 | }; |
2516 | |
2517 | mig_external boolean_t io_server |
2518 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2519 | { |
2520 | mach_msg_header_t *InP = InHeadP; |
2521 | mig_reply_header_t *OutP = (mig_reply_header_t *) OutHeadP; |
2522 | |
2523 | const mach_msg_type_t RetCodeType = { |
2524 | /* msgt_name = */ MACH_MSG_TYPE_INTEGER_322, |
2525 | /* msgt_size = */ 32, |
2526 | /* msgt_number = */ 1, |
2527 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2528 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2529 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2530 | /* msgt_unused = */ 0 |
2531 | }; |
2532 | |
2533 | mig_routine_t routine; |
2534 | |
2535 | OutP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InP->msgh_bits), 0)((((InP->msgh_bits) & 0x000000ff)) | ((0) << 8)); |
2536 | OutP->Head.msgh_size = sizeof *OutP; |
2537 | OutP->Head.msgh_remote_port = InP->msgh_reply_portmsgh_remote_port; |
2538 | OutP->Head.msgh_local_port = MACH_PORT_NULL((mach_port_t) 0); |
2539 | OutP->Head.msgh_seqno = 0; |
2540 | OutP->Head.msgh_id = InP->msgh_id + 100; |
2541 | |
2542 | OutP->RetCodeType = RetCodeType; |
2543 | |
2544 | if ((InP->msgh_id > 21031) || (InP->msgh_id < 21000) || |
2545 | ((routine = io_server_routines[InP->msgh_id - 21000]) == 0)) { |
2546 | OutP->RetCode = MIG_BAD_ID-303; |
2547 | return FALSE((boolean_t) 0); |
2548 | } |
2549 | (*routine) (InP, &OutP->Head); |
2550 | return TRUE((boolean_t) 1); |
2551 | } |
2552 | |
2553 | mig_external mig_routine_t io_server_routine |
2554 | (const mach_msg_header_t *InHeadP) |
2555 | { |
2556 | int msgh_id; |
2557 | |
2558 | msgh_id = InHeadP->msgh_id - 21000; |
2559 | |
2560 | if ((msgh_id > 31) || (msgh_id < 0)) |
2561 | return 0; |
2562 | |
2563 | return io_server_routines[msgh_id]; |
2564 | } |
2565 |