+
+ /* Determine what trailer bits we can receive (as no option specified) */
+ if (rcv_size < kmsg->ikm_header->msgh_size + MACH_MSG_TRAILER_MINIMUM_SIZE) {
+ rcv_size = kmsg->ikm_header->msgh_size;
+ } else {
+ if (rcv_size >= kmsg->ikm_header->msgh_size + MAX_TRAILER_SIZE) {
+ /*
+ * Enough room for a maximum trailer.
+ * JMM - we really should set the expected receiver-set fields:
+ * (seqno, context, filterid, etc...) but nothing currently
+ * expects them anyway.
+ */
+ trailer->msgh_trailer_size = MAX_TRAILER_SIZE;
+ } else {
+ assert(trailer->msgh_trailer_size == MACH_MSG_TRAILER_MINIMUM_SIZE);
+ }
+ rcv_size = kmsg->ikm_header->msgh_size + trailer->msgh_trailer_size;
+ }
+ assert(trailer->msgh_trailer_type == MACH_MSG_TRAILER_FORMAT_0);
+ mr = MACH_MSG_SUCCESS;
+