2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
31 * All Rights Reserved.
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
43 * Carnegie Mellon requests users of this software to return to
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
56 * File: mach/message.h
58 * Mach IPC message and primitive function definitions.
61 #ifndef _MACH_MESSAGE_H_
62 #define _MACH_MESSAGE_H_
65 /* Have to have MIG parameter check for kernel */
67 #define _MIG_KERNEL_SPECIFIC_CODE_ 1
68 #endif /* MACH_KERNEL */
70 /* static templates are slower and bigger */
71 /* #define UseStaticTemplates 0 */
73 #include <sys/appleapiopts.h>
76 #include <mach/port.h>
77 #include <mach/boolean.h>
78 #include <mach/kern_return.h>
79 #include <mach/machine/vm_types.h>
82 * The timeout mechanism uses mach_msg_timeout_t values,
83 * passed by value. The timeout units are milliseconds.
84 * It is controlled with the MACH_SEND_TIMEOUT
85 * and MACH_RCV_TIMEOUT options.
88 typedef natural_t mach_msg_timeout_t
;
91 * The value to be used when there is no timeout.
92 * (No MACH_SEND_TIMEOUT/MACH_RCV_TIMEOUT option.)
95 #define MACH_MSG_TIMEOUT_NONE ((mach_msg_timeout_t) 0)
98 * The kernel uses MACH_MSGH_BITS_COMPLEX as a hint. It it isn't on, it
99 * assumes the body of the message doesn't contain port rights or OOL
100 * data. The field is set in received messages. A user task must
101 * use caution in interpreting the body of a message if the bit isn't
102 * on, because the mach_msg_type's in the body might "lie" about the
103 * contents. If the bit isn't on, but the mach_msg_types
104 * in the body specify rights or OOL data, the behavior is undefined.
105 * (Ie, an error may or may not be produced.)
107 * The value of MACH_MSGH_BITS_REMOTE determines the interpretation
108 * of the msgh_remote_port field. It is handled like a msgt_name.
110 * The value of MACH_MSGH_BITS_LOCAL determines the interpretation
111 * of the msgh_local_port field. It is handled like a msgt_name.
113 * MACH_MSGH_BITS() combines two MACH_MSG_TYPE_* values, for the remote
114 * and local fields, into a single value suitable for msgh_bits.
116 * MACH_MSGH_BITS_CIRCULAR should be zero; is is used internally.
118 * The unused bits should be zero and are reserved for the kernel
119 * or for future interface expansion.
122 #define MACH_MSGH_BITS_ZERO 0x00000000
123 #define MACH_MSGH_BITS_REMOTE_MASK 0x000000ff
124 #define MACH_MSGH_BITS_LOCAL_MASK 0x0000ff00
125 #define MACH_MSGH_BITS_COMPLEX 0x80000000U
126 #define MACH_MSGH_BITS_USER 0x8000ffffU
128 #define MACH_MSGH_BITS_CIRCULAR 0x40000000 /* internal use only */
129 #define MACH_MSGH_BITS_USED 0xc000ffffU
131 #define MACH_MSGH_BITS_PORTS_MASK \
132 (MACH_MSGH_BITS_REMOTE_MASK|MACH_MSGH_BITS_LOCAL_MASK)
134 #define MACH_MSGH_BITS(remote, local) \
135 ((remote) | ((local) << 8))
136 #define MACH_MSGH_BITS_REMOTE(bits) \
137 ((bits) & MACH_MSGH_BITS_REMOTE_MASK)
138 #define MACH_MSGH_BITS_LOCAL(bits) \
139 (((bits) & MACH_MSGH_BITS_LOCAL_MASK) >> 8)
140 #define MACH_MSGH_BITS_PORTS(bits) \
141 ((bits) & MACH_MSGH_BITS_PORTS_MASK)
142 #define MACH_MSGH_BITS_OTHER(bits) \
143 ((bits) &~ MACH_MSGH_BITS_PORTS_MASK)
146 * Every message starts with a message header.
147 * Following the message header are zero or more pairs of
148 * type descriptors (mach_msg_type_t/mach_msg_type_long_t) and
149 * data values. The size of the message must be specified in bytes,
150 * and includes the message header, type descriptors, inline
151 * data, and inline pointer for out-of-line data.
153 * The msgh_remote_port field specifies the destination of the message.
154 * It must specify a valid send or send-once right for a port.
156 * The msgh_local_port field specifies a "reply port". Normally,
157 * This field carries a send-once right that the receiver will use
158 * to reply to the message. It may carry the values MACH_PORT_NULL,
159 * MACH_PORT_DEAD, a send-once right, or a send right.
161 * The msgh_seqno field carries a sequence number associated with the
162 * received-from port. A port's sequence number is incremented every
163 * time a message is received from it. In sent messages, the field's
166 * The msgh_id field is uninterpreted by the message primitives.
167 * It normally carries information specifying the format
168 * or meaning of the message.
171 typedef unsigned int mach_msg_bits_t
;
172 typedef natural_t mach_msg_size_t
;
173 typedef integer_t mach_msg_id_t
;
176 #define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0
178 typedef unsigned int mach_msg_type_name_t
;
180 #define MACH_MSG_TYPE_MOVE_RECEIVE 16 /* Must hold receive rights */
181 #define MACH_MSG_TYPE_MOVE_SEND 17 /* Must hold send rights */
182 #define MACH_MSG_TYPE_MOVE_SEND_ONCE 18 /* Must hold sendonce rights */
183 #define MACH_MSG_TYPE_COPY_SEND 19 /* Must hold send rights */
184 #define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive rights */
185 #define MACH_MSG_TYPE_MAKE_SEND_ONCE 21 /* Must hold receive rights */
186 #define MACH_MSG_TYPE_COPY_RECEIVE 22 /* Must hold receive rights */
188 typedef unsigned int mach_msg_copy_options_t
;
190 #define MACH_MSG_PHYSICAL_COPY 0
191 #define MACH_MSG_VIRTUAL_COPY 1
192 #define MACH_MSG_ALLOCATE 2
193 #define MACH_MSG_OVERWRITE 3
195 #define MACH_MSG_KALLOC_COPY_T 4
196 #endif /* MACH_KERNEL */
198 typedef unsigned int mach_msg_descriptor_type_t
;
200 #define MACH_MSG_PORT_DESCRIPTOR 0
201 #define MACH_MSG_OOL_DESCRIPTOR 1
202 #define MACH_MSG_OOL_PORTS_DESCRIPTOR 2
203 #define MACH_MSG_OOL_VOLATILE_DESCRIPTOR 3
209 mach_msg_size_t pad2
;
210 unsigned int pad3
: 24;
211 mach_msg_descriptor_type_t type
: 8;
212 } mach_msg_type_descriptor_t
;
217 mach_msg_size_t pad1
;
218 unsigned int pad2
: 16;
219 mach_msg_type_name_t disposition
: 8;
220 mach_msg_descriptor_type_t type
: 8;
221 } mach_msg_port_descriptor_t
;
226 mach_msg_size_t size
;
227 boolean_t deallocate
: 8;
228 mach_msg_copy_options_t copy
: 8;
229 unsigned int pad1
: 8;
230 mach_msg_descriptor_type_t type
: 8;
231 } mach_msg_ool_descriptor_t
;
236 mach_msg_size_t count
;
237 boolean_t deallocate
: 8;
238 mach_msg_copy_options_t copy
: 8;
239 mach_msg_type_name_t disposition
: 8;
240 mach_msg_descriptor_type_t type
: 8;
241 } mach_msg_ool_ports_descriptor_t
;
245 mach_msg_port_descriptor_t port
;
246 mach_msg_ool_descriptor_t out_of_line
;
247 mach_msg_ool_ports_descriptor_t ool_ports
;
248 mach_msg_type_descriptor_t type
;
249 } mach_msg_descriptor_t
;
253 mach_msg_size_t msgh_descriptor_count
;
256 #define MACH_MSG_BODY_NULL (mach_msg_body_t *) 0
257 #define MACH_MSG_DESCRIPTOR_NULL (mach_msg_descriptor_t *) 0
261 mach_msg_bits_t msgh_bits
;
262 mach_msg_size_t msgh_size
;
263 mach_port_t msgh_remote_port
;
264 mach_port_t msgh_local_port
;
265 mach_msg_size_t msgh_reserved
;
266 mach_msg_id_t msgh_id
;
269 #define MACH_MSG_NULL (mach_msg_header_t *) 0
273 mach_msg_header_t header
;
274 mach_msg_body_t body
;
277 typedef unsigned int mach_msg_trailer_type_t
;
279 #define MACH_MSG_TRAILER_FORMAT_0 0
281 typedef unsigned int mach_msg_trailer_size_t
;
285 mach_msg_trailer_type_t msgh_trailer_type
;
286 mach_msg_trailer_size_t msgh_trailer_size
;
287 } mach_msg_trailer_t
;
291 mach_msg_trailer_type_t msgh_trailer_type
;
292 mach_msg_trailer_size_t msgh_trailer_size
;
293 mach_port_seqno_t msgh_seqno
;
294 } mach_msg_seqno_trailer_t
;
303 mach_msg_trailer_type_t msgh_trailer_type
;
304 mach_msg_trailer_size_t msgh_trailer_size
;
305 mach_port_seqno_t msgh_seqno
;
306 security_token_t msgh_sender
;
307 } mach_msg_security_trailer_t
;
309 typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t
;
311 #define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t)
312 #define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t)
313 #define MAX_TRAILER_SIZE MACH_MSG_TRAILER_FORMAT_0_SIZE
315 #define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} }
316 extern security_token_t KERNEL_SECURITY_TOKEN
;
318 typedef integer_t mach_msg_options_t
;
322 mach_msg_header_t header
;
323 } mach_msg_empty_send_t
;
327 mach_msg_header_t header
;
328 mach_msg_trailer_t trailer
;
329 } mach_msg_empty_rcv_t
;
333 mach_msg_empty_send_t send
;
334 mach_msg_empty_rcv_t rcv
;
337 /* utility to round the message size - will become machine dependent */
338 #define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \
339 ~(sizeof (natural_t) - 1))
342 * There is no fixed upper bound to the size of Mach messages.
345 #define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0)
347 #ifdef __APPLE_API_OBSOLETE
349 * Compatibility definitions, for code written
350 * when there was a msgh_kind instead of msgh_seqno.
352 #define MACH_MSGH_KIND_NORMAL 0x00000000
353 #define MACH_MSGH_KIND_NOTIFICATION 0x00000001
354 #define msgh_kind msgh_seqno
355 #define mach_msg_kind_t mach_port_seqno_t
356 #endif /* __APPLE_API_OBSOLETE */
359 * The msgt_number field specifies the number of data elements.
360 * The msgt_size field specifies the size of each data element, in bits.
361 * The msgt_name field specifies the type of each data element.
362 * If msgt_inline is TRUE, the data follows the type descriptor
363 * in the body of the message. If msgt_inline is FALSE, then a pointer
364 * to the data should follow the type descriptor, and the data is
365 * sent out-of-line. In this case, if msgt_deallocate is TRUE,
366 * then the out-of-line data is moved (instead of copied) into the message.
367 * If msgt_longform is TRUE, then the type descriptor is actually
368 * a mach_msg_type_long_t.
370 * The actual amount of inline data following the descriptor must
371 * a multiple of the word size. For out-of-line data, this is a
372 * pointer. For inline data, the supplied data size (calculated
373 * from msgt_number/msgt_size) is rounded up. This guarantees
374 * that type descriptors always fall on word boundaries.
376 * For port rights, msgt_size must be 8*sizeof(mach_port_t).
377 * If the data is inline, msgt_deallocate should be FALSE.
378 * The msgt_unused bit should be zero.
379 * The msgt_name, msgt_size, msgt_number fields in
380 * a mach_msg_type_long_t should be zero.
383 typedef natural_t mach_msg_type_size_t
;
384 typedef natural_t mach_msg_type_number_t
;
387 * Values received/carried in messages. Tells the receiver what
388 * sort of port right he now has.
390 * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name
391 * which should remain uninterpreted by the kernel. (Port rights
392 * are not transferred, just the port name.)
395 #define MACH_MSG_TYPE_PORT_NONE 0
397 #define MACH_MSG_TYPE_PORT_NAME 15
398 #define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE
399 #define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND
400 #define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE
402 #define MACH_MSG_TYPE_LAST 22 /* Last assigned */
405 * A dummy value. Mostly used to indicate that the actual value
406 * will be filled in later, dynamically.
409 #define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1)
412 * Is a given item a port type?
415 #define MACH_MSG_TYPE_PORT_ANY(x) \
416 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
417 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
419 #define MACH_MSG_TYPE_PORT_ANY_SEND(x) \
420 (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \
421 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
423 #define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \
424 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
425 ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))
427 typedef integer_t mach_msg_option_t
;
429 #define MACH_MSG_OPTION_NONE 0x00000000
431 #define MACH_SEND_MSG 0x00000001
432 #define MACH_RCV_MSG 0x00000002
433 #define MACH_RCV_LARGE 0x00000004
435 #define MACH_SEND_TIMEOUT 0x00000010
436 #define MACH_SEND_INTERRUPT 0x00000040 /* libmach implements */
437 #define MACH_SEND_CANCEL 0x00000080
438 #define MACH_SEND_ALWAYS 0x00010000 /* internal use only */
439 #define MACH_SEND_TRAILER 0x00020000
441 #define MACH_RCV_TIMEOUT 0x00000100
442 #define MACH_RCV_NOTIFY 0x00000200
443 #define MACH_RCV_INTERRUPT 0x00000400 /* libmach implements */
444 #define MACH_RCV_OVERWRITE 0x00001000
447 * NOTE: a 0x00------ RCV mask implies to ask for
448 * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements,
449 * which is equivalent to a mach_msg_trailer_t.
451 #define MACH_RCV_TRAILER_NULL 0
452 #define MACH_RCV_TRAILER_SEQNO 1
453 #define MACH_RCV_TRAILER_SENDER 2
455 #define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28)
456 #define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24)
457 #define MACH_RCV_TRAILER_MASK ((0xff << 24))
459 #define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf)
460 #define REQUESTED_TRAILER_SIZE(y) \
461 ((mach_msg_trailer_size_t) \
462 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? \
463 sizeof(mach_msg_trailer_t) : \
464 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? \
465 sizeof(mach_msg_seqno_trailer_t) : \
466 sizeof(mach_msg_security_trailer_t))))
468 * Much code assumes that mach_msg_return_t == kern_return_t.
469 * This definition is useful for descriptive purposes.
471 * See <mach/error.h> for the format of error codes.
472 * IPC errors are system 4. Send errors are subsystem 0;
473 * receive errors are subsystem 1. The code field is always non-zero.
474 * The high bits of the code field communicate extra information
475 * for some error codes. MACH_MSG_MASK masks off these special bits.
478 typedef kern_return_t mach_msg_return_t
;
480 #define MACH_MSG_SUCCESS 0x00000000
483 #define MACH_MSG_MASK 0x00003e00
484 /* All special error code bits defined below. */
485 #define MACH_MSG_IPC_SPACE 0x00002000
486 /* No room in IPC name space for another capability name. */
487 #define MACH_MSG_VM_SPACE 0x00001000
488 /* No room in VM address space for out-of-line memory. */
489 #define MACH_MSG_IPC_KERNEL 0x00000800
490 /* Kernel resource shortage handling an IPC capability. */
491 #define MACH_MSG_VM_KERNEL 0x00000400
492 /* Kernel resource shortage handling out-of-line memory. */
494 #define MACH_SEND_IN_PROGRESS 0x10000001
495 /* Thread is waiting to send. (Internal use only.) */
496 #define MACH_SEND_INVALID_DATA 0x10000002
497 /* Bogus in-line data. */
498 #define MACH_SEND_INVALID_DEST 0x10000003
499 /* Bogus destination port. */
500 #define MACH_SEND_TIMED_OUT 0x10000004
501 /* Message not sent before timeout expired. */
502 #define MACH_SEND_INTERRUPTED 0x10000007
503 /* Software interrupt. */
504 #define MACH_SEND_MSG_TOO_SMALL 0x10000008
505 /* Data doesn't contain a complete message. */
506 #define MACH_SEND_INVALID_REPLY 0x10000009
507 /* Bogus reply port. */
508 #define MACH_SEND_INVALID_RIGHT 0x1000000a
509 /* Bogus port rights in the message body. */
510 #define MACH_SEND_INVALID_NOTIFY 0x1000000b
511 /* Bogus notify port argument. */
512 #define MACH_SEND_INVALID_MEMORY 0x1000000c
513 /* Invalid out-of-line memory pointer. */
514 #define MACH_SEND_NO_BUFFER 0x1000000d
515 /* No message buffer is available. */
516 #define MACH_SEND_TOO_LARGE 0x1000000e
517 /* Send is too large for port */
518 #define MACH_SEND_INVALID_TYPE 0x1000000f
519 /* Invalid msg-type specification. */
520 #define MACH_SEND_INVALID_HEADER 0x10000010
521 /* A field in the header had a bad value. */
522 #define MACH_SEND_INVALID_TRAILER 0x10000011
523 /* The trailer to be sent does not match kernel format. */
524 #define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015
525 /* compatibility: no longer a returned error */
527 #define MACH_RCV_IN_PROGRESS 0x10004001
528 /* Thread is waiting for receive. (Internal use only.) */
529 #define MACH_RCV_INVALID_NAME 0x10004002
530 /* Bogus name for receive port/port-set. */
531 #define MACH_RCV_TIMED_OUT 0x10004003
532 /* Didn't get a message within the timeout value. */
533 #define MACH_RCV_TOO_LARGE 0x10004004
534 /* Message buffer is not large enough for inline data. */
535 #define MACH_RCV_INTERRUPTED 0x10004005
536 /* Software interrupt. */
537 #define MACH_RCV_PORT_CHANGED 0x10004006
538 /* compatibility: no longer a returned error */
539 #define MACH_RCV_INVALID_NOTIFY 0x10004007
540 /* Bogus notify port argument. */
541 #define MACH_RCV_INVALID_DATA 0x10004008
542 /* Bogus message buffer for inline data. */
543 #define MACH_RCV_PORT_DIED 0x10004009
544 /* Port/set was sent away/died during receive. */
545 #define MACH_RCV_IN_SET 0x1000400a
546 /* compatibility: no longer a returned error */
547 #define MACH_RCV_HEADER_ERROR 0x1000400b
548 /* Error receiving message header. See special bits. */
549 #define MACH_RCV_BODY_ERROR 0x1000400c
550 /* Error receiving message body. See special bits. */
551 #define MACH_RCV_INVALID_TYPE 0x1000400d
552 /* Invalid msg-type specification in scatter list. */
553 #define MACH_RCV_SCATTER_SMALL 0x1000400e
554 /* Out-of-line overwrite region is not large enough */
555 #define MACH_RCV_INVALID_TRAILER 0x1000400f
556 /* trailer type or number of trailer elements not supported */
557 #define MACH_RCV_IN_PROGRESS_TIMED 0x10004011
558 /* Waiting for receive with timeout. (Internal use only.) */
561 * Routine: mach_msg_overwrite
563 * Send and/or receive a message. If the message operation
564 * is interrupted, and the user did not request an indication
565 * of that fact, then restart the appropriate parts of the
566 * operation silently (trap version does not restart).
568 * Distinct send and receive buffers may be specified. If
569 * no separate receive buffer is specified, the msg parameter
570 * will be used for both send and receive operations.
572 * In addition to a distinct receive buffer, that buffer may
573 * already contain scatter control information to direct the
574 * receiving of the message.
576 #ifdef __APPLE_API_PRIVATE
577 extern mach_msg_return_t
mach_msg_overwrite_trap(
578 mach_msg_header_t
*msg
,
579 mach_msg_option_t option
,
580 mach_msg_size_t send_size
,
581 mach_msg_size_t rcv_size
,
582 mach_port_name_t rcv_name
,
583 mach_msg_timeout_t timeout
,
584 mach_port_name_t notify
,
585 mach_msg_header_t
*rcv_msg
,
586 mach_msg_size_t rcv_limit
);
587 #endif /* __APPLE_API_PRIVATE */
589 extern mach_msg_return_t
mach_msg_overwrite(
590 mach_msg_header_t
*msg
,
591 mach_msg_option_t option
,
592 mach_msg_size_t send_size
,
593 mach_msg_size_t rcv_size
,
594 mach_port_name_t rcv_name
,
595 mach_msg_timeout_t timeout
,
596 mach_port_name_t notify
,
597 mach_msg_header_t
*rcv_msg
,
598 mach_msg_size_t rcv_limit
);
603 * Send and/or receive a message. If the message operation
604 * is interrupted, and the user did not request an indication
605 * of that fact, then restart the appropriate parts of the
606 * operation silently (trap version does not restart).
608 #ifdef __APPLE_API_PRIVATE
609 extern mach_msg_return_t
mach_msg_trap(
610 mach_msg_header_t
*msg
,
611 mach_msg_option_t option
,
612 mach_msg_size_t send_size
,
613 mach_msg_size_t rcv_size
,
614 mach_port_name_t rcv_name
,
615 mach_msg_timeout_t timeout
,
616 mach_port_name_t notify
);
617 #endif /* __APPLE_API_PRIVATE */
619 extern mach_msg_return_t
mach_msg(
620 mach_msg_header_t
*msg
,
621 mach_msg_option_t option
,
622 mach_msg_size_t send_size
,
623 mach_msg_size_t rcv_size
,
624 mach_port_name_t rcv_name
,
625 mach_msg_timeout_t timeout
,
626 mach_port_name_t notify
);
628 #endif /* _MACH_MESSAGE_H_ */