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