summaryrefslogtreecommitdiff
path: root/hurd/hurdselect.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-02-17 22:54:39 +0000
committerRoland McGrath <roland@gnu.org>2002-02-17 22:54:39 +0000
commitf22a77e1db3c93123691164c5c36f5d25d0bc4ed (patch)
tree4ecba81f45fcb6aa449f6ed202a26c90efb6f6c9 /hurd/hurdselect.c
parent9b09446441f1b3a888ca4a83247496e2e7900d3c (diff)
downloadglibc-f22a77e1db3c93123691164c5c36f5d25d0bc4ed.tar.gz
* hurd/hurdselect.c (_hurd_select) [MACH_MSG_TRAILER_MINIMUM_SIZE]:
Use untyped Mach IPC message format. * sysdeps/mach/hurd/ioctl.c (__ioctl) [! MACH_MSG_TYPE_BIT]: Handle Handle untyped Mach IPC message formats. * hurd/catch-exc.c (_S_catch_exception_raise) [EXC_MASK_ALL]: Expect different argument conventions when this is defined. [EXC_MASK_ALL] (_S_catch_exception_raise_state): New stub function. [EXC_MASK_ALL] (_S_catch_exception_raise_state_identity): Likewise. * hurd/hurdfault.c: Likewise for _hurdsig_fault_catch_exception_*. [NDR_CHAR_ASCII] (mig_reply_header_t): #define as mig_reply_error_t for OSF Mach variant. (faulted): Use mig_reply_error_t for REPLY. (_hurdsig_fault_init) [EXC_MASK_ALL]: Use EXCEPTION_STATE_IDENTITY in __thread_set_exception_ports call. (_hurdsig_fault_init) [MACH_PORT_RECEIVE_STATUS]: Use __mach_port_set_attributes in place of __mach_port_set_qlimit. * sysdeps/mach/powerpc/sysdep.h (_MACH_MACHINE_ASM_H): Define this before include <sysdeps/mach/sysdep.h>, to inhibit <mach/machine/asm.h> on Darwin, which includes bogons.
Diffstat (limited to 'hurd/hurdselect.c')
-rw-r--r--hurd/hurdselect.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
index c3dfb52119..68dc746925 100644
--- a/hurd/hurdselect.c
+++ b/hurd/hurdselect.c
@@ -279,6 +279,22 @@ _hurd_select (int nfds,
union
{
mach_msg_header_t head;
+#ifdef MACH_MSG_TRAILER_MINIMUM_SIZE
+ struct
+ {
+ mach_msg_header_t head;
+ NDR_record_t ndr;
+ error_t err;
+ } error;
+ struct
+ {
+ mach_msg_header_t head;
+ NDR_record_t ndr;
+ error_t err;
+ int result;
+ mach_msg_trailer_t trailer;
+ } success;
+#else
struct
{
mach_msg_header_t head;
@@ -293,6 +309,7 @@ _hurd_select (int nfds,
mach_msg_type_t result_type;
int result;
} success;
+#endif
} msg;
mach_msg_option_t options = (timeout == NULL ? 0 : MACH_RCV_TIMEOUT);
error_t msgerr;
@@ -303,13 +320,18 @@ _hurd_select (int nfds,
{
/* We got a message. Decode it. */
#define IO_SELECT_REPLY_MSGID (21012 + 100) /* XXX */
+#ifdef MACH_MSG_TYPE_BIT
const mach_msg_type_t inttype =
{ MACH_MSG_TYPE_INTEGER_T, sizeof (MACH_MSG_TYPE_INTEGER_T) * 8,
1, 1, 0, 0 };
- if (msg.head.msgh_id == IO_SELECT_REPLY_MSGID &&
- msg.head.msgh_size >= sizeof msg.error &&
- !(msg.head.msgh_bits & MACH_MSGH_BITS_COMPLEX) &&
- *(int *) &msg.error.err_type == *(int *) &inttype)
+#endif
+ if (msg.head.msgh_id == IO_SELECT_REPLY_MSGID
+ && msg.head.msgh_size >= sizeof msg.error
+ && !(msg.head.msgh_bits & MACH_MSGH_BITS_COMPLEX)
+#ifdef MACH_MSG_TYPE_BIT
+ && *(int *) &msg.error.err_type == *(int *) &inttype
+#endif
+ )
{
/* This is a properly formatted message so far.
See if it is a success or a failure. */
@@ -323,7 +345,9 @@ _hurd_select (int nfds,
}
if (msg.error.err ||
msg.head.msgh_size != sizeof msg.success ||
+#ifdef MACH_MSG_TYPE_BIT
*(int *) &msg.success.result_type != *(int *) &inttype ||
+#endif
(msg.success.result & SELECT_ALL) == 0)
{
/* Error or bogus reply. Simulate readiness. */