| File: | obj-scan-build/libtrivfs/fsServer.c |
| Location: | line 1062, column 2 |
| Description: | Assigned value is garbage or undefined |
| 1 | /* Module fs */ |
| 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 "libtrivfs/mig-decls.h" |
| 54 | |
| 55 | /* Routine file_exec */ |
| 56 | mig_internalstatic void _Xfile_exec |
| 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_t exec_taskType; |
| 62 | mach_port_t exec_task; |
| 63 | mach_msg_type_t flagsType; |
| 64 | int flags; |
| 65 | mach_msg_type_long_t argvType; |
| 66 | char argv[2048]; |
| 67 | mach_msg_type_long_t envpType; |
| 68 | char envp[2048]; |
| 69 | mach_msg_type_long_t fdarrayType; |
| 70 | mach_port_t fdarray[512]; |
| 71 | mach_msg_type_long_t portarrayType; |
| 72 | mach_port_t portarray[512]; |
| 73 | mach_msg_type_long_t intarrayType; |
| 74 | int intarray[512]; |
| 75 | mach_msg_type_long_t deallocnamesType; |
| 76 | mach_port_t deallocnames[512]; |
| 77 | mach_msg_type_long_t destroynamesType; |
| 78 | mach_port_t destroynames[512]; |
| 79 | } Request; |
| 80 | |
| 81 | typedef struct { |
| 82 | mach_msg_header_t Head; |
| 83 | mach_msg_type_t RetCodeType; |
| 84 | kern_return_t RetCode; |
| 85 | } Reply; |
| 86 | |
| 87 | Request *In0P = (Request *) InHeadP; |
| 88 | Request *In1P; |
| 89 | Request *In2P; |
| 90 | Request *In3P; |
| 91 | Request *In4P; |
| 92 | Request *In5P; |
| 93 | Request *In6P; |
| 94 | Reply *OutP = (Reply *) OutHeadP; |
| 95 | mig_external kern_return_t trivfs_S_file_exec |
| 96 | (trivfs_protid_t exec_file, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t exec_task, int flags, data_t argv, mach_msg_type_number_t argvCnt, data_t envp, mach_msg_type_number_t envpCnt, portarray_t fdarray, mach_msg_type_number_t fdarrayCnt, portarray_t portarray, mach_msg_type_number_t portarrayCnt, intarray_t intarray, mach_msg_type_number_t intarrayCnt, mach_port_array_t deallocnames, mach_msg_type_number_t deallocnamesCnt, mach_port_array_t destroynames, mach_msg_type_number_t destroynamesCnt); |
| 97 | |
| 98 | unsigned int msgh_size; |
| 99 | unsigned int msgh_size_delta; |
| 100 | |
| 101 | const mach_msg_type_t exec_taskCheck = { |
| 102 | /* msgt_name = */ 17, |
| 103 | /* msgt_size = */ 32, |
| 104 | /* msgt_number = */ 1, |
| 105 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 106 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 107 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 108 | /* msgt_unused = */ 0 |
| 109 | }; |
| 110 | |
| 111 | const mach_msg_type_t flagsCheck = { |
| 112 | /* msgt_name = */ 2, |
| 113 | /* msgt_size = */ 32, |
| 114 | /* msgt_number = */ 1, |
| 115 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 116 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 117 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 118 | /* msgt_unused = */ 0 |
| 119 | }; |
| 120 | |
| 121 | trivfs_protid_t exec_file; |
| 122 | mach_port_t reply; |
| 123 | |
| 124 | #if TypeCheck1 |
| 125 | msgh_size = In0P->Head.msgh_size; |
| 126 | if (mig_unlikely ((msgh_size < 124) ||__builtin_expect (!! ((msgh_size < 124) || !(In0P->Head .msgh_bits & 0x80000000U)), 0) |
| 127 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((msgh_size < 124) || !(In0P->Head .msgh_bits & 0x80000000U)), 0)) |
| 128 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 129 | #endif /* TypeCheck */ |
| 130 | |
| 131 | #if TypeCheck1 |
| 132 | if (BAD_TYPECHECK(&In0P->exec_taskType, &exec_taskCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->exec_taskType); _c.t = * (&exec_taskCheck);_t.w != _c.w; })), 0)) |
| 133 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 134 | #endif /* TypeCheck */ |
| 135 | |
| 136 | #if TypeCheck1 |
| 137 | if (BAD_TYPECHECK(&In0P->flagsType, &flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->flagsType); _c.t = *(& flagsCheck);_t.w != _c.w; })), 0)) |
| 138 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 139 | #endif /* TypeCheck */ |
| 140 | |
| 141 | #if TypeCheck1 |
| 142 | if (mig_unlikely ((In0P->argvType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In0P->argvType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->argvType.msgtl_name != 8) || (In0P->argvType.msgtl_size != 8)), 0) |
| 143 | (In0P->argvType.msgtl_name != 8) ||__builtin_expect (!! ((In0P->argvType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->argvType.msgtl_name != 8) || (In0P->argvType.msgtl_size != 8)), 0) |
| 144 | (In0P->argvType.msgtl_size != 8))__builtin_expect (!! ((In0P->argvType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->argvType.msgtl_name != 8) || (In0P->argvType.msgtl_size != 8)), 0)) |
| 145 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 146 | #endif /* TypeCheck */ |
| 147 | |
| 148 | msgh_size_delta = (In0P->argvType.msgtl_header.msgt_inline) ? (In0P->argvType.msgtl_number + 3) & ~3 : sizeof(char *); |
| 149 | #if TypeCheck1 |
| 150 | if (mig_unlikely (msgh_size < 124 + msgh_size_delta)__builtin_expect (!! (msgh_size < 124 + msgh_size_delta), 0 )) |
| 151 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 152 | msgh_size -= msgh_size_delta; |
| 153 | #endif /* TypeCheck */ |
| 154 | |
| 155 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
| 156 | |
| 157 | #if TypeCheck1 |
| 158 | if (mig_unlikely ((In1P->envpType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In1P->envpType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->envpType.msgtl_name != 8) || (In1P->envpType.msgtl_size != 8)), 0) |
| 159 | (In1P->envpType.msgtl_name != 8) ||__builtin_expect (!! ((In1P->envpType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->envpType.msgtl_name != 8) || (In1P->envpType.msgtl_size != 8)), 0) |
| 160 | (In1P->envpType.msgtl_size != 8))__builtin_expect (!! ((In1P->envpType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->envpType.msgtl_name != 8) || (In1P->envpType.msgtl_size != 8)), 0)) |
| 161 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 162 | #endif /* TypeCheck */ |
| 163 | |
| 164 | msgh_size_delta = (In1P->envpType.msgtl_header.msgt_inline) ? (In1P->envpType.msgtl_number + 3) & ~3 : sizeof(char *); |
| 165 | #if TypeCheck1 |
| 166 | if (mig_unlikely (msgh_size < 124 + msgh_size_delta)__builtin_expect (!! (msgh_size < 124 + msgh_size_delta), 0 )) |
| 167 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 168 | msgh_size -= msgh_size_delta; |
| 169 | #endif /* TypeCheck */ |
| 170 | |
| 171 | In2P = (Request *) ((char *) In1P + msgh_size_delta - 2048); |
| 172 | |
| 173 | #if TypeCheck1 |
| 174 | if (mig_unlikely ((In2P->fdarrayType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In2P->fdarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In2P->fdarrayType.msgtl_name != 17 ) || (In2P->fdarrayType.msgtl_size != 32)), 0) |
| 175 | (In2P->fdarrayType.msgtl_name != 17) ||__builtin_expect (!! ((In2P->fdarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In2P->fdarrayType.msgtl_name != 17 ) || (In2P->fdarrayType.msgtl_size != 32)), 0) |
| 176 | (In2P->fdarrayType.msgtl_size != 32))__builtin_expect (!! ((In2P->fdarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In2P->fdarrayType.msgtl_name != 17 ) || (In2P->fdarrayType.msgtl_size != 32)), 0)) |
| 177 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 178 | #endif /* TypeCheck */ |
| 179 | |
| 180 | msgh_size_delta = (In2P->fdarrayType.msgtl_header.msgt_inline) ? 4 * In2P->fdarrayType.msgtl_number : sizeof(mach_port_t *); |
| 181 | #if TypeCheck1 |
| 182 | if (mig_unlikely (msgh_size < 124 + msgh_size_delta)__builtin_expect (!! (msgh_size < 124 + msgh_size_delta), 0 )) |
| 183 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 184 | msgh_size -= msgh_size_delta; |
| 185 | #endif /* TypeCheck */ |
| 186 | |
| 187 | In3P = (Request *) ((char *) In2P + msgh_size_delta - 2048); |
| 188 | |
| 189 | #if TypeCheck1 |
| 190 | if (mig_unlikely ((In3P->portarrayType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In3P->portarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In3P->portarrayType.msgtl_name != 17) || (In3P->portarrayType.msgtl_size != 32)), 0) |
| 191 | (In3P->portarrayType.msgtl_name != 17) ||__builtin_expect (!! ((In3P->portarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In3P->portarrayType.msgtl_name != 17) || (In3P->portarrayType.msgtl_size != 32)), 0) |
| 192 | (In3P->portarrayType.msgtl_size != 32))__builtin_expect (!! ((In3P->portarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In3P->portarrayType.msgtl_name != 17) || (In3P->portarrayType.msgtl_size != 32)), 0)) |
| 193 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 194 | #endif /* TypeCheck */ |
| 195 | |
| 196 | msgh_size_delta = (In3P->portarrayType.msgtl_header.msgt_inline) ? 4 * In3P->portarrayType.msgtl_number : sizeof(mach_port_t *); |
| 197 | #if TypeCheck1 |
| 198 | if (mig_unlikely (msgh_size < 124 + msgh_size_delta)__builtin_expect (!! (msgh_size < 124 + msgh_size_delta), 0 )) |
| 199 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 200 | msgh_size -= msgh_size_delta; |
| 201 | #endif /* TypeCheck */ |
| 202 | |
| 203 | In4P = (Request *) ((char *) In3P + msgh_size_delta - 2048); |
| 204 | |
| 205 | #if TypeCheck1 |
| 206 | if (mig_unlikely ((In4P->intarrayType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In4P->intarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In4P->intarrayType.msgtl_name != 2 ) || (In4P->intarrayType.msgtl_size != 32)), 0) |
| 207 | (In4P->intarrayType.msgtl_name != 2) ||__builtin_expect (!! ((In4P->intarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In4P->intarrayType.msgtl_name != 2 ) || (In4P->intarrayType.msgtl_size != 32)), 0) |
| 208 | (In4P->intarrayType.msgtl_size != 32))__builtin_expect (!! ((In4P->intarrayType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In4P->intarrayType.msgtl_name != 2 ) || (In4P->intarrayType.msgtl_size != 32)), 0)) |
| 209 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 210 | #endif /* TypeCheck */ |
| 211 | |
| 212 | msgh_size_delta = (In4P->intarrayType.msgtl_header.msgt_inline) ? 4 * In4P->intarrayType.msgtl_number : sizeof(int *); |
| 213 | #if TypeCheck1 |
| 214 | if (mig_unlikely (msgh_size < 124 + msgh_size_delta)__builtin_expect (!! (msgh_size < 124 + msgh_size_delta), 0 )) |
| 215 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 216 | msgh_size -= msgh_size_delta; |
| 217 | #endif /* TypeCheck */ |
| 218 | |
| 219 | In5P = (Request *) ((char *) In4P + msgh_size_delta - 2048); |
| 220 | |
| 221 | #if TypeCheck1 |
| 222 | if (mig_unlikely ((In5P->deallocnamesType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In5P->deallocnamesType.msgtl_header .msgt_longform != ((boolean_t) 1)) || (In5P->deallocnamesType .msgtl_name != 15) || (In5P->deallocnamesType.msgtl_size != 32)), 0) |
| 223 | (In5P->deallocnamesType.msgtl_name != 15) ||__builtin_expect (!! ((In5P->deallocnamesType.msgtl_header .msgt_longform != ((boolean_t) 1)) || (In5P->deallocnamesType .msgtl_name != 15) || (In5P->deallocnamesType.msgtl_size != 32)), 0) |
| 224 | (In5P->deallocnamesType.msgtl_size != 32))__builtin_expect (!! ((In5P->deallocnamesType.msgtl_header .msgt_longform != ((boolean_t) 1)) || (In5P->deallocnamesType .msgtl_name != 15) || (In5P->deallocnamesType.msgtl_size != 32)), 0)) |
| 225 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 226 | #endif /* TypeCheck */ |
| 227 | |
| 228 | msgh_size_delta = (In5P->deallocnamesType.msgtl_header.msgt_inline) ? 4 * In5P->deallocnamesType.msgtl_number : sizeof(mach_port_t *); |
| 229 | #if TypeCheck1 |
| 230 | if (mig_unlikely (msgh_size < 124 + msgh_size_delta)__builtin_expect (!! (msgh_size < 124 + msgh_size_delta), 0 )) |
| 231 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 232 | msgh_size -= msgh_size_delta; |
| 233 | #endif /* TypeCheck */ |
| 234 | |
| 235 | In6P = (Request *) ((char *) In5P + msgh_size_delta - 2048); |
| 236 | |
| 237 | #if TypeCheck1 |
| 238 | if (mig_unlikely ((In6P->destroynamesType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In6P->destroynamesType.msgtl_header .msgt_longform != ((boolean_t) 1)) || (In6P->destroynamesType .msgtl_name != 15) || (In6P->destroynamesType.msgtl_size != 32)), 0) |
| 239 | (In6P->destroynamesType.msgtl_name != 15) ||__builtin_expect (!! ((In6P->destroynamesType.msgtl_header .msgt_longform != ((boolean_t) 1)) || (In6P->destroynamesType .msgtl_name != 15) || (In6P->destroynamesType.msgtl_size != 32)), 0) |
| 240 | (In6P->destroynamesType.msgtl_size != 32))__builtin_expect (!! ((In6P->destroynamesType.msgtl_header .msgt_longform != ((boolean_t) 1)) || (In6P->destroynamesType .msgtl_name != 15) || (In6P->destroynamesType.msgtl_size != 32)), 0)) |
| 241 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 242 | #endif /* TypeCheck */ |
| 243 | |
| 244 | #if TypeCheck1 |
| 245 | if (mig_unlikely (msgh_size != 124 + ((In6P->destroynamesType.msgtl_header.msgt_inline) ? 4 * In6P->destroynamesType.msgtl_number : sizeof(mach_port_t *)))__builtin_expect (!! (msgh_size != 124 + ((In6P->destroynamesType .msgtl_header.msgt_inline) ? 4 * In6P->destroynamesType.msgtl_number : sizeof(mach_port_t *))), 0)) |
| 246 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 247 | #endif /* TypeCheck */ |
| 248 | |
| 249 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 250 | exec_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 251 | else |
| 252 | exec_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 253 | |
| 254 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 255 | |
| 256 | OutP->RetCode = trivfs_S_file_exec(exec_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->exec_task, In0P->flags, (In0P->argvType.msgtl_header.msgt_inline) ? In0P->argv : *((char **)In0P->argv), In0P->argvType.msgtl_number, (In1P->envpType.msgtl_header.msgt_inline) ? In1P->envp : *((char **)In1P->envp), In1P->envpType.msgtl_number, (In2P->fdarrayType.msgtl_header.msgt_inline) ? In2P->fdarray : *((mach_port_t **)In2P->fdarray), In2P->fdarrayType.msgtl_number, (In3P->portarrayType.msgtl_header.msgt_inline) ? In3P->portarray : *((mach_port_t **)In3P->portarray), In3P->portarrayType.msgtl_number, (In4P->intarrayType.msgtl_header.msgt_inline) ? In4P->intarray : *((int **)In4P->intarray), In4P->intarrayType.msgtl_number, (In5P->deallocnamesType.msgtl_header.msgt_inline) ? In5P->deallocnames : *((mach_port_t **)In5P->deallocnames), In5P->deallocnamesType.msgtl_number, (In6P->destroynamesType.msgtl_header.msgt_inline) ? In6P->destroynames : *((mach_port_t **)In6P->destroynames), In6P->destroynamesType.msgtl_number); |
| 257 | if (OutP->RetCode == KERN_SUCCESS0) |
| 258 | if (!In6P->destroynamesType.msgtl_header.msgt_inline) |
| 259 | __mig_deallocate(* (vm_offset_t *) In6P->destroynames, 4 * In6P->destroynamesType.msgtl_number); |
| 260 | if (OutP->RetCode == KERN_SUCCESS0) |
| 261 | if (!In5P->deallocnamesType.msgtl_header.msgt_inline) |
| 262 | __mig_deallocate(* (vm_offset_t *) In5P->deallocnames, 4 * In5P->deallocnamesType.msgtl_number); |
| 263 | if (OutP->RetCode == KERN_SUCCESS0) |
| 264 | if (!In4P->intarrayType.msgtl_header.msgt_inline) |
| 265 | __mig_deallocate(* (vm_offset_t *) In4P->intarray, 4 * In4P->intarrayType.msgtl_number); |
| 266 | if (OutP->RetCode == KERN_SUCCESS0) |
| 267 | if (!In3P->portarrayType.msgtl_header.msgt_inline) |
| 268 | __mig_deallocate(* (vm_offset_t *) In3P->portarray, 4 * In3P->portarrayType.msgtl_number); |
| 269 | if (OutP->RetCode == KERN_SUCCESS0) |
| 270 | if (!In2P->fdarrayType.msgtl_header.msgt_inline) |
| 271 | __mig_deallocate(* (vm_offset_t *) In2P->fdarray, 4 * In2P->fdarrayType.msgtl_number); |
| 272 | if (OutP->RetCode == KERN_SUCCESS0) |
| 273 | if (!In1P->envpType.msgtl_header.msgt_inline) |
| 274 | __mig_deallocate(* (vm_offset_t *) In1P->envp, In1P->envpType.msgtl_number); |
| 275 | if (OutP->RetCode == KERN_SUCCESS0) |
| 276 | if (!In0P->argvType.msgtl_header.msgt_inline) |
| 277 | __mig_deallocate(* (vm_offset_t *) In0P->argv, In0P->argvType.msgtl_number); |
| 278 | trivfs_end_using_protid(exec_file); |
| 279 | } |
| 280 | |
| 281 | /* Default implementation of trivfs_S_file_exec */ |
| 282 | #ifdef MIG_EOPNOTSUPP |
| 283 | kern_return_t __attribute__ ((weak)) |
| 284 | trivfs_S_file_exec |
| 285 | ( |
| 286 | trivfs_protid_t exec_file, |
| 287 | mach_port_t reply, |
| 288 | mach_msg_type_name_t replyPoly, |
| 289 | mach_port_t exec_task, |
| 290 | int flags, |
| 291 | data_t argv, |
| 292 | mach_msg_type_number_t argvCnt, |
| 293 | data_t envp, |
| 294 | mach_msg_type_number_t envpCnt, |
| 295 | portarray_t fdarray, |
| 296 | mach_msg_type_number_t fdarrayCnt, |
| 297 | portarray_t portarray, |
| 298 | mach_msg_type_number_t portarrayCnt, |
| 299 | intarray_t intarray, |
| 300 | mach_msg_type_number_t intarrayCnt, |
| 301 | mach_port_array_t deallocnames, |
| 302 | mach_msg_type_number_t deallocnamesCnt, |
| 303 | mach_port_array_t destroynames, |
| 304 | mach_msg_type_number_t destroynamesCnt |
| 305 | ) { return MIG_EOPNOTSUPP; } |
| 306 | #endif /* MIG_EOPNOTSUPP */ |
| 307 | |
| 308 | /* Routine file_chown */ |
| 309 | mig_internalstatic void _Xfile_chown |
| 310 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 311 | { |
| 312 | typedef struct { |
| 313 | mach_msg_header_t Head; |
| 314 | mach_msg_type_t new_ownerType; |
| 315 | uid_t new_owner; |
| 316 | mach_msg_type_t new_groupType; |
| 317 | gid_t new_group; |
| 318 | } Request; |
| 319 | |
| 320 | typedef struct { |
| 321 | mach_msg_header_t Head; |
| 322 | mach_msg_type_t RetCodeType; |
| 323 | kern_return_t RetCode; |
| 324 | } Reply; |
| 325 | |
| 326 | Request *In0P = (Request *) InHeadP; |
| 327 | Reply *OutP = (Reply *) OutHeadP; |
| 328 | mig_external kern_return_t trivfs_S_file_chown |
| 329 | (trivfs_protid_t chown_file, mach_port_t reply, mach_msg_type_name_t replyPoly, uid_t new_owner, gid_t new_group); |
| 330 | |
| 331 | const mach_msg_type_t new_ownerCheck = { |
| 332 | /* msgt_name = */ 2, |
| 333 | /* msgt_size = */ 32, |
| 334 | /* msgt_number = */ 1, |
| 335 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 336 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 337 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 338 | /* msgt_unused = */ 0 |
| 339 | }; |
| 340 | |
| 341 | const mach_msg_type_t new_groupCheck = { |
| 342 | /* msgt_name = */ 2, |
| 343 | /* msgt_size = */ 32, |
| 344 | /* msgt_number = */ 1, |
| 345 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 346 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 347 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 348 | /* msgt_unused = */ 0 |
| 349 | }; |
| 350 | |
| 351 | trivfs_protid_t chown_file; |
| 352 | mach_port_t reply; |
| 353 | |
| 354 | #if TypeCheck1 |
| 355 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 356 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 357 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 358 | #endif /* TypeCheck */ |
| 359 | |
| 360 | #if TypeCheck1 |
| 361 | if (BAD_TYPECHECK(&In0P->new_ownerType, &new_ownerCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_ownerType); _c.t = * (&new_ownerCheck);_t.w != _c.w; })), 0)) |
| 362 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 363 | #endif /* TypeCheck */ |
| 364 | |
| 365 | #if TypeCheck1 |
| 366 | if (BAD_TYPECHECK(&In0P->new_groupType, &new_groupCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_groupType); _c.t = * (&new_groupCheck);_t.w != _c.w; })), 0)) |
| 367 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 368 | #endif /* TypeCheck */ |
| 369 | |
| 370 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 371 | chown_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 372 | else |
| 373 | chown_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 374 | |
| 375 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 376 | |
| 377 | OutP->RetCode = trivfs_S_file_chown(chown_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->new_owner, In0P->new_group); |
| 378 | trivfs_end_using_protid(chown_file); |
| 379 | } |
| 380 | |
| 381 | /* Default implementation of trivfs_S_file_chown */ |
| 382 | #ifdef MIG_EOPNOTSUPP |
| 383 | kern_return_t __attribute__ ((weak)) |
| 384 | trivfs_S_file_chown |
| 385 | ( |
| 386 | trivfs_protid_t chown_file, |
| 387 | mach_port_t reply, |
| 388 | mach_msg_type_name_t replyPoly, |
| 389 | uid_t new_owner, |
| 390 | gid_t new_group |
| 391 | ) { return MIG_EOPNOTSUPP; } |
| 392 | #endif /* MIG_EOPNOTSUPP */ |
| 393 | |
| 394 | /* Routine file_chauthor */ |
| 395 | mig_internalstatic void _Xfile_chauthor |
| 396 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 397 | { |
| 398 | typedef struct { |
| 399 | mach_msg_header_t Head; |
| 400 | mach_msg_type_t new_authorType; |
| 401 | uid_t new_author; |
| 402 | } Request; |
| 403 | |
| 404 | typedef struct { |
| 405 | mach_msg_header_t Head; |
| 406 | mach_msg_type_t RetCodeType; |
| 407 | kern_return_t RetCode; |
| 408 | } Reply; |
| 409 | |
| 410 | Request *In0P = (Request *) InHeadP; |
| 411 | Reply *OutP = (Reply *) OutHeadP; |
| 412 | mig_external kern_return_t trivfs_S_file_chauthor |
| 413 | (trivfs_protid_t chauth_file, mach_port_t reply, mach_msg_type_name_t replyPoly, uid_t new_author); |
| 414 | |
| 415 | const mach_msg_type_t new_authorCheck = { |
| 416 | /* msgt_name = */ 2, |
| 417 | /* msgt_size = */ 32, |
| 418 | /* msgt_number = */ 1, |
| 419 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 420 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 421 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 422 | /* msgt_unused = */ 0 |
| 423 | }; |
| 424 | |
| 425 | trivfs_protid_t chauth_file; |
| 426 | mach_port_t reply; |
| 427 | |
| 428 | #if TypeCheck1 |
| 429 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 430 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 431 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 432 | #endif /* TypeCheck */ |
| 433 | |
| 434 | #if TypeCheck1 |
| 435 | if (BAD_TYPECHECK(&In0P->new_authorType, &new_authorCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_authorType); _c.t = * (&new_authorCheck);_t.w != _c.w; })), 0)) |
| 436 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 437 | #endif /* TypeCheck */ |
| 438 | |
| 439 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 440 | chauth_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 441 | else |
| 442 | chauth_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 443 | |
| 444 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 445 | |
| 446 | OutP->RetCode = trivfs_S_file_chauthor(chauth_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->new_author); |
| 447 | trivfs_end_using_protid(chauth_file); |
| 448 | } |
| 449 | |
| 450 | /* Default implementation of trivfs_S_file_chauthor */ |
| 451 | #ifdef MIG_EOPNOTSUPP |
| 452 | kern_return_t __attribute__ ((weak)) |
| 453 | trivfs_S_file_chauthor |
| 454 | ( |
| 455 | trivfs_protid_t chauth_file, |
| 456 | mach_port_t reply, |
| 457 | mach_msg_type_name_t replyPoly, |
| 458 | uid_t new_author |
| 459 | ) { return MIG_EOPNOTSUPP; } |
| 460 | #endif /* MIG_EOPNOTSUPP */ |
| 461 | |
| 462 | /* Routine file_chmod */ |
| 463 | mig_internalstatic void _Xfile_chmod |
| 464 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 465 | { |
| 466 | typedef struct { |
| 467 | mach_msg_header_t Head; |
| 468 | mach_msg_type_t new_modeType; |
| 469 | mode_t new_mode; |
| 470 | } Request; |
| 471 | |
| 472 | typedef struct { |
| 473 | mach_msg_header_t Head; |
| 474 | mach_msg_type_t RetCodeType; |
| 475 | kern_return_t RetCode; |
| 476 | } Reply; |
| 477 | |
| 478 | Request *In0P = (Request *) InHeadP; |
| 479 | Reply *OutP = (Reply *) OutHeadP; |
| 480 | mig_external kern_return_t trivfs_S_file_chmod |
| 481 | (trivfs_protid_t chmod_file, mach_port_t reply, mach_msg_type_name_t replyPoly, mode_t new_mode); |
| 482 | |
| 483 | const mach_msg_type_t new_modeCheck = { |
| 484 | /* msgt_name = */ 2, |
| 485 | /* msgt_size = */ 32, |
| 486 | /* msgt_number = */ 1, |
| 487 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 488 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 489 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 490 | /* msgt_unused = */ 0 |
| 491 | }; |
| 492 | |
| 493 | trivfs_protid_t chmod_file; |
| 494 | mach_port_t reply; |
| 495 | |
| 496 | #if TypeCheck1 |
| 497 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 498 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 499 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 500 | #endif /* TypeCheck */ |
| 501 | |
| 502 | #if TypeCheck1 |
| 503 | if (BAD_TYPECHECK(&In0P->new_modeType, &new_modeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_modeType); _c.t = *( &new_modeCheck);_t.w != _c.w; })), 0)) |
| 504 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 505 | #endif /* TypeCheck */ |
| 506 | |
| 507 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 508 | chmod_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 509 | else |
| 510 | chmod_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 511 | |
| 512 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 513 | |
| 514 | OutP->RetCode = trivfs_S_file_chmod(chmod_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->new_mode); |
| 515 | trivfs_end_using_protid(chmod_file); |
| 516 | } |
| 517 | |
| 518 | /* Default implementation of trivfs_S_file_chmod */ |
| 519 | #ifdef MIG_EOPNOTSUPP |
| 520 | kern_return_t __attribute__ ((weak)) |
| 521 | trivfs_S_file_chmod |
| 522 | ( |
| 523 | trivfs_protid_t chmod_file, |
| 524 | mach_port_t reply, |
| 525 | mach_msg_type_name_t replyPoly, |
| 526 | mode_t new_mode |
| 527 | ) { return MIG_EOPNOTSUPP; } |
| 528 | #endif /* MIG_EOPNOTSUPP */ |
| 529 | |
| 530 | /* Routine file_chflags */ |
| 531 | mig_internalstatic void _Xfile_chflags |
| 532 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 533 | { |
| 534 | typedef struct { |
| 535 | mach_msg_header_t Head; |
| 536 | mach_msg_type_t new_flagsType; |
| 537 | int new_flags; |
| 538 | } Request; |
| 539 | |
| 540 | typedef struct { |
| 541 | mach_msg_header_t Head; |
| 542 | mach_msg_type_t RetCodeType; |
| 543 | kern_return_t RetCode; |
| 544 | } Reply; |
| 545 | |
| 546 | Request *In0P = (Request *) InHeadP; |
| 547 | Reply *OutP = (Reply *) OutHeadP; |
| 548 | mig_external kern_return_t trivfs_S_file_chflags |
| 549 | (trivfs_protid_t chflags_file, mach_port_t reply, mach_msg_type_name_t replyPoly, int new_flags); |
| 550 | |
| 551 | const mach_msg_type_t new_flagsCheck = { |
| 552 | /* msgt_name = */ 2, |
| 553 | /* msgt_size = */ 32, |
| 554 | /* msgt_number = */ 1, |
| 555 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 556 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 557 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 558 | /* msgt_unused = */ 0 |
| 559 | }; |
| 560 | |
| 561 | trivfs_protid_t chflags_file; |
| 562 | mach_port_t reply; |
| 563 | |
| 564 | #if TypeCheck1 |
| 565 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 566 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 567 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 568 | #endif /* TypeCheck */ |
| 569 | |
| 570 | #if TypeCheck1 |
| 571 | if (BAD_TYPECHECK(&In0P->new_flagsType, &new_flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_flagsType); _c.t = * (&new_flagsCheck);_t.w != _c.w; })), 0)) |
| 572 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 573 | #endif /* TypeCheck */ |
| 574 | |
| 575 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 576 | chflags_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 577 | else |
| 578 | chflags_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 579 | |
| 580 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 581 | |
| 582 | OutP->RetCode = trivfs_S_file_chflags(chflags_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->new_flags); |
| 583 | trivfs_end_using_protid(chflags_file); |
| 584 | } |
| 585 | |
| 586 | /* Default implementation of trivfs_S_file_chflags */ |
| 587 | #ifdef MIG_EOPNOTSUPP |
| 588 | kern_return_t __attribute__ ((weak)) |
| 589 | trivfs_S_file_chflags |
| 590 | ( |
| 591 | trivfs_protid_t chflags_file, |
| 592 | mach_port_t reply, |
| 593 | mach_msg_type_name_t replyPoly, |
| 594 | int new_flags |
| 595 | ) { return MIG_EOPNOTSUPP; } |
| 596 | #endif /* MIG_EOPNOTSUPP */ |
| 597 | |
| 598 | /* Routine file_utimes */ |
| 599 | mig_internalstatic void _Xfile_utimes |
| 600 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 601 | { |
| 602 | typedef struct { |
| 603 | mach_msg_header_t Head; |
| 604 | mach_msg_type_t new_atimeType; |
| 605 | time_value_t new_atime; |
| 606 | mach_msg_type_t new_mtimeType; |
| 607 | time_value_t new_mtime; |
| 608 | } Request; |
| 609 | |
| 610 | typedef struct { |
| 611 | mach_msg_header_t Head; |
| 612 | mach_msg_type_t RetCodeType; |
| 613 | kern_return_t RetCode; |
| 614 | } Reply; |
| 615 | |
| 616 | Request *In0P = (Request *) InHeadP; |
| 617 | Reply *OutP = (Reply *) OutHeadP; |
| 618 | mig_external kern_return_t trivfs_S_file_utimes |
| 619 | (trivfs_protid_t utimes_file, mach_port_t reply, mach_msg_type_name_t replyPoly, time_value_t new_atime, time_value_t new_mtime); |
| 620 | |
| 621 | const mach_msg_type_t new_atimeCheck = { |
| 622 | /* msgt_name = */ 2, |
| 623 | /* msgt_size = */ 32, |
| 624 | /* msgt_number = */ 2, |
| 625 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 626 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 627 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 628 | /* msgt_unused = */ 0 |
| 629 | }; |
| 630 | |
| 631 | const mach_msg_type_t new_mtimeCheck = { |
| 632 | /* msgt_name = */ 2, |
| 633 | /* msgt_size = */ 32, |
| 634 | /* msgt_number = */ 2, |
| 635 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 636 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 637 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 638 | /* msgt_unused = */ 0 |
| 639 | }; |
| 640 | |
| 641 | trivfs_protid_t utimes_file; |
| 642 | mach_port_t reply; |
| 643 | |
| 644 | #if TypeCheck1 |
| 645 | if (mig_unlikely ((In0P->Head.msgh_size != 48) ||__builtin_expect (!! ((In0P->Head.msgh_size != 48) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 646 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 48) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 647 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 648 | #endif /* TypeCheck */ |
| 649 | |
| 650 | #if TypeCheck1 |
| 651 | if (BAD_TYPECHECK(&In0P->new_atimeType, &new_atimeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_atimeType); _c.t = * (&new_atimeCheck);_t.w != _c.w; })), 0)) |
| 652 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 653 | #endif /* TypeCheck */ |
| 654 | |
| 655 | #if TypeCheck1 |
| 656 | if (BAD_TYPECHECK(&In0P->new_mtimeType, &new_mtimeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_mtimeType); _c.t = * (&new_mtimeCheck);_t.w != _c.w; })), 0)) |
| 657 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 658 | #endif /* TypeCheck */ |
| 659 | |
| 660 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 661 | utimes_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 662 | else |
| 663 | utimes_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 664 | |
| 665 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 666 | |
| 667 | OutP->RetCode = trivfs_S_file_utimes(utimes_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->new_atime, In0P->new_mtime); |
| 668 | trivfs_end_using_protid(utimes_file); |
| 669 | } |
| 670 | |
| 671 | /* Default implementation of trivfs_S_file_utimes */ |
| 672 | #ifdef MIG_EOPNOTSUPP |
| 673 | kern_return_t __attribute__ ((weak)) |
| 674 | trivfs_S_file_utimes |
| 675 | ( |
| 676 | trivfs_protid_t utimes_file, |
| 677 | mach_port_t reply, |
| 678 | mach_msg_type_name_t replyPoly, |
| 679 | time_value_t new_atime, |
| 680 | time_value_t new_mtime |
| 681 | ) { return MIG_EOPNOTSUPP; } |
| 682 | #endif /* MIG_EOPNOTSUPP */ |
| 683 | |
| 684 | /* Routine file_set_size */ |
| 685 | mig_internalstatic void _Xfile_set_size |
| 686 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 687 | { |
| 688 | typedef struct { |
| 689 | mach_msg_header_t Head; |
| 690 | mach_msg_type_t new_sizeType; |
| 691 | loff_t new_size; |
| 692 | } Request; |
| 693 | |
| 694 | typedef struct { |
| 695 | mach_msg_header_t Head; |
| 696 | mach_msg_type_t RetCodeType; |
| 697 | kern_return_t RetCode; |
| 698 | } Reply; |
| 699 | |
| 700 | Request *In0P = (Request *) InHeadP; |
| 701 | Reply *OutP = (Reply *) OutHeadP; |
| 702 | mig_external kern_return_t trivfs_S_file_set_size |
| 703 | (trivfs_protid_t trunc_file, mach_port_t reply, mach_msg_type_name_t replyPoly, loff_t new_size); |
| 704 | |
| 705 | const mach_msg_type_t new_sizeCheck = { |
| 706 | /* msgt_name = */ 11, |
| 707 | /* msgt_size = */ 64, |
| 708 | /* msgt_number = */ 1, |
| 709 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 710 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 711 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 712 | /* msgt_unused = */ 0 |
| 713 | }; |
| 714 | |
| 715 | trivfs_protid_t trunc_file; |
| 716 | mach_port_t reply; |
| 717 | |
| 718 | #if TypeCheck1 |
| 719 | if (mig_unlikely ((In0P->Head.msgh_size != 36) ||__builtin_expect (!! ((In0P->Head.msgh_size != 36) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 720 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 36) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 721 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 722 | #endif /* TypeCheck */ |
| 723 | |
| 724 | #if TypeCheck1 |
| 725 | if (BAD_TYPECHECK(&In0P->new_sizeType, &new_sizeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->new_sizeType); _c.t = *( &new_sizeCheck);_t.w != _c.w; })), 0)) |
| 726 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 727 | #endif /* TypeCheck */ |
| 728 | |
| 729 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 730 | trunc_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 731 | else |
| 732 | trunc_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 733 | |
| 734 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 735 | |
| 736 | OutP->RetCode = trivfs_S_file_set_size(trunc_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->new_size); |
| 737 | trivfs_end_using_protid(trunc_file); |
| 738 | } |
| 739 | |
| 740 | /* Default implementation of trivfs_S_file_set_size */ |
| 741 | #ifdef MIG_EOPNOTSUPP |
| 742 | kern_return_t __attribute__ ((weak)) |
| 743 | trivfs_S_file_set_size |
| 744 | ( |
| 745 | trivfs_protid_t trunc_file, |
| 746 | mach_port_t reply, |
| 747 | mach_msg_type_name_t replyPoly, |
| 748 | loff_t new_size |
| 749 | ) { return MIG_EOPNOTSUPP; } |
| 750 | #endif /* MIG_EOPNOTSUPP */ |
| 751 | |
| 752 | /* Routine file_lock */ |
| 753 | mig_internalstatic void _Xfile_lock |
| 754 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 755 | { |
| 756 | typedef struct { |
| 757 | mach_msg_header_t Head; |
| 758 | mach_msg_type_t flagsType; |
| 759 | int flags; |
| 760 | } Request; |
| 761 | |
| 762 | typedef struct { |
| 763 | mach_msg_header_t Head; |
| 764 | mach_msg_type_t RetCodeType; |
| 765 | kern_return_t RetCode; |
| 766 | } Reply; |
| 767 | |
| 768 | Request *In0P = (Request *) InHeadP; |
| 769 | Reply *OutP = (Reply *) OutHeadP; |
| 770 | mig_external kern_return_t trivfs_S_file_lock |
| 771 | (trivfs_protid_t lock_file, mach_port_t reply, mach_msg_type_name_t replyPoly, int flags); |
| 772 | |
| 773 | const mach_msg_type_t flagsCheck = { |
| 774 | /* msgt_name = */ 2, |
| 775 | /* msgt_size = */ 32, |
| 776 | /* msgt_number = */ 1, |
| 777 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 778 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 779 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 780 | /* msgt_unused = */ 0 |
| 781 | }; |
| 782 | |
| 783 | trivfs_protid_t lock_file; |
| 784 | mach_port_t reply; |
| 785 | |
| 786 | #if TypeCheck1 |
| 787 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 788 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 789 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 790 | #endif /* TypeCheck */ |
| 791 | |
| 792 | #if TypeCheck1 |
| 793 | if (BAD_TYPECHECK(&In0P->flagsType, &flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->flagsType); _c.t = *(& flagsCheck);_t.w != _c.w; })), 0)) |
| 794 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 795 | #endif /* TypeCheck */ |
| 796 | |
| 797 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 798 | lock_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 799 | else |
| 800 | lock_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 801 | |
| 802 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 803 | |
| 804 | OutP->RetCode = trivfs_S_file_lock(lock_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->flags); |
| 805 | trivfs_end_using_protid(lock_file); |
| 806 | } |
| 807 | |
| 808 | /* Default implementation of trivfs_S_file_lock */ |
| 809 | #ifdef MIG_EOPNOTSUPP |
| 810 | kern_return_t __attribute__ ((weak)) |
| 811 | trivfs_S_file_lock |
| 812 | ( |
| 813 | trivfs_protid_t lock_file, |
| 814 | mach_port_t reply, |
| 815 | mach_msg_type_name_t replyPoly, |
| 816 | int flags |
| 817 | ) { return MIG_EOPNOTSUPP; } |
| 818 | #endif /* MIG_EOPNOTSUPP */ |
| 819 | |
| 820 | /* Routine file_lock_stat */ |
| 821 | mig_internalstatic void _Xfile_lock_stat |
| 822 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 823 | { |
| 824 | typedef struct { |
| 825 | mach_msg_header_t Head; |
| 826 | } Request; |
| 827 | |
| 828 | typedef struct { |
| 829 | mach_msg_header_t Head; |
| 830 | mach_msg_type_t RetCodeType; |
| 831 | kern_return_t RetCode; |
| 832 | mach_msg_type_t mystatusType; |
| 833 | int mystatus; |
| 834 | mach_msg_type_t otherstatusType; |
| 835 | int otherstatus; |
| 836 | } Reply; |
| 837 | |
| 838 | Request *In0P = (Request *) InHeadP; |
| 839 | Reply *OutP = (Reply *) OutHeadP; |
| 840 | mig_external kern_return_t trivfs_S_file_lock_stat |
| 841 | (trivfs_protid_t lock_file, mach_port_t reply, mach_msg_type_name_t replyPoly, int *mystatus, int *otherstatus); |
| 842 | |
| 843 | const mach_msg_type_t mystatusType = { |
| 844 | /* msgt_name = */ 2, |
| 845 | /* msgt_size = */ 32, |
| 846 | /* msgt_number = */ 1, |
| 847 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 848 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 849 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 850 | /* msgt_unused = */ 0 |
| 851 | }; |
| 852 | |
| 853 | const mach_msg_type_t otherstatusType = { |
| 854 | /* msgt_name = */ 2, |
| 855 | /* msgt_size = */ 32, |
| 856 | /* msgt_number = */ 1, |
| 857 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 858 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 859 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 860 | /* msgt_unused = */ 0 |
| 861 | }; |
| 862 | |
| 863 | trivfs_protid_t lock_file; |
| 864 | mach_port_t reply; |
| 865 | |
| 866 | #if TypeCheck1 |
| 867 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 868 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 869 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 870 | #endif /* TypeCheck */ |
| 871 | |
| 872 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 873 | lock_file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 874 | else |
| 875 | lock_file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 876 | |
| 877 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 878 | |
| 879 | OutP->RetCode = trivfs_S_file_lock_stat(lock_file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->mystatus, &OutP->otherstatus); |
| 880 | trivfs_end_using_protid(lock_file); |
| 881 | if (OutP->RetCode != KERN_SUCCESS0) |
| 882 | return; |
| 883 | |
| 884 | OutP->Head.msgh_size = 48; |
| 885 | |
| 886 | OutP->mystatusType = mystatusType; |
| 887 | |
| 888 | OutP->otherstatusType = otherstatusType; |
| 889 | } |
| 890 | |
| 891 | /* Default implementation of trivfs_S_file_lock_stat */ |
| 892 | #ifdef MIG_EOPNOTSUPP |
| 893 | kern_return_t __attribute__ ((weak)) |
| 894 | trivfs_S_file_lock_stat |
| 895 | ( |
| 896 | trivfs_protid_t lock_file, |
| 897 | mach_port_t reply, |
| 898 | mach_msg_type_name_t replyPoly, |
| 899 | int *mystatus, |
| 900 | int *otherstatus |
| 901 | ) { return MIG_EOPNOTSUPP; } |
| 902 | #endif /* MIG_EOPNOTSUPP */ |
| 903 | |
| 904 | /* Routine file_check_access */ |
| 905 | mig_internalstatic void _Xfile_check_access |
| 906 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 907 | { |
| 908 | typedef struct { |
| 909 | mach_msg_header_t Head; |
| 910 | } Request; |
| 911 | |
| 912 | typedef struct { |
| 913 | mach_msg_header_t Head; |
| 914 | mach_msg_type_t RetCodeType; |
| 915 | kern_return_t RetCode; |
| 916 | mach_msg_type_t allowedType; |
| 917 | int allowed; |
| 918 | } Reply; |
| 919 | |
| 920 | Request *In0P = (Request *) InHeadP; |
| 921 | Reply *OutP = (Reply *) OutHeadP; |
| 922 | mig_external kern_return_t trivfs_S_file_check_access |
| 923 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, int *allowed); |
| 924 | |
| 925 | const mach_msg_type_t allowedType = { |
| 926 | /* msgt_name = */ 2, |
| 927 | /* msgt_size = */ 32, |
| 928 | /* msgt_number = */ 1, |
| 929 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 930 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 931 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 932 | /* msgt_unused = */ 0 |
| 933 | }; |
| 934 | |
| 935 | trivfs_protid_t file; |
| 936 | mach_port_t reply; |
| 937 | |
| 938 | #if TypeCheck1 |
| 939 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 940 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 941 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 942 | #endif /* TypeCheck */ |
| 943 | |
| 944 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 945 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 946 | else |
| 947 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 948 | |
| 949 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 950 | |
| 951 | OutP->RetCode = trivfs_S_file_check_access(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->allowed); |
| 952 | trivfs_end_using_protid(file); |
| 953 | if (OutP->RetCode != KERN_SUCCESS0) |
| 954 | return; |
| 955 | |
| 956 | OutP->Head.msgh_size = 40; |
| 957 | |
| 958 | OutP->allowedType = allowedType; |
| 959 | } |
| 960 | |
| 961 | /* Default implementation of trivfs_S_file_check_access */ |
| 962 | #ifdef MIG_EOPNOTSUPP |
| 963 | kern_return_t __attribute__ ((weak)) |
| 964 | trivfs_S_file_check_access |
| 965 | ( |
| 966 | trivfs_protid_t file, |
| 967 | mach_port_t reply, |
| 968 | mach_msg_type_name_t replyPoly, |
| 969 | int *allowed |
| 970 | ) { return MIG_EOPNOTSUPP; } |
| 971 | #endif /* MIG_EOPNOTSUPP */ |
| 972 | |
| 973 | /* Routine file_notice_changes */ |
| 974 | mig_internalstatic void _Xfile_notice_changes |
| 975 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 976 | { |
| 977 | typedef struct { |
| 978 | mach_msg_header_t Head; |
| 979 | mach_msg_type_t portType; |
| 980 | mach_port_t port; |
| 981 | } Request; |
| 982 | |
| 983 | typedef struct { |
| 984 | mach_msg_header_t Head; |
| 985 | mach_msg_type_t RetCodeType; |
| 986 | kern_return_t RetCode; |
| 987 | } Reply; |
| 988 | |
| 989 | Request *In0P = (Request *) InHeadP; |
| 990 | Reply *OutP = (Reply *) OutHeadP; |
| 991 | mig_external kern_return_t trivfs_S_file_notice_changes |
| 992 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t port); |
| 993 | |
| 994 | const mach_msg_type_t portCheck = { |
| 995 | /* msgt_name = */ 17, |
| 996 | /* msgt_size = */ 32, |
| 997 | /* msgt_number = */ 1, |
| 998 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 999 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1000 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1001 | /* msgt_unused = */ 0 |
| 1002 | }; |
| 1003 | |
| 1004 | trivfs_protid_t file; |
| 1005 | mach_port_t reply; |
| 1006 | |
| 1007 | #if TypeCheck1 |
| 1008 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1009 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1010 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1011 | #endif /* TypeCheck */ |
| 1012 | |
| 1013 | #if TypeCheck1 |
| 1014 | if (BAD_TYPECHECK(&In0P->portType, &portCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->portType); _c.t = *(& portCheck);_t.w != _c.w; })), 0)) |
| 1015 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1016 | #endif /* TypeCheck */ |
| 1017 | |
| 1018 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1019 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1020 | else |
| 1021 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1022 | |
| 1023 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1024 | |
| 1025 | OutP->RetCode = trivfs_S_file_notice_changes(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->port); |
| 1026 | trivfs_end_using_protid(file); |
| 1027 | } |
| 1028 | |
| 1029 | /* Default implementation of trivfs_S_file_notice_changes */ |
| 1030 | #ifdef MIG_EOPNOTSUPP |
| 1031 | kern_return_t __attribute__ ((weak)) |
| 1032 | trivfs_S_file_notice_changes |
| 1033 | ( |
| 1034 | trivfs_protid_t file, |
| 1035 | mach_port_t reply, |
| 1036 | mach_msg_type_name_t replyPoly, |
| 1037 | mach_port_t port |
| 1038 | ) { return MIG_EOPNOTSUPP; } |
| 1039 | #endif /* MIG_EOPNOTSUPP */ |
| 1040 | |
| 1041 | /* Routine file_getcontrol */ |
| 1042 | mig_internalstatic void _Xfile_getcontrol |
| 1043 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1044 | { |
| 1045 | typedef struct { |
| 1046 | mach_msg_header_t Head; |
| 1047 | } Request; |
| 1048 | |
| 1049 | typedef struct { |
| 1050 | mach_msg_header_t Head; |
| 1051 | mach_msg_type_t RetCodeType; |
| 1052 | kern_return_t RetCode; |
| 1053 | mach_msg_type_t controlType; |
| 1054 | mach_port_t control; |
| 1055 | } Reply; |
| 1056 | |
| 1057 | Request *In0P = (Request *) InHeadP; |
| 1058 | Reply *OutP = (Reply *) OutHeadP; |
| 1059 | mig_external kern_return_t trivfs_S_file_getcontrol |
| 1060 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *control, mach_msg_type_name_t *controlPoly); |
| 1061 | |
| 1062 | boolean_t msgh_simple = msgh_simple; |
Assigned value is garbage or undefined | |
| 1063 | const mach_msg_type_t controlType = { |
| 1064 | /* msgt_name = */ -1, |
| 1065 | /* msgt_size = */ 32, |
| 1066 | /* msgt_number = */ 1, |
| 1067 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1068 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1069 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1070 | /* msgt_unused = */ 0 |
| 1071 | }; |
| 1072 | |
| 1073 | trivfs_protid_t file; |
| 1074 | mach_port_t reply; |
| 1075 | mach_msg_type_name_t controlPoly; |
| 1076 | |
| 1077 | #if TypeCheck1 |
| 1078 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1079 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1080 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1081 | #endif /* TypeCheck */ |
| 1082 | |
| 1083 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1084 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1085 | else |
| 1086 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1087 | |
| 1088 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1089 | |
| 1090 | OutP->RetCode = trivfs_S_file_getcontrol(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->control, &controlPoly); |
| 1091 | trivfs_end_using_protid(file); |
| 1092 | if (OutP->RetCode != KERN_SUCCESS0) |
| 1093 | return; |
| 1094 | |
| 1095 | msgh_simple = TRUE((boolean_t) 1); |
| 1096 | OutP->Head.msgh_size = 40; |
| 1097 | |
| 1098 | OutP->controlType = controlType; |
| 1099 | |
| 1100 | if (MACH_MSG_TYPE_PORT_ANY(controlPoly)(((controlPoly) >= 16) && ((controlPoly) <= 21) )) |
| 1101 | msgh_simple = FALSE((boolean_t) 0); |
| 1102 | |
| 1103 | OutP->controlType.msgt_name = controlPoly; |
| 1104 | |
| 1105 | if (!msgh_simple) |
| 1106 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 1107 | } |
| 1108 | |
| 1109 | /* Default implementation of trivfs_S_file_getcontrol */ |
| 1110 | #ifdef MIG_EOPNOTSUPP |
| 1111 | kern_return_t __attribute__ ((weak)) |
| 1112 | trivfs_S_file_getcontrol |
| 1113 | ( |
| 1114 | trivfs_protid_t file, |
| 1115 | mach_port_t reply, |
| 1116 | mach_msg_type_name_t replyPoly, |
| 1117 | mach_port_t *control, |
| 1118 | mach_msg_type_name_t *controlPoly |
| 1119 | ) { return MIG_EOPNOTSUPP; } |
| 1120 | #endif /* MIG_EOPNOTSUPP */ |
| 1121 | |
| 1122 | /* Routine file_statfs */ |
| 1123 | mig_internalstatic void _Xfile_statfs |
| 1124 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1125 | { |
| 1126 | typedef struct { |
| 1127 | mach_msg_header_t Head; |
| 1128 | } Request; |
| 1129 | |
| 1130 | typedef struct { |
| 1131 | mach_msg_header_t Head; |
| 1132 | mach_msg_type_t RetCodeType; |
| 1133 | kern_return_t RetCode; |
| 1134 | mach_msg_type_t infoType; |
| 1135 | fsys_statfsbuf_t info; |
| 1136 | } Reply; |
| 1137 | |
| 1138 | Request *In0P = (Request *) InHeadP; |
| 1139 | Reply *OutP = (Reply *) OutHeadP; |
| 1140 | mig_external kern_return_t trivfs_S_file_statfs |
| 1141 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, fsys_statfsbuf_t *info); |
| 1142 | |
| 1143 | const mach_msg_type_t infoType = { |
| 1144 | /* msgt_name = */ 2, |
| 1145 | /* msgt_size = */ 32, |
| 1146 | /* msgt_number = */ 22, |
| 1147 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1148 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1149 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1150 | /* msgt_unused = */ 0 |
| 1151 | }; |
| 1152 | |
| 1153 | trivfs_protid_t file; |
| 1154 | mach_port_t reply; |
| 1155 | |
| 1156 | #if TypeCheck1 |
| 1157 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1158 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1159 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1160 | #endif /* TypeCheck */ |
| 1161 | |
| 1162 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1163 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1164 | else |
| 1165 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1166 | |
| 1167 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1168 | |
| 1169 | OutP->RetCode = trivfs_S_file_statfs(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->info); |
| 1170 | trivfs_end_using_protid(file); |
| 1171 | if (OutP->RetCode != KERN_SUCCESS0) |
| 1172 | return; |
| 1173 | |
| 1174 | OutP->Head.msgh_size = 124; |
| 1175 | |
| 1176 | OutP->infoType = infoType; |
| 1177 | } |
| 1178 | |
| 1179 | /* Default implementation of trivfs_S_file_statfs */ |
| 1180 | #ifdef MIG_EOPNOTSUPP |
| 1181 | kern_return_t __attribute__ ((weak)) |
| 1182 | trivfs_S_file_statfs |
| 1183 | ( |
| 1184 | trivfs_protid_t file, |
| 1185 | mach_port_t reply, |
| 1186 | mach_msg_type_name_t replyPoly, |
| 1187 | fsys_statfsbuf_t *info |
| 1188 | ) { return MIG_EOPNOTSUPP; } |
| 1189 | #endif /* MIG_EOPNOTSUPP */ |
| 1190 | |
| 1191 | /* Routine file_sync */ |
| 1192 | mig_internalstatic void _Xfile_sync |
| 1193 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1194 | { |
| 1195 | typedef struct { |
| 1196 | mach_msg_header_t Head; |
| 1197 | mach_msg_type_t waitType; |
| 1198 | int wait; |
| 1199 | mach_msg_type_t omit_metadataType; |
| 1200 | int omit_metadata; |
| 1201 | } Request; |
| 1202 | |
| 1203 | typedef struct { |
| 1204 | mach_msg_header_t Head; |
| 1205 | mach_msg_type_t RetCodeType; |
| 1206 | kern_return_t RetCode; |
| 1207 | } Reply; |
| 1208 | |
| 1209 | Request *In0P = (Request *) InHeadP; |
| 1210 | Reply *OutP = (Reply *) OutHeadP; |
| 1211 | mig_external kern_return_t trivfs_S_file_sync |
| 1212 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, int wait, int omit_metadata); |
| 1213 | |
| 1214 | const mach_msg_type_t waitCheck = { |
| 1215 | /* msgt_name = */ 2, |
| 1216 | /* msgt_size = */ 32, |
| 1217 | /* msgt_number = */ 1, |
| 1218 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1219 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1220 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1221 | /* msgt_unused = */ 0 |
| 1222 | }; |
| 1223 | |
| 1224 | const mach_msg_type_t omit_metadataCheck = { |
| 1225 | /* msgt_name = */ 2, |
| 1226 | /* msgt_size = */ 32, |
| 1227 | /* msgt_number = */ 1, |
| 1228 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1229 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1230 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1231 | /* msgt_unused = */ 0 |
| 1232 | }; |
| 1233 | |
| 1234 | trivfs_protid_t file; |
| 1235 | mach_port_t reply; |
| 1236 | |
| 1237 | #if TypeCheck1 |
| 1238 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1239 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1240 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1241 | #endif /* TypeCheck */ |
| 1242 | |
| 1243 | #if TypeCheck1 |
| 1244 | if (BAD_TYPECHECK(&In0P->waitType, &waitCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->waitType); _c.t = *(& waitCheck);_t.w != _c.w; })), 0)) |
| 1245 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1246 | #endif /* TypeCheck */ |
| 1247 | |
| 1248 | #if TypeCheck1 |
| 1249 | if (BAD_TYPECHECK(&In0P->omit_metadataType, &omit_metadataCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->omit_metadataType); _c.t = *(&omit_metadataCheck);_t.w != _c.w; })), 0)) |
| 1250 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1251 | #endif /* TypeCheck */ |
| 1252 | |
| 1253 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1254 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1255 | else |
| 1256 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1257 | |
| 1258 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1259 | |
| 1260 | OutP->RetCode = trivfs_S_file_sync(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->wait, In0P->omit_metadata); |
| 1261 | trivfs_end_using_protid(file); |
| 1262 | } |
| 1263 | |
| 1264 | /* Default implementation of trivfs_S_file_sync */ |
| 1265 | #ifdef MIG_EOPNOTSUPP |
| 1266 | kern_return_t __attribute__ ((weak)) |
| 1267 | trivfs_S_file_sync |
| 1268 | ( |
| 1269 | trivfs_protid_t file, |
| 1270 | mach_port_t reply, |
| 1271 | mach_msg_type_name_t replyPoly, |
| 1272 | int wait, |
| 1273 | int omit_metadata |
| 1274 | ) { return MIG_EOPNOTSUPP; } |
| 1275 | #endif /* MIG_EOPNOTSUPP */ |
| 1276 | |
| 1277 | /* Routine file_syncfs */ |
| 1278 | mig_internalstatic void _Xfile_syncfs |
| 1279 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1280 | { |
| 1281 | typedef struct { |
| 1282 | mach_msg_header_t Head; |
| 1283 | mach_msg_type_t waitType; |
| 1284 | int wait; |
| 1285 | mach_msg_type_t do_childrenType; |
| 1286 | int do_children; |
| 1287 | } Request; |
| 1288 | |
| 1289 | typedef struct { |
| 1290 | mach_msg_header_t Head; |
| 1291 | mach_msg_type_t RetCodeType; |
| 1292 | kern_return_t RetCode; |
| 1293 | } Reply; |
| 1294 | |
| 1295 | Request *In0P = (Request *) InHeadP; |
| 1296 | Reply *OutP = (Reply *) OutHeadP; |
| 1297 | mig_external kern_return_t trivfs_S_file_syncfs |
| 1298 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, int wait, int do_children); |
| 1299 | |
| 1300 | const mach_msg_type_t waitCheck = { |
| 1301 | /* msgt_name = */ 2, |
| 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 | const mach_msg_type_t do_childrenCheck = { |
| 1311 | /* msgt_name = */ 2, |
| 1312 | /* msgt_size = */ 32, |
| 1313 | /* msgt_number = */ 1, |
| 1314 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1315 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1316 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1317 | /* msgt_unused = */ 0 |
| 1318 | }; |
| 1319 | |
| 1320 | trivfs_protid_t file; |
| 1321 | mach_port_t reply; |
| 1322 | |
| 1323 | #if TypeCheck1 |
| 1324 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1325 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1326 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1327 | #endif /* TypeCheck */ |
| 1328 | |
| 1329 | #if TypeCheck1 |
| 1330 | if (BAD_TYPECHECK(&In0P->waitType, &waitCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->waitType); _c.t = *(& waitCheck);_t.w != _c.w; })), 0)) |
| 1331 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1332 | #endif /* TypeCheck */ |
| 1333 | |
| 1334 | #if TypeCheck1 |
| 1335 | if (BAD_TYPECHECK(&In0P->do_childrenType, &do_childrenCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->do_childrenType); _c.t = *(&do_childrenCheck);_t.w != _c.w; })), 0)) |
| 1336 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1337 | #endif /* TypeCheck */ |
| 1338 | |
| 1339 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1340 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1341 | else |
| 1342 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1343 | |
| 1344 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1345 | |
| 1346 | OutP->RetCode = trivfs_S_file_syncfs(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->wait, In0P->do_children); |
| 1347 | trivfs_end_using_protid(file); |
| 1348 | } |
| 1349 | |
| 1350 | /* Default implementation of trivfs_S_file_syncfs */ |
| 1351 | #ifdef MIG_EOPNOTSUPP |
| 1352 | kern_return_t __attribute__ ((weak)) |
| 1353 | trivfs_S_file_syncfs |
| 1354 | ( |
| 1355 | trivfs_protid_t file, |
| 1356 | mach_port_t reply, |
| 1357 | mach_msg_type_name_t replyPoly, |
| 1358 | int wait, |
| 1359 | int do_children |
| 1360 | ) { return MIG_EOPNOTSUPP; } |
| 1361 | #endif /* MIG_EOPNOTSUPP */ |
| 1362 | |
| 1363 | /* Routine file_get_storage_info */ |
| 1364 | mig_internalstatic void _Xfile_get_storage_info |
| 1365 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1366 | { |
| 1367 | typedef struct { |
| 1368 | mach_msg_header_t Head; |
| 1369 | } Request; |
| 1370 | |
| 1371 | typedef struct { |
| 1372 | mach_msg_header_t Head; |
| 1373 | mach_msg_type_t RetCodeType; |
| 1374 | kern_return_t RetCode; |
| 1375 | mach_msg_type_long_t portsType; |
| 1376 | mach_port_t ports[512]; |
| 1377 | mach_msg_type_long_t intsType; |
| 1378 | int ints[512]; |
| 1379 | mach_msg_type_long_t offsetsType; |
| 1380 | loff_t offsets[256]; |
| 1381 | mach_msg_type_long_t dataType; |
| 1382 | char data[2048]; |
| 1383 | } Reply; |
| 1384 | |
| 1385 | Request *In0P = (Request *) InHeadP; |
| 1386 | Reply *OutP = (Reply *) OutHeadP; |
| 1387 | mig_external kern_return_t trivfs_S_file_get_storage_info |
| 1388 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, portarray_t *ports, mach_msg_type_name_t *portsPoly, mach_msg_type_number_t *portsCnt, intarray_t *ints, mach_msg_type_number_t *intsCnt, off_array_t *offsets, mach_msg_type_number_t *offsetsCnt, data_t *data, mach_msg_type_number_t *dataCnt); |
| 1389 | |
| 1390 | boolean_t msgh_simple = msgh_simple; |
| 1391 | unsigned int msgh_size; |
| 1392 | unsigned int msgh_size_delta; |
| 1393 | |
| 1394 | const mach_msg_type_long_t portsType = { |
| 1395 | { |
| 1396 | /* msgt_name = */ 0, |
| 1397 | /* msgt_size = */ 0, |
| 1398 | /* msgt_number = */ 0, |
| 1399 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1400 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 1401 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1402 | /* msgt_unused = */ 0 |
| 1403 | }, |
| 1404 | /* msgtl_name = */ -1, |
| 1405 | /* msgtl_size = */ 32, |
| 1406 | /* msgtl_number = */ 512, |
| 1407 | }; |
| 1408 | |
| 1409 | const mach_msg_type_long_t intsType = { |
| 1410 | { |
| 1411 | /* msgt_name = */ 0, |
| 1412 | /* msgt_size = */ 0, |
| 1413 | /* msgt_number = */ 0, |
| 1414 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1415 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 1416 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1417 | /* msgt_unused = */ 0 |
| 1418 | }, |
| 1419 | /* msgtl_name = */ 2, |
| 1420 | /* msgtl_size = */ 32, |
| 1421 | /* msgtl_number = */ 512, |
| 1422 | }; |
| 1423 | |
| 1424 | const mach_msg_type_long_t offsetsType = { |
| 1425 | { |
| 1426 | /* msgt_name = */ 0, |
| 1427 | /* msgt_size = */ 0, |
| 1428 | /* msgt_number = */ 0, |
| 1429 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1430 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 1431 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1432 | /* msgt_unused = */ 0 |
| 1433 | }, |
| 1434 | /* msgtl_name = */ 11, |
| 1435 | /* msgtl_size = */ 64, |
| 1436 | /* msgtl_number = */ 256, |
| 1437 | }; |
| 1438 | |
| 1439 | const mach_msg_type_long_t dataType = { |
| 1440 | { |
| 1441 | /* msgt_name = */ 0, |
| 1442 | /* msgt_size = */ 0, |
| 1443 | /* msgt_number = */ 0, |
| 1444 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1445 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 1446 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1447 | /* msgt_unused = */ 0 |
| 1448 | }, |
| 1449 | /* msgtl_name = */ 8, |
| 1450 | /* msgtl_size = */ 8, |
| 1451 | /* msgtl_number = */ 2048, |
| 1452 | }; |
| 1453 | |
| 1454 | trivfs_protid_t file; |
| 1455 | mach_port_t reply; |
| 1456 | mach_msg_type_name_t portsPoly; |
| 1457 | mach_msg_type_number_t portsCnt; |
| 1458 | int ints[512]; |
| 1459 | mach_msg_type_number_t intsCnt; |
| 1460 | loff_t offsets[256]; |
| 1461 | mach_msg_type_number_t offsetsCnt; |
| 1462 | char data[2048]; |
| 1463 | mach_msg_type_number_t dataCnt; |
| 1464 | |
| 1465 | mach_port_t *portsP; |
| 1466 | int *intsP; |
| 1467 | loff_t *offsetsP; |
| 1468 | char *dataP; |
| 1469 | |
| 1470 | #if TypeCheck1 |
| 1471 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1472 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1473 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1474 | #endif /* TypeCheck */ |
| 1475 | |
| 1476 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1477 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1478 | else |
| 1479 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1480 | |
| 1481 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1482 | |
| 1483 | portsP = OutP->ports; |
| 1484 | portsCnt = 512; |
| 1485 | |
| 1486 | intsP = ints; |
| 1487 | intsCnt = 512; |
| 1488 | |
| 1489 | offsetsP = offsets; |
| 1490 | offsetsCnt = 256; |
| 1491 | |
| 1492 | dataP = data; |
| 1493 | dataCnt = 2048; |
| 1494 | |
| 1495 | OutP->RetCode = trivfs_S_file_get_storage_info(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &portsP, &portsPoly, &portsCnt, &intsP, &intsCnt, &offsetsP, &offsetsCnt, &dataP, &dataCnt); |
| 1496 | trivfs_end_using_protid(file); |
| 1497 | if (OutP->RetCode != KERN_SUCCESS0) |
| 1498 | return; |
| 1499 | |
| 1500 | msgh_simple = TRUE((boolean_t) 1); |
| 1501 | |
| 1502 | OutP->portsType = portsType; |
| 1503 | if (portsP != OutP->ports) { |
| 1504 | OutP->portsType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 1505 | OutP->portsType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 1506 | *((mach_port_t **)OutP->ports) = portsP; |
| 1507 | msgh_simple = FALSE((boolean_t) 0); |
| 1508 | } |
| 1509 | |
| 1510 | if (MACH_MSG_TYPE_PORT_ANY(portsPoly)(((portsPoly) >= 16) && ((portsPoly) <= 21))) |
| 1511 | msgh_simple = FALSE((boolean_t) 0); |
| 1512 | |
| 1513 | OutP->portsType.msgtl_name = portsPoly; |
| 1514 | |
| 1515 | OutP->portsType.msgtl_number = portsCnt; |
| 1516 | msgh_size_delta = (OutP->portsType.msgtl_header.msgt_inline) ? 4 * portsCnt : sizeof(mach_port_t *); |
| 1517 | msgh_size = 80 + msgh_size_delta; |
| 1518 | OutP = (Reply *) ((char *) OutP + msgh_size_delta - 2048); |
| 1519 | |
| 1520 | OutP->intsType = intsType; |
| 1521 | |
| 1522 | if (intsP != ints) { |
| 1523 | OutP->intsType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 1524 | OutP->intsType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 1525 | *((int **)OutP->ints) = intsP; |
| 1526 | msgh_simple = FALSE((boolean_t) 0); |
| 1527 | } |
| 1528 | else { |
| 1529 | memcpy(OutP->ints, ints, 4 * intsCnt); |
| 1530 | } |
| 1531 | |
| 1532 | OutP->intsType.msgtl_number = intsCnt; |
| 1533 | msgh_size_delta = (OutP->intsType.msgtl_header.msgt_inline) ? 4 * intsCnt : sizeof(int *); |
| 1534 | msgh_size += msgh_size_delta; |
| 1535 | OutP = (Reply *) ((char *) OutP + msgh_size_delta - 2048); |
| 1536 | |
| 1537 | OutP->offsetsType = offsetsType; |
| 1538 | |
| 1539 | if (offsetsP != offsets) { |
| 1540 | OutP->offsetsType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 1541 | OutP->offsetsType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 1542 | *((loff_t **)OutP->offsets) = offsetsP; |
| 1543 | msgh_simple = FALSE((boolean_t) 0); |
| 1544 | } |
| 1545 | else { |
| 1546 | memcpy(OutP->offsets, offsets, 8 * offsetsCnt); |
| 1547 | } |
| 1548 | |
| 1549 | OutP->offsetsType.msgtl_number = offsetsCnt; |
| 1550 | msgh_size_delta = (OutP->offsetsType.msgtl_header.msgt_inline) ? 8 * offsetsCnt : sizeof(loff_t *); |
| 1551 | msgh_size += msgh_size_delta; |
| 1552 | OutP = (Reply *) ((char *) OutP + msgh_size_delta - 2048); |
| 1553 | |
| 1554 | OutP->dataType = dataType; |
| 1555 | |
| 1556 | if (dataP != data) { |
| 1557 | OutP->dataType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 1558 | OutP->dataType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 1559 | *((char **)OutP->data) = dataP; |
| 1560 | msgh_simple = FALSE((boolean_t) 0); |
| 1561 | } |
| 1562 | else { |
| 1563 | memcpy(OutP->data, data, dataCnt); |
| 1564 | } |
| 1565 | |
| 1566 | OutP->dataType.msgtl_number = dataCnt; |
| 1567 | msgh_size += (OutP->dataType.msgtl_header.msgt_inline) ? (dataCnt + 3) & ~3 : sizeof(char *); |
| 1568 | |
| 1569 | OutP = (Reply *) OutHeadP; |
| 1570 | if (!msgh_simple) |
| 1571 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 1572 | OutP->Head.msgh_size = msgh_size; |
| 1573 | } |
| 1574 | |
| 1575 | /* Default implementation of trivfs_S_file_get_storage_info */ |
| 1576 | #ifdef MIG_EOPNOTSUPP |
| 1577 | kern_return_t __attribute__ ((weak)) |
| 1578 | trivfs_S_file_get_storage_info |
| 1579 | ( |
| 1580 | trivfs_protid_t file, |
| 1581 | mach_port_t reply, |
| 1582 | mach_msg_type_name_t replyPoly, |
| 1583 | portarray_t *ports, |
| 1584 | mach_msg_type_name_t *portsPoly, |
| 1585 | mach_msg_type_number_t *portsCnt, |
| 1586 | intarray_t *ints, |
| 1587 | mach_msg_type_number_t *intsCnt, |
| 1588 | off_array_t *offsets, |
| 1589 | mach_msg_type_number_t *offsetsCnt, |
| 1590 | data_t *data, |
| 1591 | mach_msg_type_number_t *dataCnt |
| 1592 | ) { return MIG_EOPNOTSUPP; } |
| 1593 | #endif /* MIG_EOPNOTSUPP */ |
| 1594 | |
| 1595 | /* Routine file_getlinknode */ |
| 1596 | mig_internalstatic void _Xfile_getlinknode |
| 1597 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1598 | { |
| 1599 | typedef struct { |
| 1600 | mach_msg_header_t Head; |
| 1601 | } Request; |
| 1602 | |
| 1603 | typedef struct { |
| 1604 | mach_msg_header_t Head; |
| 1605 | mach_msg_type_t RetCodeType; |
| 1606 | kern_return_t RetCode; |
| 1607 | mach_msg_type_t linknodeType; |
| 1608 | mach_port_t linknode; |
| 1609 | } Reply; |
| 1610 | |
| 1611 | Request *In0P = (Request *) InHeadP; |
| 1612 | Reply *OutP = (Reply *) OutHeadP; |
| 1613 | mig_external kern_return_t trivfs_S_file_getlinknode |
| 1614 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *linknode, mach_msg_type_name_t *linknodePoly); |
| 1615 | |
| 1616 | boolean_t msgh_simple = msgh_simple; |
| 1617 | const mach_msg_type_t linknodeType = { |
| 1618 | /* msgt_name = */ -1, |
| 1619 | /* msgt_size = */ 32, |
| 1620 | /* msgt_number = */ 1, |
| 1621 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1622 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1623 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1624 | /* msgt_unused = */ 0 |
| 1625 | }; |
| 1626 | |
| 1627 | trivfs_protid_t file; |
| 1628 | mach_port_t reply; |
| 1629 | mach_msg_type_name_t linknodePoly; |
| 1630 | |
| 1631 | #if TypeCheck1 |
| 1632 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1633 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1634 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1635 | #endif /* TypeCheck */ |
| 1636 | |
| 1637 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1638 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1639 | else |
| 1640 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1641 | |
| 1642 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1643 | |
| 1644 | OutP->RetCode = trivfs_S_file_getlinknode(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->linknode, &linknodePoly); |
| 1645 | trivfs_end_using_protid(file); |
| 1646 | if (OutP->RetCode != KERN_SUCCESS0) |
| 1647 | return; |
| 1648 | |
| 1649 | msgh_simple = TRUE((boolean_t) 1); |
| 1650 | OutP->Head.msgh_size = 40; |
| 1651 | |
| 1652 | OutP->linknodeType = linknodeType; |
| 1653 | |
| 1654 | if (MACH_MSG_TYPE_PORT_ANY(linknodePoly)(((linknodePoly) >= 16) && ((linknodePoly) <= 21 ))) |
| 1655 | msgh_simple = FALSE((boolean_t) 0); |
| 1656 | |
| 1657 | OutP->linknodeType.msgt_name = linknodePoly; |
| 1658 | |
| 1659 | if (!msgh_simple) |
| 1660 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 1661 | } |
| 1662 | |
| 1663 | /* Default implementation of trivfs_S_file_getlinknode */ |
| 1664 | #ifdef MIG_EOPNOTSUPP |
| 1665 | kern_return_t __attribute__ ((weak)) |
| 1666 | trivfs_S_file_getlinknode |
| 1667 | ( |
| 1668 | trivfs_protid_t file, |
| 1669 | mach_port_t reply, |
| 1670 | mach_msg_type_name_t replyPoly, |
| 1671 | mach_port_t *linknode, |
| 1672 | mach_msg_type_name_t *linknodePoly |
| 1673 | ) { return MIG_EOPNOTSUPP; } |
| 1674 | #endif /* MIG_EOPNOTSUPP */ |
| 1675 | |
| 1676 | /* Routine file_getfh */ |
| 1677 | mig_internalstatic void _Xfile_getfh |
| 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 | mach_msg_type_long_t filehandleType; |
| 1689 | char filehandle[2048]; |
| 1690 | } Reply; |
| 1691 | |
| 1692 | Request *In0P = (Request *) InHeadP; |
| 1693 | Reply *OutP = (Reply *) OutHeadP; |
| 1694 | mig_external kern_return_t trivfs_S_file_getfh |
| 1695 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t *filehandle, mach_msg_type_number_t *filehandleCnt); |
| 1696 | |
| 1697 | boolean_t msgh_simple = msgh_simple; |
| 1698 | const mach_msg_type_long_t filehandleType = { |
| 1699 | { |
| 1700 | /* msgt_name = */ 0, |
| 1701 | /* msgt_size = */ 0, |
| 1702 | /* msgt_number = */ 0, |
| 1703 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1704 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 1705 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1706 | /* msgt_unused = */ 0 |
| 1707 | }, |
| 1708 | /* msgtl_name = */ 8, |
| 1709 | /* msgtl_size = */ 8, |
| 1710 | /* msgtl_number = */ 2048, |
| 1711 | }; |
| 1712 | |
| 1713 | trivfs_protid_t file; |
| 1714 | mach_port_t reply; |
| 1715 | mach_msg_type_number_t filehandleCnt; |
| 1716 | |
| 1717 | char *filehandleP; |
| 1718 | |
| 1719 | #if TypeCheck1 |
| 1720 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1721 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1722 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1723 | #endif /* TypeCheck */ |
| 1724 | |
| 1725 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1726 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1727 | else |
| 1728 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1729 | |
| 1730 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1731 | |
| 1732 | filehandleP = OutP->filehandle; |
| 1733 | filehandleCnt = 2048; |
| 1734 | |
| 1735 | OutP->RetCode = trivfs_S_file_getfh(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &filehandleP, &filehandleCnt); |
| 1736 | trivfs_end_using_protid(file); |
| 1737 | if (OutP->RetCode != KERN_SUCCESS0) |
| 1738 | return; |
| 1739 | |
| 1740 | msgh_simple = TRUE((boolean_t) 1); |
| 1741 | |
| 1742 | OutP->filehandleType = filehandleType; |
| 1743 | if (filehandleP != OutP->filehandle) { |
| 1744 | OutP->filehandleType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 1745 | OutP->filehandleType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 1746 | *((char **)OutP->filehandle) = filehandleP; |
| 1747 | msgh_simple = FALSE((boolean_t) 0); |
| 1748 | } |
| 1749 | |
| 1750 | OutP->filehandleType.msgtl_number = filehandleCnt; |
| 1751 | OutP->Head.msgh_size = 44 + ((OutP->filehandleType.msgtl_header.msgt_inline) ? (filehandleCnt + 3) & ~3 : sizeof(char *)); |
| 1752 | |
| 1753 | if (!msgh_simple) |
| 1754 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 1755 | } |
| 1756 | |
| 1757 | /* Default implementation of trivfs_S_file_getfh */ |
| 1758 | #ifdef MIG_EOPNOTSUPP |
| 1759 | kern_return_t __attribute__ ((weak)) |
| 1760 | trivfs_S_file_getfh |
| 1761 | ( |
| 1762 | trivfs_protid_t file, |
| 1763 | mach_port_t reply, |
| 1764 | mach_msg_type_name_t replyPoly, |
| 1765 | data_t *filehandle, |
| 1766 | mach_msg_type_number_t *filehandleCnt |
| 1767 | ) { return MIG_EOPNOTSUPP; } |
| 1768 | #endif /* MIG_EOPNOTSUPP */ |
| 1769 | |
| 1770 | /* Routine dir_lookup */ |
| 1771 | mig_internalstatic void _Xdir_lookup |
| 1772 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1773 | { |
| 1774 | typedef struct { |
| 1775 | mach_msg_header_t Head; |
| 1776 | mach_msg_type_t file_nameType; |
| 1777 | string_t file_name; |
| 1778 | mach_msg_type_t flagsType; |
| 1779 | int flags; |
| 1780 | mach_msg_type_t modeType; |
| 1781 | mode_t mode; |
| 1782 | } Request; |
| 1783 | |
| 1784 | typedef struct { |
| 1785 | mach_msg_header_t Head; |
| 1786 | mach_msg_type_t RetCodeType; |
| 1787 | kern_return_t RetCode; |
| 1788 | mach_msg_type_t do_retryType; |
| 1789 | retry_type do_retry; |
| 1790 | mach_msg_type_t retry_nameType; |
| 1791 | string_t retry_name; |
| 1792 | mach_msg_type_t resultType; |
| 1793 | mach_port_t result; |
| 1794 | } Reply; |
| 1795 | |
| 1796 | Request *In0P = (Request *) InHeadP; |
| 1797 | Reply *OutP = (Reply *) OutHeadP; |
| 1798 | mig_external kern_return_t trivfs_S_dir_lookup |
| 1799 | (trivfs_protid_t start_dir, mach_port_t reply, mach_msg_type_name_t replyPoly, string_t file_name, int flags, mode_t mode, retry_type *do_retry, string_t retry_name, mach_port_t *result, mach_msg_type_name_t *resultPoly); |
| 1800 | |
| 1801 | boolean_t msgh_simple = msgh_simple; |
| 1802 | const mach_msg_type_t file_nameCheck = { |
| 1803 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 1804 | /* msgt_size = */ 8, |
| 1805 | /* msgt_number = */ 1024, |
| 1806 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1807 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1808 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1809 | /* msgt_unused = */ 0 |
| 1810 | }; |
| 1811 | |
| 1812 | const mach_msg_type_t flagsCheck = { |
| 1813 | /* msgt_name = */ 2, |
| 1814 | /* msgt_size = */ 32, |
| 1815 | /* msgt_number = */ 1, |
| 1816 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1817 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1818 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1819 | /* msgt_unused = */ 0 |
| 1820 | }; |
| 1821 | |
| 1822 | const mach_msg_type_t modeCheck = { |
| 1823 | /* msgt_name = */ 2, |
| 1824 | /* msgt_size = */ 32, |
| 1825 | /* msgt_number = */ 1, |
| 1826 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1827 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1828 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1829 | /* msgt_unused = */ 0 |
| 1830 | }; |
| 1831 | |
| 1832 | const mach_msg_type_t do_retryType = { |
| 1833 | /* msgt_name = */ 2, |
| 1834 | /* msgt_size = */ 32, |
| 1835 | /* msgt_number = */ 1, |
| 1836 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1837 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1838 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1839 | /* msgt_unused = */ 0 |
| 1840 | }; |
| 1841 | |
| 1842 | const mach_msg_type_t retry_nameType = { |
| 1843 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 1844 | /* msgt_size = */ 8, |
| 1845 | /* msgt_number = */ 1024, |
| 1846 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1847 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1848 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1849 | /* msgt_unused = */ 0 |
| 1850 | }; |
| 1851 | |
| 1852 | const mach_msg_type_t resultType = { |
| 1853 | /* msgt_name = */ -1, |
| 1854 | /* msgt_size = */ 32, |
| 1855 | /* msgt_number = */ 1, |
| 1856 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1857 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1858 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1859 | /* msgt_unused = */ 0 |
| 1860 | }; |
| 1861 | |
| 1862 | trivfs_protid_t start_dir; |
| 1863 | mach_port_t reply; |
| 1864 | mach_msg_type_name_t resultPoly; |
| 1865 | |
| 1866 | #if TypeCheck1 |
| 1867 | if (mig_unlikely ((In0P->Head.msgh_size != 1068) ||__builtin_expect (!! ((In0P->Head.msgh_size != 1068) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 1868 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 1068) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 1869 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1870 | #endif /* TypeCheck */ |
| 1871 | |
| 1872 | #if TypeCheck1 |
| 1873 | if (BAD_TYPECHECK(&In0P->file_nameType, &file_nameCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->file_nameType); _c.t = * (&file_nameCheck);_t.w != _c.w; })), 0)) |
| 1874 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1875 | #endif /* TypeCheck */ |
| 1876 | |
| 1877 | #if TypeCheck1 |
| 1878 | if (BAD_TYPECHECK(&In0P->flagsType, &flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->flagsType); _c.t = *(& flagsCheck);_t.w != _c.w; })), 0)) |
| 1879 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1880 | #endif /* TypeCheck */ |
| 1881 | |
| 1882 | #if TypeCheck1 |
| 1883 | if (BAD_TYPECHECK(&In0P->modeType, &modeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->modeType); _c.t = *(& modeCheck);_t.w != _c.w; })), 0)) |
| 1884 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1885 | #endif /* TypeCheck */ |
| 1886 | |
| 1887 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 1888 | start_dir = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 1889 | else |
| 1890 | start_dir = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 1891 | |
| 1892 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 1893 | |
| 1894 | OutP->RetCode = trivfs_S_dir_lookup(start_dir, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->file_name, In0P->flags, In0P->mode, &OutP->do_retry, OutP->retry_name, &OutP->result, &resultPoly); |
| 1895 | trivfs_end_using_protid(start_dir); |
| 1896 | if (OutP->RetCode != KERN_SUCCESS0) |
| 1897 | return; |
| 1898 | |
| 1899 | msgh_simple = TRUE((boolean_t) 1); |
| 1900 | OutP->Head.msgh_size = 1076; |
| 1901 | |
| 1902 | OutP->do_retryType = do_retryType; |
| 1903 | |
| 1904 | OutP->retry_nameType = retry_nameType; |
| 1905 | |
| 1906 | OutP->resultType = resultType; |
| 1907 | |
| 1908 | if (MACH_MSG_TYPE_PORT_ANY(resultPoly)(((resultPoly) >= 16) && ((resultPoly) <= 21))) |
| 1909 | msgh_simple = FALSE((boolean_t) 0); |
| 1910 | |
| 1911 | OutP->resultType.msgt_name = resultPoly; |
| 1912 | |
| 1913 | if (!msgh_simple) |
| 1914 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 1915 | } |
| 1916 | |
| 1917 | /* Default implementation of trivfs_S_dir_lookup */ |
| 1918 | #ifdef MIG_EOPNOTSUPP |
| 1919 | kern_return_t __attribute__ ((weak)) |
| 1920 | trivfs_S_dir_lookup |
| 1921 | ( |
| 1922 | trivfs_protid_t start_dir, |
| 1923 | mach_port_t reply, |
| 1924 | mach_msg_type_name_t replyPoly, |
| 1925 | string_t file_name, |
| 1926 | int flags, |
| 1927 | mode_t mode, |
| 1928 | retry_type *do_retry, |
| 1929 | string_t retry_name, |
| 1930 | mach_port_t *result, |
| 1931 | mach_msg_type_name_t *resultPoly |
| 1932 | ) { return MIG_EOPNOTSUPP; } |
| 1933 | #endif /* MIG_EOPNOTSUPP */ |
| 1934 | |
| 1935 | /* Routine dir_readdir */ |
| 1936 | mig_internalstatic void _Xdir_readdir |
| 1937 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1938 | { |
| 1939 | typedef struct { |
| 1940 | mach_msg_header_t Head; |
| 1941 | mach_msg_type_t entryType; |
| 1942 | int entry; |
| 1943 | mach_msg_type_t nentriesType; |
| 1944 | int nentries; |
| 1945 | mach_msg_type_t bufsizType; |
| 1946 | vm_size_t bufsiz; |
| 1947 | } Request; |
| 1948 | |
| 1949 | typedef struct { |
| 1950 | mach_msg_header_t Head; |
| 1951 | mach_msg_type_t RetCodeType; |
| 1952 | kern_return_t RetCode; |
| 1953 | mach_msg_type_long_t dataType; |
| 1954 | char data[2048]; |
| 1955 | mach_msg_type_t amountType; |
| 1956 | int amount; |
| 1957 | } Reply; |
| 1958 | |
| 1959 | Request *In0P = (Request *) InHeadP; |
| 1960 | Reply *OutP = (Reply *) OutHeadP; |
| 1961 | mig_external kern_return_t trivfs_S_dir_readdir |
| 1962 | (trivfs_protid_t dir, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t *data, mach_msg_type_number_t *dataCnt, boolean_t *dataDealloc, int entry, int nentries, vm_size_t bufsiz, int *amount); |
| 1963 | |
| 1964 | boolean_t msgh_simple = msgh_simple; |
| 1965 | unsigned int msgh_size_delta; |
| 1966 | |
| 1967 | const mach_msg_type_t entryCheck = { |
| 1968 | /* msgt_name = */ 2, |
| 1969 | /* msgt_size = */ 32, |
| 1970 | /* msgt_number = */ 1, |
| 1971 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1972 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1973 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1974 | /* msgt_unused = */ 0 |
| 1975 | }; |
| 1976 | |
| 1977 | const mach_msg_type_t nentriesCheck = { |
| 1978 | /* msgt_name = */ 2, |
| 1979 | /* msgt_size = */ 32, |
| 1980 | /* msgt_number = */ 1, |
| 1981 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1982 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1983 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1984 | /* msgt_unused = */ 0 |
| 1985 | }; |
| 1986 | |
| 1987 | const mach_msg_type_t bufsizCheck = { |
| 1988 | /* msgt_name = */ 2, |
| 1989 | /* msgt_size = */ 32, |
| 1990 | /* msgt_number = */ 1, |
| 1991 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1992 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1993 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1994 | /* msgt_unused = */ 0 |
| 1995 | }; |
| 1996 | |
| 1997 | const mach_msg_type_long_t dataType = { |
| 1998 | { |
| 1999 | /* msgt_name = */ 0, |
| 2000 | /* msgt_size = */ 0, |
| 2001 | /* msgt_number = */ 0, |
| 2002 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2003 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 2004 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2005 | /* msgt_unused = */ 0 |
| 2006 | }, |
| 2007 | /* msgtl_name = */ 8, |
| 2008 | /* msgtl_size = */ 8, |
| 2009 | /* msgtl_number = */ 2048, |
| 2010 | }; |
| 2011 | |
| 2012 | const mach_msg_type_t amountType = { |
| 2013 | /* msgt_name = */ 2, |
| 2014 | /* msgt_size = */ 32, |
| 2015 | /* msgt_number = */ 1, |
| 2016 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2017 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2018 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2019 | /* msgt_unused = */ 0 |
| 2020 | }; |
| 2021 | |
| 2022 | trivfs_protid_t dir; |
| 2023 | mach_port_t reply; |
| 2024 | mach_msg_type_number_t dataCnt; |
| 2025 | boolean_t dataDealloc; |
| 2026 | int amount; |
| 2027 | |
| 2028 | char *dataP; |
| 2029 | |
| 2030 | #if TypeCheck1 |
| 2031 | if (mig_unlikely ((In0P->Head.msgh_size != 48) ||__builtin_expect (!! ((In0P->Head.msgh_size != 48) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 2032 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 48) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 2033 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2034 | #endif /* TypeCheck */ |
| 2035 | |
| 2036 | #if TypeCheck1 |
| 2037 | if (BAD_TYPECHECK(&In0P->entryType, &entryCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->entryType); _c.t = *(& entryCheck);_t.w != _c.w; })), 0)) |
| 2038 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2039 | #endif /* TypeCheck */ |
| 2040 | |
| 2041 | #if TypeCheck1 |
| 2042 | if (BAD_TYPECHECK(&In0P->nentriesType, &nentriesCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->nentriesType); _c.t = *( &nentriesCheck);_t.w != _c.w; })), 0)) |
| 2043 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2044 | #endif /* TypeCheck */ |
| 2045 | |
| 2046 | #if TypeCheck1 |
| 2047 | if (BAD_TYPECHECK(&In0P->bufsizType, &bufsizCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->bufsizType); _c.t = *(& bufsizCheck);_t.w != _c.w; })), 0)) |
| 2048 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2049 | #endif /* TypeCheck */ |
| 2050 | |
| 2051 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2052 | dir = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2053 | else |
| 2054 | dir = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2055 | |
| 2056 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2057 | |
| 2058 | dataP = OutP->data; |
| 2059 | dataCnt = 2048; |
| 2060 | |
| 2061 | OutP->RetCode = trivfs_S_dir_readdir(dir, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &dataP, &dataCnt, &dataDealloc, In0P->entry, In0P->nentries, In0P->bufsiz, &amount); |
| 2062 | trivfs_end_using_protid(dir); |
| 2063 | if (OutP->RetCode != KERN_SUCCESS0) |
| 2064 | return; |
| 2065 | |
| 2066 | msgh_simple = TRUE((boolean_t) 1); |
| 2067 | |
| 2068 | OutP->dataType = dataType; |
| 2069 | if (dataP != OutP->data) { |
| 2070 | OutP->dataType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 2071 | OutP->dataType.msgtl_header.msgt_deallocate = dataDealloc; |
| 2072 | *((char **)OutP->data) = dataP; |
| 2073 | msgh_simple = FALSE((boolean_t) 0); |
| 2074 | } |
| 2075 | |
| 2076 | OutP->dataType.msgtl_number = dataCnt; |
| 2077 | msgh_size_delta = (OutP->dataType.msgtl_header.msgt_inline) ? (dataCnt + 3) & ~3 : sizeof(char *); |
| 2078 | OutP->Head.msgh_size = 52 + msgh_size_delta; |
| 2079 | OutP = (Reply *) ((char *) OutP + msgh_size_delta - 2048); |
| 2080 | |
| 2081 | OutP->amountType = amountType; |
| 2082 | |
| 2083 | OutP->amount = amount; |
| 2084 | |
| 2085 | OutP = (Reply *) OutHeadP; |
| 2086 | if (!msgh_simple) |
| 2087 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 2088 | } |
| 2089 | |
| 2090 | /* Default implementation of trivfs_S_dir_readdir */ |
| 2091 | #ifdef MIG_EOPNOTSUPP |
| 2092 | kern_return_t __attribute__ ((weak)) |
| 2093 | trivfs_S_dir_readdir |
| 2094 | ( |
| 2095 | trivfs_protid_t dir, |
| 2096 | mach_port_t reply, |
| 2097 | mach_msg_type_name_t replyPoly, |
| 2098 | data_t *data, |
| 2099 | mach_msg_type_number_t *dataCnt, |
| 2100 | boolean_t *dataDealloc, |
| 2101 | int entry, |
| 2102 | int nentries, |
| 2103 | vm_size_t bufsiz, |
| 2104 | int *amount |
| 2105 | ) { return MIG_EOPNOTSUPP; } |
| 2106 | #endif /* MIG_EOPNOTSUPP */ |
| 2107 | |
| 2108 | /* Routine dir_mkdir */ |
| 2109 | mig_internalstatic void _Xdir_mkdir |
| 2110 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2111 | { |
| 2112 | typedef struct { |
| 2113 | mach_msg_header_t Head; |
| 2114 | mach_msg_type_t nameType; |
| 2115 | string_t name; |
| 2116 | mach_msg_type_t modeType; |
| 2117 | mode_t mode; |
| 2118 | } Request; |
| 2119 | |
| 2120 | typedef struct { |
| 2121 | mach_msg_header_t Head; |
| 2122 | mach_msg_type_t RetCodeType; |
| 2123 | kern_return_t RetCode; |
| 2124 | } Reply; |
| 2125 | |
| 2126 | Request *In0P = (Request *) InHeadP; |
| 2127 | Reply *OutP = (Reply *) OutHeadP; |
| 2128 | mig_external kern_return_t trivfs_S_dir_mkdir |
| 2129 | (trivfs_protid_t directory, mach_port_t reply, mach_msg_type_name_t replyPoly, string_t name, mode_t mode); |
| 2130 | |
| 2131 | const mach_msg_type_t nameCheck = { |
| 2132 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 2133 | /* msgt_size = */ 8, |
| 2134 | /* msgt_number = */ 1024, |
| 2135 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2136 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2137 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2138 | /* msgt_unused = */ 0 |
| 2139 | }; |
| 2140 | |
| 2141 | const mach_msg_type_t modeCheck = { |
| 2142 | /* msgt_name = */ 2, |
| 2143 | /* msgt_size = */ 32, |
| 2144 | /* msgt_number = */ 1, |
| 2145 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2146 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2147 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2148 | /* msgt_unused = */ 0 |
| 2149 | }; |
| 2150 | |
| 2151 | trivfs_protid_t directory; |
| 2152 | mach_port_t reply; |
| 2153 | |
| 2154 | #if TypeCheck1 |
| 2155 | if (mig_unlikely ((In0P->Head.msgh_size != 1060) ||__builtin_expect (!! ((In0P->Head.msgh_size != 1060) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 2156 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 1060) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 2157 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2158 | #endif /* TypeCheck */ |
| 2159 | |
| 2160 | #if TypeCheck1 |
| 2161 | 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)) |
| 2162 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2163 | #endif /* TypeCheck */ |
| 2164 | |
| 2165 | #if TypeCheck1 |
| 2166 | if (BAD_TYPECHECK(&In0P->modeType, &modeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->modeType); _c.t = *(& modeCheck);_t.w != _c.w; })), 0)) |
| 2167 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2168 | #endif /* TypeCheck */ |
| 2169 | |
| 2170 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2171 | directory = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2172 | else |
| 2173 | directory = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2174 | |
| 2175 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2176 | |
| 2177 | OutP->RetCode = trivfs_S_dir_mkdir(directory, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->name, In0P->mode); |
| 2178 | trivfs_end_using_protid(directory); |
| 2179 | } |
| 2180 | |
| 2181 | /* Default implementation of trivfs_S_dir_mkdir */ |
| 2182 | #ifdef MIG_EOPNOTSUPP |
| 2183 | kern_return_t __attribute__ ((weak)) |
| 2184 | trivfs_S_dir_mkdir |
| 2185 | ( |
| 2186 | trivfs_protid_t directory, |
| 2187 | mach_port_t reply, |
| 2188 | mach_msg_type_name_t replyPoly, |
| 2189 | string_t name, |
| 2190 | mode_t mode |
| 2191 | ) { return MIG_EOPNOTSUPP; } |
| 2192 | #endif /* MIG_EOPNOTSUPP */ |
| 2193 | |
| 2194 | /* Routine dir_rmdir */ |
| 2195 | mig_internalstatic void _Xdir_rmdir |
| 2196 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2197 | { |
| 2198 | typedef struct { |
| 2199 | mach_msg_header_t Head; |
| 2200 | mach_msg_type_t nameType; |
| 2201 | string_t name; |
| 2202 | } Request; |
| 2203 | |
| 2204 | typedef struct { |
| 2205 | mach_msg_header_t Head; |
| 2206 | mach_msg_type_t RetCodeType; |
| 2207 | kern_return_t RetCode; |
| 2208 | } Reply; |
| 2209 | |
| 2210 | Request *In0P = (Request *) InHeadP; |
| 2211 | Reply *OutP = (Reply *) OutHeadP; |
| 2212 | mig_external kern_return_t trivfs_S_dir_rmdir |
| 2213 | (trivfs_protid_t directory, mach_port_t reply, mach_msg_type_name_t replyPoly, string_t name); |
| 2214 | |
| 2215 | const mach_msg_type_t nameCheck = { |
| 2216 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 2217 | /* msgt_size = */ 8, |
| 2218 | /* msgt_number = */ 1024, |
| 2219 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2220 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2221 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2222 | /* msgt_unused = */ 0 |
| 2223 | }; |
| 2224 | |
| 2225 | trivfs_protid_t directory; |
| 2226 | mach_port_t reply; |
| 2227 | |
| 2228 | #if TypeCheck1 |
| 2229 | if (mig_unlikely ((In0P->Head.msgh_size != 1052) ||__builtin_expect (!! ((In0P->Head.msgh_size != 1052) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 2230 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 1052) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 2231 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2232 | #endif /* TypeCheck */ |
| 2233 | |
| 2234 | #if TypeCheck1 |
| 2235 | 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)) |
| 2236 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2237 | #endif /* TypeCheck */ |
| 2238 | |
| 2239 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2240 | directory = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2241 | else |
| 2242 | directory = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2243 | |
| 2244 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2245 | |
| 2246 | OutP->RetCode = trivfs_S_dir_rmdir(directory, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->name); |
| 2247 | trivfs_end_using_protid(directory); |
| 2248 | } |
| 2249 | |
| 2250 | /* Default implementation of trivfs_S_dir_rmdir */ |
| 2251 | #ifdef MIG_EOPNOTSUPP |
| 2252 | kern_return_t __attribute__ ((weak)) |
| 2253 | trivfs_S_dir_rmdir |
| 2254 | ( |
| 2255 | trivfs_protid_t directory, |
| 2256 | mach_port_t reply, |
| 2257 | mach_msg_type_name_t replyPoly, |
| 2258 | string_t name |
| 2259 | ) { return MIG_EOPNOTSUPP; } |
| 2260 | #endif /* MIG_EOPNOTSUPP */ |
| 2261 | |
| 2262 | /* Routine dir_unlink */ |
| 2263 | mig_internalstatic void _Xdir_unlink |
| 2264 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2265 | { |
| 2266 | typedef struct { |
| 2267 | mach_msg_header_t Head; |
| 2268 | mach_msg_type_t nameType; |
| 2269 | string_t name; |
| 2270 | } Request; |
| 2271 | |
| 2272 | typedef struct { |
| 2273 | mach_msg_header_t Head; |
| 2274 | mach_msg_type_t RetCodeType; |
| 2275 | kern_return_t RetCode; |
| 2276 | } Reply; |
| 2277 | |
| 2278 | Request *In0P = (Request *) InHeadP; |
| 2279 | Reply *OutP = (Reply *) OutHeadP; |
| 2280 | mig_external kern_return_t trivfs_S_dir_unlink |
| 2281 | (trivfs_protid_t directory, mach_port_t reply, mach_msg_type_name_t replyPoly, string_t name); |
| 2282 | |
| 2283 | const mach_msg_type_t nameCheck = { |
| 2284 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 2285 | /* msgt_size = */ 8, |
| 2286 | /* msgt_number = */ 1024, |
| 2287 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2288 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2289 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2290 | /* msgt_unused = */ 0 |
| 2291 | }; |
| 2292 | |
| 2293 | trivfs_protid_t directory; |
| 2294 | mach_port_t reply; |
| 2295 | |
| 2296 | #if TypeCheck1 |
| 2297 | if (mig_unlikely ((In0P->Head.msgh_size != 1052) ||__builtin_expect (!! ((In0P->Head.msgh_size != 1052) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 2298 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 1052) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 2299 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2300 | #endif /* TypeCheck */ |
| 2301 | |
| 2302 | #if TypeCheck1 |
| 2303 | 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)) |
| 2304 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2305 | #endif /* TypeCheck */ |
| 2306 | |
| 2307 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2308 | directory = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2309 | else |
| 2310 | directory = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2311 | |
| 2312 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2313 | |
| 2314 | OutP->RetCode = trivfs_S_dir_unlink(directory, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->name); |
| 2315 | trivfs_end_using_protid(directory); |
| 2316 | } |
| 2317 | |
| 2318 | /* Default implementation of trivfs_S_dir_unlink */ |
| 2319 | #ifdef MIG_EOPNOTSUPP |
| 2320 | kern_return_t __attribute__ ((weak)) |
| 2321 | trivfs_S_dir_unlink |
| 2322 | ( |
| 2323 | trivfs_protid_t directory, |
| 2324 | mach_port_t reply, |
| 2325 | mach_msg_type_name_t replyPoly, |
| 2326 | string_t name |
| 2327 | ) { return MIG_EOPNOTSUPP; } |
| 2328 | #endif /* MIG_EOPNOTSUPP */ |
| 2329 | |
| 2330 | /* Routine dir_link */ |
| 2331 | mig_internalstatic void _Xdir_link |
| 2332 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2333 | { |
| 2334 | typedef struct { |
| 2335 | mach_msg_header_t Head; |
| 2336 | mach_msg_type_t fileType; |
| 2337 | file_t file; |
| 2338 | mach_msg_type_t nameType; |
| 2339 | string_t name; |
| 2340 | mach_msg_type_t exclType; |
| 2341 | int excl; |
| 2342 | } Request; |
| 2343 | |
| 2344 | typedef struct { |
| 2345 | mach_msg_header_t Head; |
| 2346 | mach_msg_type_t RetCodeType; |
| 2347 | kern_return_t RetCode; |
| 2348 | } Reply; |
| 2349 | |
| 2350 | Request *In0P = (Request *) InHeadP; |
| 2351 | Reply *OutP = (Reply *) OutHeadP; |
| 2352 | mig_external kern_return_t trivfs_S_dir_link |
| 2353 | (trivfs_protid_t dir, mach_port_t reply, mach_msg_type_name_t replyPoly, trivfs_protid_t file, string_t name, int excl); |
| 2354 | |
| 2355 | const mach_msg_type_t fileCheck = { |
| 2356 | /* msgt_name = */ 17, |
| 2357 | /* msgt_size = */ 32, |
| 2358 | /* msgt_number = */ 1, |
| 2359 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2360 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2361 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2362 | /* msgt_unused = */ 0 |
| 2363 | }; |
| 2364 | |
| 2365 | const mach_msg_type_t nameCheck = { |
| 2366 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 2367 | /* msgt_size = */ 8, |
| 2368 | /* msgt_number = */ 1024, |
| 2369 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2370 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2371 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2372 | /* msgt_unused = */ 0 |
| 2373 | }; |
| 2374 | |
| 2375 | const mach_msg_type_t exclCheck = { |
| 2376 | /* msgt_name = */ 2, |
| 2377 | /* msgt_size = */ 32, |
| 2378 | /* msgt_number = */ 1, |
| 2379 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2380 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2381 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2382 | /* msgt_unused = */ 0 |
| 2383 | }; |
| 2384 | |
| 2385 | trivfs_protid_t dir; |
| 2386 | mach_port_t reply; |
| 2387 | trivfs_protid_t file; |
| 2388 | |
| 2389 | #if TypeCheck1 |
| 2390 | if (mig_unlikely ((In0P->Head.msgh_size != 1068) ||__builtin_expect (!! ((In0P->Head.msgh_size != 1068) || !( In0P->Head.msgh_bits & 0x80000000U)), 0) |
| 2391 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 1068) || !( In0P->Head.msgh_bits & 0x80000000U)), 0)) |
| 2392 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2393 | #endif /* TypeCheck */ |
| 2394 | |
| 2395 | #if TypeCheck1 |
| 2396 | if (BAD_TYPECHECK(&In0P->fileType, &fileCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->fileType); _c.t = *(& fileCheck);_t.w != _c.w; })), 0)) |
| 2397 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2398 | #endif /* TypeCheck */ |
| 2399 | |
| 2400 | #if TypeCheck1 |
| 2401 | 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)) |
| 2402 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2403 | #endif /* TypeCheck */ |
| 2404 | |
| 2405 | #if TypeCheck1 |
| 2406 | if (BAD_TYPECHECK(&In0P->exclType, &exclCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->exclType); _c.t = *(& exclCheck);_t.w != _c.w; })), 0)) |
| 2407 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2408 | #endif /* TypeCheck */ |
| 2409 | |
| 2410 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2411 | dir = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2412 | else |
| 2413 | dir = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2414 | |
| 2415 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2416 | |
| 2417 | file = trivfs_begin_using_protid(In0P->file); |
| 2418 | |
| 2419 | OutP->RetCode = trivfs_S_dir_link(dir, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), file, In0P->name, In0P->excl); |
| 2420 | trivfs_end_using_protid(file); |
| 2421 | trivfs_end_using_protid(dir); |
| 2422 | } |
| 2423 | |
| 2424 | /* Default implementation of trivfs_S_dir_link */ |
| 2425 | #ifdef MIG_EOPNOTSUPP |
| 2426 | kern_return_t __attribute__ ((weak)) |
| 2427 | trivfs_S_dir_link |
| 2428 | ( |
| 2429 | trivfs_protid_t dir, |
| 2430 | mach_port_t reply, |
| 2431 | mach_msg_type_name_t replyPoly, |
| 2432 | trivfs_protid_t file, |
| 2433 | string_t name, |
| 2434 | int excl |
| 2435 | ) { return MIG_EOPNOTSUPP; } |
| 2436 | #endif /* MIG_EOPNOTSUPP */ |
| 2437 | |
| 2438 | /* Routine dir_rename */ |
| 2439 | mig_internalstatic void _Xdir_rename |
| 2440 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2441 | { |
| 2442 | typedef struct { |
| 2443 | mach_msg_header_t Head; |
| 2444 | mach_msg_type_t oldnameType; |
| 2445 | string_t oldname; |
| 2446 | mach_msg_type_t newdirectoryType; |
| 2447 | file_t newdirectory; |
| 2448 | mach_msg_type_t newnameType; |
| 2449 | string_t newname; |
| 2450 | mach_msg_type_t exclType; |
| 2451 | int excl; |
| 2452 | } Request; |
| 2453 | |
| 2454 | typedef struct { |
| 2455 | mach_msg_header_t Head; |
| 2456 | mach_msg_type_t RetCodeType; |
| 2457 | kern_return_t RetCode; |
| 2458 | } Reply; |
| 2459 | |
| 2460 | Request *In0P = (Request *) InHeadP; |
| 2461 | Reply *OutP = (Reply *) OutHeadP; |
| 2462 | mig_external kern_return_t trivfs_S_dir_rename |
| 2463 | (trivfs_protid_t olddirectory, mach_port_t reply, mach_msg_type_name_t replyPoly, string_t oldname, trivfs_protid_t newdirectory, string_t newname, int excl); |
| 2464 | |
| 2465 | const mach_msg_type_t oldnameCheck = { |
| 2466 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 2467 | /* msgt_size = */ 8, |
| 2468 | /* msgt_number = */ 1024, |
| 2469 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2470 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2471 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2472 | /* msgt_unused = */ 0 |
| 2473 | }; |
| 2474 | |
| 2475 | const mach_msg_type_t newdirectoryCheck = { |
| 2476 | /* msgt_name = */ 17, |
| 2477 | /* msgt_size = */ 32, |
| 2478 | /* msgt_number = */ 1, |
| 2479 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2480 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2481 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2482 | /* msgt_unused = */ 0 |
| 2483 | }; |
| 2484 | |
| 2485 | const mach_msg_type_t newnameCheck = { |
| 2486 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 2487 | /* msgt_size = */ 8, |
| 2488 | /* msgt_number = */ 1024, |
| 2489 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2490 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2491 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2492 | /* msgt_unused = */ 0 |
| 2493 | }; |
| 2494 | |
| 2495 | const mach_msg_type_t exclCheck = { |
| 2496 | /* msgt_name = */ 2, |
| 2497 | /* msgt_size = */ 32, |
| 2498 | /* msgt_number = */ 1, |
| 2499 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2500 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2501 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2502 | /* msgt_unused = */ 0 |
| 2503 | }; |
| 2504 | |
| 2505 | trivfs_protid_t olddirectory; |
| 2506 | mach_port_t reply; |
| 2507 | trivfs_protid_t newdirectory; |
| 2508 | |
| 2509 | #if TypeCheck1 |
| 2510 | if (mig_unlikely ((In0P->Head.msgh_size != 2096) ||__builtin_expect (!! ((In0P->Head.msgh_size != 2096) || !( In0P->Head.msgh_bits & 0x80000000U)), 0) |
| 2511 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 2096) || !( In0P->Head.msgh_bits & 0x80000000U)), 0)) |
| 2512 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2513 | #endif /* TypeCheck */ |
| 2514 | |
| 2515 | #if TypeCheck1 |
| 2516 | if (BAD_TYPECHECK(&In0P->oldnameType, &oldnameCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->oldnameType); _c.t = *(& oldnameCheck);_t.w != _c.w; })), 0)) |
| 2517 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2518 | #endif /* TypeCheck */ |
| 2519 | |
| 2520 | #if TypeCheck1 |
| 2521 | if (BAD_TYPECHECK(&In0P->newdirectoryType, &newdirectoryCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->newdirectoryType); _c.t = *(&newdirectoryCheck);_t.w != _c.w; })), 0)) |
| 2522 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2523 | #endif /* TypeCheck */ |
| 2524 | |
| 2525 | #if TypeCheck1 |
| 2526 | if (BAD_TYPECHECK(&In0P->newnameType, &newnameCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->newnameType); _c.t = *(& newnameCheck);_t.w != _c.w; })), 0)) |
| 2527 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2528 | #endif /* TypeCheck */ |
| 2529 | |
| 2530 | #if TypeCheck1 |
| 2531 | if (BAD_TYPECHECK(&In0P->exclType, &exclCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->exclType); _c.t = *(& exclCheck);_t.w != _c.w; })), 0)) |
| 2532 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2533 | #endif /* TypeCheck */ |
| 2534 | |
| 2535 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2536 | olddirectory = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2537 | else |
| 2538 | olddirectory = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2539 | |
| 2540 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2541 | |
| 2542 | newdirectory = trivfs_begin_using_protid(In0P->newdirectory); |
| 2543 | |
| 2544 | OutP->RetCode = trivfs_S_dir_rename(olddirectory, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->oldname, newdirectory, In0P->newname, In0P->excl); |
| 2545 | trivfs_end_using_protid(newdirectory); |
| 2546 | trivfs_end_using_protid(olddirectory); |
| 2547 | } |
| 2548 | |
| 2549 | /* Default implementation of trivfs_S_dir_rename */ |
| 2550 | #ifdef MIG_EOPNOTSUPP |
| 2551 | kern_return_t __attribute__ ((weak)) |
| 2552 | trivfs_S_dir_rename |
| 2553 | ( |
| 2554 | trivfs_protid_t olddirectory, |
| 2555 | mach_port_t reply, |
| 2556 | mach_msg_type_name_t replyPoly, |
| 2557 | string_t oldname, |
| 2558 | trivfs_protid_t newdirectory, |
| 2559 | string_t newname, |
| 2560 | int excl |
| 2561 | ) { return MIG_EOPNOTSUPP; } |
| 2562 | #endif /* MIG_EOPNOTSUPP */ |
| 2563 | |
| 2564 | /* Routine dir_mkfile */ |
| 2565 | mig_internalstatic void _Xdir_mkfile |
| 2566 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2567 | { |
| 2568 | typedef struct { |
| 2569 | mach_msg_header_t Head; |
| 2570 | mach_msg_type_t flagsType; |
| 2571 | int flags; |
| 2572 | mach_msg_type_t modeType; |
| 2573 | mode_t mode; |
| 2574 | } Request; |
| 2575 | |
| 2576 | typedef struct { |
| 2577 | mach_msg_header_t Head; |
| 2578 | mach_msg_type_t RetCodeType; |
| 2579 | kern_return_t RetCode; |
| 2580 | mach_msg_type_t newnodeType; |
| 2581 | mach_port_t newnode; |
| 2582 | } Reply; |
| 2583 | |
| 2584 | Request *In0P = (Request *) InHeadP; |
| 2585 | Reply *OutP = (Reply *) OutHeadP; |
| 2586 | mig_external kern_return_t trivfs_S_dir_mkfile |
| 2587 | (trivfs_protid_t directory, mach_port_t reply, mach_msg_type_name_t replyPoly, int flags, mode_t mode, mach_port_t *newnode, mach_msg_type_name_t *newnodePoly); |
| 2588 | |
| 2589 | boolean_t msgh_simple = msgh_simple; |
| 2590 | const mach_msg_type_t flagsCheck = { |
| 2591 | /* msgt_name = */ 2, |
| 2592 | /* msgt_size = */ 32, |
| 2593 | /* msgt_number = */ 1, |
| 2594 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2595 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2596 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2597 | /* msgt_unused = */ 0 |
| 2598 | }; |
| 2599 | |
| 2600 | const mach_msg_type_t modeCheck = { |
| 2601 | /* msgt_name = */ 2, |
| 2602 | /* msgt_size = */ 32, |
| 2603 | /* msgt_number = */ 1, |
| 2604 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2605 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2606 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2607 | /* msgt_unused = */ 0 |
| 2608 | }; |
| 2609 | |
| 2610 | const mach_msg_type_t newnodeType = { |
| 2611 | /* msgt_name = */ -1, |
| 2612 | /* msgt_size = */ 32, |
| 2613 | /* msgt_number = */ 1, |
| 2614 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2615 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2616 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2617 | /* msgt_unused = */ 0 |
| 2618 | }; |
| 2619 | |
| 2620 | trivfs_protid_t directory; |
| 2621 | mach_port_t reply; |
| 2622 | mach_msg_type_name_t newnodePoly; |
| 2623 | |
| 2624 | #if TypeCheck1 |
| 2625 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 2626 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 2627 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2628 | #endif /* TypeCheck */ |
| 2629 | |
| 2630 | #if TypeCheck1 |
| 2631 | if (BAD_TYPECHECK(&In0P->flagsType, &flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->flagsType); _c.t = *(& flagsCheck);_t.w != _c.w; })), 0)) |
| 2632 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2633 | #endif /* TypeCheck */ |
| 2634 | |
| 2635 | #if TypeCheck1 |
| 2636 | if (BAD_TYPECHECK(&In0P->modeType, &modeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->modeType); _c.t = *(& modeCheck);_t.w != _c.w; })), 0)) |
| 2637 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2638 | #endif /* TypeCheck */ |
| 2639 | |
| 2640 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2641 | directory = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2642 | else |
| 2643 | directory = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2644 | |
| 2645 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2646 | |
| 2647 | OutP->RetCode = trivfs_S_dir_mkfile(directory, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->flags, In0P->mode, &OutP->newnode, &newnodePoly); |
| 2648 | trivfs_end_using_protid(directory); |
| 2649 | if (OutP->RetCode != KERN_SUCCESS0) |
| 2650 | return; |
| 2651 | |
| 2652 | msgh_simple = TRUE((boolean_t) 1); |
| 2653 | OutP->Head.msgh_size = 40; |
| 2654 | |
| 2655 | OutP->newnodeType = newnodeType; |
| 2656 | |
| 2657 | if (MACH_MSG_TYPE_PORT_ANY(newnodePoly)(((newnodePoly) >= 16) && ((newnodePoly) <= 21) )) |
| 2658 | msgh_simple = FALSE((boolean_t) 0); |
| 2659 | |
| 2660 | OutP->newnodeType.msgt_name = newnodePoly; |
| 2661 | |
| 2662 | if (!msgh_simple) |
| 2663 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 2664 | } |
| 2665 | |
| 2666 | /* Default implementation of trivfs_S_dir_mkfile */ |
| 2667 | #ifdef MIG_EOPNOTSUPP |
| 2668 | kern_return_t __attribute__ ((weak)) |
| 2669 | trivfs_S_dir_mkfile |
| 2670 | ( |
| 2671 | trivfs_protid_t directory, |
| 2672 | mach_port_t reply, |
| 2673 | mach_msg_type_name_t replyPoly, |
| 2674 | int flags, |
| 2675 | mode_t mode, |
| 2676 | mach_port_t *newnode, |
| 2677 | mach_msg_type_name_t *newnodePoly |
| 2678 | ) { return MIG_EOPNOTSUPP; } |
| 2679 | #endif /* MIG_EOPNOTSUPP */ |
| 2680 | |
| 2681 | /* Routine dir_notice_changes */ |
| 2682 | mig_internalstatic void _Xdir_notice_changes |
| 2683 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2684 | { |
| 2685 | typedef struct { |
| 2686 | mach_msg_header_t Head; |
| 2687 | mach_msg_type_t portType; |
| 2688 | mach_port_t port; |
| 2689 | } Request; |
| 2690 | |
| 2691 | typedef struct { |
| 2692 | mach_msg_header_t Head; |
| 2693 | mach_msg_type_t RetCodeType; |
| 2694 | kern_return_t RetCode; |
| 2695 | } Reply; |
| 2696 | |
| 2697 | Request *In0P = (Request *) InHeadP; |
| 2698 | Reply *OutP = (Reply *) OutHeadP; |
| 2699 | mig_external kern_return_t trivfs_S_dir_notice_changes |
| 2700 | (trivfs_protid_t directory, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t port); |
| 2701 | |
| 2702 | const mach_msg_type_t portCheck = { |
| 2703 | /* msgt_name = */ 17, |
| 2704 | /* msgt_size = */ 32, |
| 2705 | /* msgt_number = */ 1, |
| 2706 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2707 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2708 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2709 | /* msgt_unused = */ 0 |
| 2710 | }; |
| 2711 | |
| 2712 | trivfs_protid_t directory; |
| 2713 | mach_port_t reply; |
| 2714 | |
| 2715 | #if TypeCheck1 |
| 2716 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 2717 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 2718 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2719 | #endif /* TypeCheck */ |
| 2720 | |
| 2721 | #if TypeCheck1 |
| 2722 | if (BAD_TYPECHECK(&In0P->portType, &portCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->portType); _c.t = *(& portCheck);_t.w != _c.w; })), 0)) |
| 2723 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2724 | #endif /* TypeCheck */ |
| 2725 | |
| 2726 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2727 | directory = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2728 | else |
| 2729 | directory = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2730 | |
| 2731 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2732 | |
| 2733 | OutP->RetCode = trivfs_S_dir_notice_changes(directory, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->port); |
| 2734 | trivfs_end_using_protid(directory); |
| 2735 | } |
| 2736 | |
| 2737 | /* Default implementation of trivfs_S_dir_notice_changes */ |
| 2738 | #ifdef MIG_EOPNOTSUPP |
| 2739 | kern_return_t __attribute__ ((weak)) |
| 2740 | trivfs_S_dir_notice_changes |
| 2741 | ( |
| 2742 | trivfs_protid_t directory, |
| 2743 | mach_port_t reply, |
| 2744 | mach_msg_type_name_t replyPoly, |
| 2745 | mach_port_t port |
| 2746 | ) { return MIG_EOPNOTSUPP; } |
| 2747 | #endif /* MIG_EOPNOTSUPP */ |
| 2748 | |
| 2749 | /* Routine file_set_translator */ |
| 2750 | mig_internalstatic void _Xfile_set_translator |
| 2751 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2752 | { |
| 2753 | typedef struct { |
| 2754 | mach_msg_header_t Head; |
| 2755 | mach_msg_type_t passive_flagsType; |
| 2756 | int passive_flags; |
| 2757 | mach_msg_type_t active_flagsType; |
| 2758 | int active_flags; |
| 2759 | mach_msg_type_t oldtrans_flagsType; |
| 2760 | int oldtrans_flags; |
| 2761 | mach_msg_type_long_t passiveType; |
| 2762 | char passive[2048]; |
| 2763 | mach_msg_type_t activeType; |
| 2764 | mach_port_t active; |
| 2765 | } Request; |
| 2766 | |
| 2767 | typedef struct { |
| 2768 | mach_msg_header_t Head; |
| 2769 | mach_msg_type_t RetCodeType; |
| 2770 | kern_return_t RetCode; |
| 2771 | } Reply; |
| 2772 | |
| 2773 | Request *In0P = (Request *) InHeadP; |
| 2774 | Request *In1P; |
| 2775 | Reply *OutP = (Reply *) OutHeadP; |
| 2776 | mig_external kern_return_t trivfs_S_file_set_translator |
| 2777 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, int passive_flags, int active_flags, int oldtrans_flags, data_t passive, mach_msg_type_number_t passiveCnt, mach_port_t active); |
| 2778 | |
| 2779 | unsigned int msgh_size; |
| 2780 | unsigned int msgh_size_delta; |
| 2781 | |
| 2782 | const mach_msg_type_t passive_flagsCheck = { |
| 2783 | /* msgt_name = */ 2, |
| 2784 | /* msgt_size = */ 32, |
| 2785 | /* msgt_number = */ 1, |
| 2786 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2787 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2788 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2789 | /* msgt_unused = */ 0 |
| 2790 | }; |
| 2791 | |
| 2792 | const mach_msg_type_t active_flagsCheck = { |
| 2793 | /* msgt_name = */ 2, |
| 2794 | /* msgt_size = */ 32, |
| 2795 | /* msgt_number = */ 1, |
| 2796 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2797 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2798 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2799 | /* msgt_unused = */ 0 |
| 2800 | }; |
| 2801 | |
| 2802 | const mach_msg_type_t oldtrans_flagsCheck = { |
| 2803 | /* msgt_name = */ 2, |
| 2804 | /* msgt_size = */ 32, |
| 2805 | /* msgt_number = */ 1, |
| 2806 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2807 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2808 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2809 | /* msgt_unused = */ 0 |
| 2810 | }; |
| 2811 | |
| 2812 | const mach_msg_type_t activeCheck = { |
| 2813 | /* msgt_name = */ 17, |
| 2814 | /* msgt_size = */ 32, |
| 2815 | /* msgt_number = */ 1, |
| 2816 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2817 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 2818 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2819 | /* msgt_unused = */ 0 |
| 2820 | }; |
| 2821 | |
| 2822 | trivfs_protid_t file; |
| 2823 | mach_port_t reply; |
| 2824 | |
| 2825 | #if TypeCheck1 |
| 2826 | msgh_size = In0P->Head.msgh_size; |
| 2827 | if (mig_unlikely ((msgh_size < 68) ||__builtin_expect (!! ((msgh_size < 68) || !(In0P->Head. msgh_bits & 0x80000000U)), 0) |
| 2828 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((msgh_size < 68) || !(In0P->Head. msgh_bits & 0x80000000U)), 0)) |
| 2829 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2830 | #endif /* TypeCheck */ |
| 2831 | |
| 2832 | #if TypeCheck1 |
| 2833 | if (BAD_TYPECHECK(&In0P->passive_flagsType, &passive_flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->passive_flagsType); _c.t = *(&passive_flagsCheck);_t.w != _c.w; })), 0)) |
| 2834 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2835 | #endif /* TypeCheck */ |
| 2836 | |
| 2837 | #if TypeCheck1 |
| 2838 | if (BAD_TYPECHECK(&In0P->active_flagsType, &active_flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->active_flagsType); _c.t = *(&active_flagsCheck);_t.w != _c.w; })), 0)) |
| 2839 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2840 | #endif /* TypeCheck */ |
| 2841 | |
| 2842 | #if TypeCheck1 |
| 2843 | if (BAD_TYPECHECK(&In0P->oldtrans_flagsType, &oldtrans_flagsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->oldtrans_flagsType); _c. t = *(&oldtrans_flagsCheck);_t.w != _c.w; })), 0)) |
| 2844 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2845 | #endif /* TypeCheck */ |
| 2846 | |
| 2847 | #if TypeCheck1 |
| 2848 | if (mig_unlikely ((In0P->passiveType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In0P->passiveType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->passiveType.msgtl_name != 8 ) || (In0P->passiveType.msgtl_size != 8)), 0) |
| 2849 | (In0P->passiveType.msgtl_name != 8) ||__builtin_expect (!! ((In0P->passiveType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->passiveType.msgtl_name != 8 ) || (In0P->passiveType.msgtl_size != 8)), 0) |
| 2850 | (In0P->passiveType.msgtl_size != 8))__builtin_expect (!! ((In0P->passiveType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->passiveType.msgtl_name != 8 ) || (In0P->passiveType.msgtl_size != 8)), 0)) |
| 2851 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2852 | #endif /* TypeCheck */ |
| 2853 | |
| 2854 | msgh_size_delta = (In0P->passiveType.msgtl_header.msgt_inline) ? (In0P->passiveType.msgtl_number + 3) & ~3 : sizeof(char *); |
| 2855 | #if TypeCheck1 |
| 2856 | if (mig_unlikely (msgh_size != 68 + msgh_size_delta)__builtin_expect (!! (msgh_size != 68 + msgh_size_delta), 0)) |
| 2857 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2858 | #endif /* TypeCheck */ |
| 2859 | |
| 2860 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
| 2861 | |
| 2862 | #if TypeCheck1 |
| 2863 | if (BAD_TYPECHECK(&In1P->activeType, &activeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In1P->activeType); _c.t = *(& activeCheck);_t.w != _c.w; })), 0)) |
| 2864 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2865 | #endif /* TypeCheck */ |
| 2866 | |
| 2867 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2868 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2869 | else |
| 2870 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2871 | |
| 2872 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2873 | |
| 2874 | OutP->RetCode = trivfs_S_file_set_translator(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->passive_flags, In0P->active_flags, In0P->oldtrans_flags, (In0P->passiveType.msgtl_header.msgt_inline) ? In0P->passive : *((char **)In0P->passive), In0P->passiveType.msgtl_number, In1P->active); |
| 2875 | if (OutP->RetCode == KERN_SUCCESS0) |
| 2876 | if (!In0P->passiveType.msgtl_header.msgt_inline) |
| 2877 | __mig_deallocate(* (vm_offset_t *) In0P->passive, In0P->passiveType.msgtl_number); |
| 2878 | trivfs_end_using_protid(file); |
| 2879 | } |
| 2880 | |
| 2881 | /* Default implementation of trivfs_S_file_set_translator */ |
| 2882 | #ifdef MIG_EOPNOTSUPP |
| 2883 | kern_return_t __attribute__ ((weak)) |
| 2884 | trivfs_S_file_set_translator |
| 2885 | ( |
| 2886 | trivfs_protid_t file, |
| 2887 | mach_port_t reply, |
| 2888 | mach_msg_type_name_t replyPoly, |
| 2889 | int passive_flags, |
| 2890 | int active_flags, |
| 2891 | int oldtrans_flags, |
| 2892 | data_t passive, |
| 2893 | mach_msg_type_number_t passiveCnt, |
| 2894 | mach_port_t active |
| 2895 | ) { return MIG_EOPNOTSUPP; } |
| 2896 | #endif /* MIG_EOPNOTSUPP */ |
| 2897 | |
| 2898 | /* Routine file_get_translator */ |
| 2899 | mig_internalstatic void _Xfile_get_translator |
| 2900 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2901 | { |
| 2902 | typedef struct { |
| 2903 | mach_msg_header_t Head; |
| 2904 | } Request; |
| 2905 | |
| 2906 | typedef struct { |
| 2907 | mach_msg_header_t Head; |
| 2908 | mach_msg_type_t RetCodeType; |
| 2909 | kern_return_t RetCode; |
| 2910 | mach_msg_type_long_t translatorType; |
| 2911 | char translator[2048]; |
| 2912 | } Reply; |
| 2913 | |
| 2914 | Request *In0P = (Request *) InHeadP; |
| 2915 | Reply *OutP = (Reply *) OutHeadP; |
| 2916 | mig_external kern_return_t trivfs_S_file_get_translator |
| 2917 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t *translator, mach_msg_type_number_t *translatorCnt); |
| 2918 | |
| 2919 | boolean_t msgh_simple = msgh_simple; |
| 2920 | const mach_msg_type_long_t translatorType = { |
| 2921 | { |
| 2922 | /* msgt_name = */ 0, |
| 2923 | /* msgt_size = */ 0, |
| 2924 | /* msgt_number = */ 0, |
| 2925 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 2926 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 2927 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 2928 | /* msgt_unused = */ 0 |
| 2929 | }, |
| 2930 | /* msgtl_name = */ 8, |
| 2931 | /* msgtl_size = */ 8, |
| 2932 | /* msgtl_number = */ 2048, |
| 2933 | }; |
| 2934 | |
| 2935 | trivfs_protid_t file; |
| 2936 | mach_port_t reply; |
| 2937 | mach_msg_type_number_t translatorCnt; |
| 2938 | |
| 2939 | char *translatorP; |
| 2940 | |
| 2941 | #if TypeCheck1 |
| 2942 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 2943 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 2944 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 2945 | #endif /* TypeCheck */ |
| 2946 | |
| 2947 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 2948 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 2949 | else |
| 2950 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 2951 | |
| 2952 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 2953 | |
| 2954 | translatorP = OutP->translator; |
| 2955 | translatorCnt = 2048; |
| 2956 | |
| 2957 | OutP->RetCode = trivfs_S_file_get_translator(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &translatorP, &translatorCnt); |
| 2958 | trivfs_end_using_protid(file); |
| 2959 | if (OutP->RetCode != KERN_SUCCESS0) |
| 2960 | return; |
| 2961 | |
| 2962 | msgh_simple = TRUE((boolean_t) 1); |
| 2963 | |
| 2964 | OutP->translatorType = translatorType; |
| 2965 | if (translatorP != OutP->translator) { |
| 2966 | OutP->translatorType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 2967 | OutP->translatorType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 2968 | *((char **)OutP->translator) = translatorP; |
| 2969 | msgh_simple = FALSE((boolean_t) 0); |
| 2970 | } |
| 2971 | |
| 2972 | OutP->translatorType.msgtl_number = translatorCnt; |
| 2973 | OutP->Head.msgh_size = 44 + ((OutP->translatorType.msgtl_header.msgt_inline) ? (translatorCnt + 3) & ~3 : sizeof(char *)); |
| 2974 | |
| 2975 | if (!msgh_simple) |
| 2976 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 2977 | } |
| 2978 | |
| 2979 | /* Default implementation of trivfs_S_file_get_translator */ |
| 2980 | #ifdef MIG_EOPNOTSUPP |
| 2981 | kern_return_t __attribute__ ((weak)) |
| 2982 | trivfs_S_file_get_translator |
| 2983 | ( |
| 2984 | trivfs_protid_t file, |
| 2985 | mach_port_t reply, |
| 2986 | mach_msg_type_name_t replyPoly, |
| 2987 | data_t *translator, |
| 2988 | mach_msg_type_number_t *translatorCnt |
| 2989 | ) { return MIG_EOPNOTSUPP; } |
| 2990 | #endif /* MIG_EOPNOTSUPP */ |
| 2991 | |
| 2992 | /* Routine file_get_translator_cntl */ |
| 2993 | mig_internalstatic void _Xfile_get_translator_cntl |
| 2994 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 2995 | { |
| 2996 | typedef struct { |
| 2997 | mach_msg_header_t Head; |
| 2998 | } Request; |
| 2999 | |
| 3000 | typedef struct { |
| 3001 | mach_msg_header_t Head; |
| 3002 | mach_msg_type_t RetCodeType; |
| 3003 | kern_return_t RetCode; |
| 3004 | mach_msg_type_t translator_cntlType; |
| 3005 | mach_port_t translator_cntl; |
| 3006 | } Reply; |
| 3007 | |
| 3008 | Request *In0P = (Request *) InHeadP; |
| 3009 | Reply *OutP = (Reply *) OutHeadP; |
| 3010 | mig_external kern_return_t trivfs_S_file_get_translator_cntl |
| 3011 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *translator_cntl, mach_msg_type_name_t *translator_cntlPoly); |
| 3012 | |
| 3013 | boolean_t msgh_simple = msgh_simple; |
| 3014 | const mach_msg_type_t translator_cntlType = { |
| 3015 | /* msgt_name = */ -1, |
| 3016 | /* msgt_size = */ 32, |
| 3017 | /* msgt_number = */ 1, |
| 3018 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 3019 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 3020 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 3021 | /* msgt_unused = */ 0 |
| 3022 | }; |
| 3023 | |
| 3024 | trivfs_protid_t file; |
| 3025 | mach_port_t reply; |
| 3026 | mach_msg_type_name_t translator_cntlPoly; |
| 3027 | |
| 3028 | #if TypeCheck1 |
| 3029 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 3030 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 3031 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 3032 | #endif /* TypeCheck */ |
| 3033 | |
| 3034 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 3035 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 3036 | else |
| 3037 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 3038 | |
| 3039 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 3040 | |
| 3041 | OutP->RetCode = trivfs_S_file_get_translator_cntl(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->translator_cntl, &translator_cntlPoly); |
| 3042 | trivfs_end_using_protid(file); |
| 3043 | if (OutP->RetCode != KERN_SUCCESS0) |
| 3044 | return; |
| 3045 | |
| 3046 | msgh_simple = TRUE((boolean_t) 1); |
| 3047 | OutP->Head.msgh_size = 40; |
| 3048 | |
| 3049 | OutP->translator_cntlType = translator_cntlType; |
| 3050 | |
| 3051 | if (MACH_MSG_TYPE_PORT_ANY(translator_cntlPoly)(((translator_cntlPoly) >= 16) && ((translator_cntlPoly ) <= 21))) |
| 3052 | msgh_simple = FALSE((boolean_t) 0); |
| 3053 | |
| 3054 | OutP->translator_cntlType.msgt_name = translator_cntlPoly; |
| 3055 | |
| 3056 | if (!msgh_simple) |
| 3057 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 3058 | } |
| 3059 | |
| 3060 | /* Default implementation of trivfs_S_file_get_translator_cntl */ |
| 3061 | #ifdef MIG_EOPNOTSUPP |
| 3062 | kern_return_t __attribute__ ((weak)) |
| 3063 | trivfs_S_file_get_translator_cntl |
| 3064 | ( |
| 3065 | trivfs_protid_t file, |
| 3066 | mach_port_t reply, |
| 3067 | mach_msg_type_name_t replyPoly, |
| 3068 | mach_port_t *translator_cntl, |
| 3069 | mach_msg_type_name_t *translator_cntlPoly |
| 3070 | ) { return MIG_EOPNOTSUPP; } |
| 3071 | #endif /* MIG_EOPNOTSUPP */ |
| 3072 | |
| 3073 | /* Routine file_get_fs_options */ |
| 3074 | mig_internalstatic void _Xfile_get_fs_options |
| 3075 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3076 | { |
| 3077 | typedef struct { |
| 3078 | mach_msg_header_t Head; |
| 3079 | } Request; |
| 3080 | |
| 3081 | typedef struct { |
| 3082 | mach_msg_header_t Head; |
| 3083 | mach_msg_type_t RetCodeType; |
| 3084 | kern_return_t RetCode; |
| 3085 | mach_msg_type_long_t optionsType; |
| 3086 | char options[2048]; |
| 3087 | } Reply; |
| 3088 | |
| 3089 | Request *In0P = (Request *) InHeadP; |
| 3090 | Reply *OutP = (Reply *) OutHeadP; |
| 3091 | mig_external kern_return_t trivfs_S_file_get_fs_options |
| 3092 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t *options, mach_msg_type_number_t *optionsCnt); |
| 3093 | |
| 3094 | boolean_t msgh_simple = msgh_simple; |
| 3095 | const mach_msg_type_long_t optionsType = { |
| 3096 | { |
| 3097 | /* msgt_name = */ 0, |
| 3098 | /* msgt_size = */ 0, |
| 3099 | /* msgt_number = */ 0, |
| 3100 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 3101 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 3102 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 3103 | /* msgt_unused = */ 0 |
| 3104 | }, |
| 3105 | /* msgtl_name = */ 8, |
| 3106 | /* msgtl_size = */ 8, |
| 3107 | /* msgtl_number = */ 2048, |
| 3108 | }; |
| 3109 | |
| 3110 | trivfs_protid_t file; |
| 3111 | mach_port_t reply; |
| 3112 | mach_msg_type_number_t optionsCnt; |
| 3113 | |
| 3114 | char *optionsP; |
| 3115 | |
| 3116 | #if TypeCheck1 |
| 3117 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 3118 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 3119 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 3120 | #endif /* TypeCheck */ |
| 3121 | |
| 3122 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 3123 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 3124 | else |
| 3125 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 3126 | |
| 3127 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 3128 | |
| 3129 | optionsP = OutP->options; |
| 3130 | optionsCnt = 2048; |
| 3131 | |
| 3132 | OutP->RetCode = trivfs_S_file_get_fs_options(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &optionsP, &optionsCnt); |
| 3133 | trivfs_end_using_protid(file); |
| 3134 | if (OutP->RetCode != KERN_SUCCESS0) |
| 3135 | return; |
| 3136 | |
| 3137 | msgh_simple = TRUE((boolean_t) 1); |
| 3138 | |
| 3139 | OutP->optionsType = optionsType; |
| 3140 | if (optionsP != OutP->options) { |
| 3141 | OutP->optionsType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 3142 | OutP->optionsType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 3143 | *((char **)OutP->options) = optionsP; |
| 3144 | msgh_simple = FALSE((boolean_t) 0); |
| 3145 | } |
| 3146 | |
| 3147 | OutP->optionsType.msgtl_number = optionsCnt; |
| 3148 | OutP->Head.msgh_size = 44 + ((OutP->optionsType.msgtl_header.msgt_inline) ? (optionsCnt + 3) & ~3 : sizeof(char *)); |
| 3149 | |
| 3150 | if (!msgh_simple) |
| 3151 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 3152 | } |
| 3153 | |
| 3154 | /* Default implementation of trivfs_S_file_get_fs_options */ |
| 3155 | #ifdef MIG_EOPNOTSUPP |
| 3156 | kern_return_t __attribute__ ((weak)) |
| 3157 | trivfs_S_file_get_fs_options |
| 3158 | ( |
| 3159 | trivfs_protid_t file, |
| 3160 | mach_port_t reply, |
| 3161 | mach_msg_type_name_t replyPoly, |
| 3162 | data_t *options, |
| 3163 | mach_msg_type_number_t *optionsCnt |
| 3164 | ) { return MIG_EOPNOTSUPP; } |
| 3165 | #endif /* MIG_EOPNOTSUPP */ |
| 3166 | |
| 3167 | /* Routine file_reparent */ |
| 3168 | mig_internalstatic void _Xfile_reparent |
| 3169 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3170 | { |
| 3171 | typedef struct { |
| 3172 | mach_msg_header_t Head; |
| 3173 | mach_msg_type_t parentType; |
| 3174 | mach_port_t parent; |
| 3175 | } Request; |
| 3176 | |
| 3177 | typedef struct { |
| 3178 | mach_msg_header_t Head; |
| 3179 | mach_msg_type_t RetCodeType; |
| 3180 | kern_return_t RetCode; |
| 3181 | mach_msg_type_t new_fileType; |
| 3182 | mach_port_t new_file; |
| 3183 | } Reply; |
| 3184 | |
| 3185 | Request *In0P = (Request *) InHeadP; |
| 3186 | Reply *OutP = (Reply *) OutHeadP; |
| 3187 | mig_external kern_return_t trivfs_S_file_reparent |
| 3188 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t parent, mach_port_t *new_file, mach_msg_type_name_t *new_filePoly); |
| 3189 | |
| 3190 | boolean_t msgh_simple = msgh_simple; |
| 3191 | const mach_msg_type_t parentCheck = { |
| 3192 | /* msgt_name = */ 17, |
| 3193 | /* msgt_size = */ 32, |
| 3194 | /* msgt_number = */ 1, |
| 3195 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 3196 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 3197 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 3198 | /* msgt_unused = */ 0 |
| 3199 | }; |
| 3200 | |
| 3201 | const mach_msg_type_t new_fileType = { |
| 3202 | /* msgt_name = */ -1, |
| 3203 | /* msgt_size = */ 32, |
| 3204 | /* msgt_number = */ 1, |
| 3205 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 3206 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 3207 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 3208 | /* msgt_unused = */ 0 |
| 3209 | }; |
| 3210 | |
| 3211 | trivfs_protid_t file; |
| 3212 | mach_port_t reply; |
| 3213 | mach_port_t parent; |
| 3214 | mach_msg_type_name_t new_filePoly; |
| 3215 | |
| 3216 | #if TypeCheck1 |
| 3217 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 3218 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 3219 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 3220 | #endif /* TypeCheck */ |
| 3221 | |
| 3222 | #if TypeCheck1 |
| 3223 | if (BAD_TYPECHECK(&In0P->parentType, &parentCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->parentType); _c.t = *(& parentCheck);_t.w != _c.w; })), 0)) |
| 3224 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 3225 | #endif /* TypeCheck */ |
| 3226 | |
| 3227 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 3228 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 3229 | else |
| 3230 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 3231 | |
| 3232 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 3233 | |
| 3234 | parent = In0P->parent; |
| 3235 | |
| 3236 | OutP->RetCode = trivfs_S_file_reparent(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), parent, &OutP->new_file, &new_filePoly); |
| 3237 | trivfs_end_using_protid(file); |
| 3238 | if (OutP->RetCode != KERN_SUCCESS0) |
| 3239 | return; |
| 3240 | |
| 3241 | msgh_simple = TRUE((boolean_t) 1); |
| 3242 | OutP->Head.msgh_size = 40; |
| 3243 | |
| 3244 | OutP->new_fileType = new_fileType; |
| 3245 | |
| 3246 | if (MACH_MSG_TYPE_PORT_ANY(new_filePoly)(((new_filePoly) >= 16) && ((new_filePoly) <= 21 ))) |
| 3247 | msgh_simple = FALSE((boolean_t) 0); |
| 3248 | |
| 3249 | OutP->new_fileType.msgt_name = new_filePoly; |
| 3250 | |
| 3251 | if (!msgh_simple) |
| 3252 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 3253 | } |
| 3254 | |
| 3255 | /* Default implementation of trivfs_S_file_reparent */ |
| 3256 | #ifdef MIG_EOPNOTSUPP |
| 3257 | kern_return_t __attribute__ ((weak)) |
| 3258 | trivfs_S_file_reparent |
| 3259 | ( |
| 3260 | trivfs_protid_t file, |
| 3261 | mach_port_t reply, |
| 3262 | mach_msg_type_name_t replyPoly, |
| 3263 | mach_port_t parent, |
| 3264 | mach_port_t *new_file, |
| 3265 | mach_msg_type_name_t *new_filePoly |
| 3266 | ) { return MIG_EOPNOTSUPP; } |
| 3267 | #endif /* MIG_EOPNOTSUPP */ |
| 3268 | |
| 3269 | /* Routine file_get_children */ |
| 3270 | mig_internalstatic void _Xfile_get_children |
| 3271 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3272 | { |
| 3273 | typedef struct { |
| 3274 | mach_msg_header_t Head; |
| 3275 | } Request; |
| 3276 | |
| 3277 | typedef struct { |
| 3278 | mach_msg_header_t Head; |
| 3279 | mach_msg_type_t RetCodeType; |
| 3280 | kern_return_t RetCode; |
| 3281 | mach_msg_type_long_t childrenType; |
| 3282 | char children[2048]; |
| 3283 | } Reply; |
| 3284 | |
| 3285 | Request *In0P = (Request *) InHeadP; |
| 3286 | Reply *OutP = (Reply *) OutHeadP; |
| 3287 | mig_external kern_return_t trivfs_S_file_get_children |
| 3288 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t *children, mach_msg_type_number_t *childrenCnt); |
| 3289 | |
| 3290 | boolean_t msgh_simple = msgh_simple; |
| 3291 | const mach_msg_type_long_t childrenType = { |
| 3292 | { |
| 3293 | /* msgt_name = */ 0, |
| 3294 | /* msgt_size = */ 0, |
| 3295 | /* msgt_number = */ 0, |
| 3296 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 3297 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 3298 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 3299 | /* msgt_unused = */ 0 |
| 3300 | }, |
| 3301 | /* msgtl_name = */ 8, |
| 3302 | /* msgtl_size = */ 8, |
| 3303 | /* msgtl_number = */ 2048, |
| 3304 | }; |
| 3305 | |
| 3306 | trivfs_protid_t file; |
| 3307 | mach_port_t reply; |
| 3308 | mach_msg_type_number_t childrenCnt; |
| 3309 | |
| 3310 | char *childrenP; |
| 3311 | |
| 3312 | #if TypeCheck1 |
| 3313 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 3314 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 3315 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 3316 | #endif /* TypeCheck */ |
| 3317 | |
| 3318 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 3319 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 3320 | else |
| 3321 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 3322 | |
| 3323 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 3324 | |
| 3325 | childrenP = OutP->children; |
| 3326 | childrenCnt = 2048; |
| 3327 | |
| 3328 | OutP->RetCode = trivfs_S_file_get_children(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &childrenP, &childrenCnt); |
| 3329 | trivfs_end_using_protid(file); |
| 3330 | if (OutP->RetCode != KERN_SUCCESS0) |
| 3331 | return; |
| 3332 | |
| 3333 | msgh_simple = TRUE((boolean_t) 1); |
| 3334 | |
| 3335 | OutP->childrenType = childrenType; |
| 3336 | if (childrenP != OutP->children) { |
| 3337 | OutP->childrenType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 3338 | *((char **)OutP->children) = childrenP; |
| 3339 | msgh_simple = FALSE((boolean_t) 0); |
| 3340 | } |
| 3341 | |
| 3342 | OutP->childrenType.msgtl_number = childrenCnt; |
| 3343 | OutP->Head.msgh_size = 44 + ((OutP->childrenType.msgtl_header.msgt_inline) ? (childrenCnt + 3) & ~3 : sizeof(char *)); |
| 3344 | |
| 3345 | if (!msgh_simple) |
| 3346 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 3347 | } |
| 3348 | |
| 3349 | /* Default implementation of trivfs_S_file_get_children */ |
| 3350 | #ifdef MIG_EOPNOTSUPP |
| 3351 | kern_return_t __attribute__ ((weak)) |
| 3352 | trivfs_S_file_get_children |
| 3353 | ( |
| 3354 | trivfs_protid_t file, |
| 3355 | mach_port_t reply, |
| 3356 | mach_msg_type_name_t replyPoly, |
| 3357 | data_t *children, |
| 3358 | mach_msg_type_number_t *childrenCnt |
| 3359 | ) { return MIG_EOPNOTSUPP; } |
| 3360 | #endif /* MIG_EOPNOTSUPP */ |
| 3361 | |
| 3362 | /* Routine file_get_source */ |
| 3363 | mig_internalstatic void _Xfile_get_source |
| 3364 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3365 | { |
| 3366 | typedef struct { |
| 3367 | mach_msg_header_t Head; |
| 3368 | } Request; |
| 3369 | |
| 3370 | typedef struct { |
| 3371 | mach_msg_header_t Head; |
| 3372 | mach_msg_type_t RetCodeType; |
| 3373 | kern_return_t RetCode; |
| 3374 | mach_msg_type_t sourceType; |
| 3375 | string_t source; |
| 3376 | } Reply; |
| 3377 | |
| 3378 | Request *In0P = (Request *) InHeadP; |
| 3379 | Reply *OutP = (Reply *) OutHeadP; |
| 3380 | mig_external kern_return_t trivfs_S_file_get_source |
| 3381 | (trivfs_protid_t file, mach_port_t reply, mach_msg_type_name_t replyPoly, string_t source); |
| 3382 | |
| 3383 | const mach_msg_type_t sourceType = { |
| 3384 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 3385 | /* msgt_size = */ 8, |
| 3386 | /* msgt_number = */ 1024, |
| 3387 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 3388 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 3389 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 3390 | /* msgt_unused = */ 0 |
| 3391 | }; |
| 3392 | |
| 3393 | trivfs_protid_t file; |
| 3394 | mach_port_t reply; |
| 3395 | |
| 3396 | #if TypeCheck1 |
| 3397 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
| 3398 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
| 3399 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 3400 | #endif /* TypeCheck */ |
| 3401 | |
| 3402 | if (MACH_MSGH_BITS_LOCAL (In0P->Head.msgh_bits)(((In0P->Head.msgh_bits) & 0x0000ff00) >> 8) == MACH_MSG_TYPE_PROTECTED_PAYLOAD23) |
| 3403 | file = trivfs_begin_using_protid_payload(In0P->Head.msgh_protected_payload); |
| 3404 | else |
| 3405 | file = trivfs_begin_using_protid(In0P->Head.msgh_request_portmsgh_local_port); |
| 3406 | |
| 3407 | reply = In0P->Head.msgh_reply_portmsgh_remote_port; |
| 3408 | |
| 3409 | OutP->RetCode = trivfs_S_file_get_source(file, reply, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), OutP->source); |
| 3410 | trivfs_end_using_protid(file); |
| 3411 | if (OutP->RetCode != KERN_SUCCESS0) |
| 3412 | return; |
| 3413 | |
| 3414 | OutP->Head.msgh_size = 1060; |
| 3415 | |
| 3416 | OutP->sourceType = sourceType; |
| 3417 | } |
| 3418 | |
| 3419 | /* Default implementation of trivfs_S_file_get_source */ |
| 3420 | #ifdef MIG_EOPNOTSUPP |
| 3421 | kern_return_t __attribute__ ((weak)) |
| 3422 | trivfs_S_file_get_source |
| 3423 | ( |
| 3424 | trivfs_protid_t file, |
| 3425 | mach_port_t reply, |
| 3426 | mach_msg_type_name_t replyPoly, |
| 3427 | string_t source |
| 3428 | ) { return MIG_EOPNOTSUPP; } |
| 3429 | #endif /* MIG_EOPNOTSUPP */ |
| 3430 | |
| 3431 | mig_routine_t trivfs_fs_server_routines[] = { |
| 3432 | _Xfile_exec, |
| 3433 | _Xfile_chown, |
| 3434 | _Xfile_chauthor, |
| 3435 | _Xfile_chmod, |
| 3436 | _Xfile_chflags, |
| 3437 | _Xfile_utimes, |
| 3438 | _Xfile_set_size, |
| 3439 | _Xfile_lock, |
| 3440 | _Xfile_lock_stat, |
| 3441 | _Xfile_check_access, |
| 3442 | _Xfile_notice_changes, |
| 3443 | _Xfile_getcontrol, |
| 3444 | _Xfile_statfs, |
| 3445 | _Xfile_sync, |
| 3446 | _Xfile_syncfs, |
| 3447 | _Xfile_get_storage_info, |
| 3448 | _Xfile_getlinknode, |
| 3449 | _Xfile_getfh, |
| 3450 | _Xdir_lookup, |
| 3451 | _Xdir_readdir, |
| 3452 | _Xdir_mkdir, |
| 3453 | _Xdir_rmdir, |
| 3454 | _Xdir_unlink, |
| 3455 | _Xdir_link, |
| 3456 | _Xdir_rename, |
| 3457 | _Xdir_mkfile, |
| 3458 | _Xdir_notice_changes, |
| 3459 | _Xfile_set_translator, |
| 3460 | _Xfile_get_translator, |
| 3461 | _Xfile_get_translator_cntl, |
| 3462 | _Xfile_get_fs_options, |
| 3463 | _Xfile_reparent, |
| 3464 | _Xfile_get_children, |
| 3465 | _Xfile_get_source, |
| 3466 | }; |
| 3467 | |
| 3468 | mig_external boolean_t trivfs_fs_server |
| 3469 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 3470 | { |
| 3471 | mach_msg_header_t *InP = InHeadP; |
| 3472 | mig_reply_header_t *OutP = (mig_reply_header_t *) OutHeadP; |
| 3473 | |
| 3474 | const mach_msg_type_t RetCodeType = { |
| 3475 | /* msgt_name = */ MACH_MSG_TYPE_INTEGER_322, |
| 3476 | /* msgt_size = */ 32, |
| 3477 | /* msgt_number = */ 1, |
| 3478 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 3479 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 3480 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 3481 | /* msgt_unused = */ 0 |
| 3482 | }; |
| 3483 | |
| 3484 | mig_routine_t routine; |
| 3485 | |
| 3486 | OutP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InP->msgh_bits), 0)((((InP->msgh_bits) & 0x000000ff)) | ((0) << 8)); |
| 3487 | OutP->Head.msgh_size = sizeof *OutP; |
| 3488 | OutP->Head.msgh_remote_port = InP->msgh_reply_portmsgh_remote_port; |
| 3489 | OutP->Head.msgh_local_port = MACH_PORT_NULL((mach_port_t) 0); |
| 3490 | OutP->Head.msgh_seqno = 0; |
| 3491 | OutP->Head.msgh_id = InP->msgh_id + 100; |
| 3492 | |
| 3493 | OutP->RetCodeType = RetCodeType; |
| 3494 | |
| 3495 | if ((InP->msgh_id > 20033) || (InP->msgh_id < 20000) || |
| 3496 | ((routine = trivfs_fs_server_routines[InP->msgh_id - 20000]) == 0)) { |
| 3497 | OutP->RetCode = MIG_BAD_ID-303; |
| 3498 | return FALSE((boolean_t) 0); |
| 3499 | } |
| 3500 | (*routine) (InP, &OutP->Head); |
| 3501 | return TRUE((boolean_t) 1); |
| 3502 | } |
| 3503 | |
| 3504 | mig_external mig_routine_t trivfs_fs_server_routine |
| 3505 | (const mach_msg_header_t *InHeadP) |
| 3506 | { |
| 3507 | int msgh_id; |
| 3508 | |
| 3509 | msgh_id = InHeadP->msgh_id - 20000; |
| 3510 | |
| 3511 | if ((msgh_id > 33) || (msgh_id < 0)) |
| 3512 | return 0; |
| 3513 | |
| 3514 | return trivfs_fs_server_routines[msgh_id]; |
| 3515 | } |
| 3516 |