Index: libports/import-port.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/import-port.c,v
retrieving revision 1.1
diff -u -r1.1 import-port.c
--- libports/import-port.c	18 Jul 1996 04:31:47 -0000	1.1
+++ libports/import-port.c	8 Aug 2003 18:02:59 -0000
@@ -1,6 +1,6 @@
 /* Create a new port structure using an externally supplied receive right
 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
 
    Written by Michael I. Bushnell.
 
@@ -36,8 +36,16 @@
   mach_port_status_t stat;
   struct port_info *pi;
   mach_port_t foo;
-  
+
+#ifdef MACH_PORT_RECEIVE_STATUS
+  mach_msg_type_number_t cnt = MACH_PORT_RECEIVE_STATUS_COUNT;
+
+  err = mach_port_get_attributes (mach_task_self (), port,
+				  MACH_PORT_RECEIVE_STATUS,
+				  (mach_port_info_t) &stat, &cnt);
+#else
   err = mach_port_get_receive_status (mach_task_self (), port, &stat);
+#endif
   if (err)
     return err;
 
Index: libports/manage-multithread.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/manage-multithread.c,v
retrieving revision 1.19
diff -u -r1.19 manage-multithread.c
--- libports/manage-multithread.c	20 Aug 1997 20:41:57 -0000	1.19
+++ libports/manage-multithread.c	8 Aug 2003 18:03:00 -0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -45,6 +45,7 @@
       int status;
       struct port_info *pi;
       struct rpc_info link;
+#ifdef MACH_MSG_TYPE_BIT
       register mig_reply_header_t *outp = (mig_reply_header_t *) outheadp;
       static const mach_msg_type_t RetCodeType = {
 		/* msgt_name = */		MACH_MSG_TYPE_INTEGER_32,
@@ -55,6 +56,9 @@
 		/* msgt_deallocate = */		FALSE,
 		/* msgt_unused = */		0
 	};
+#else  /* Untyped Mach IPC format.  */
+      register mig_reply_error_t *outp = (mig_reply_error_t *) outheadp;
+#endif
 
       spin_lock (&lock);
       assert (nreqthreads);
@@ -78,9 +82,13 @@
       outp->Head.msgh_size = sizeof *outp;
       outp->Head.msgh_remote_port = inp->msgh_remote_port;
       outp->Head.msgh_local_port = MACH_PORT_NULL;
-      outp->Head.msgh_seqno = 0;
       outp->Head.msgh_id = inp->msgh_id + 100;
+#ifdef MACH_MSG_TYPE_BIT
+      outp->Head.msgh_seqno = 0;
       outp->RetCodeType = RetCodeType;
+#else
+      outp->Head.msgh_reserved = 0;
+#endif
       outp->RetCode = MIG_BAD_ID;
 
       pi = ports_lookup_port (bucket, inp->msgh_local_port, 0);
@@ -94,9 +102,19 @@
 	    }
 	  else
 	    {
+#ifdef MACH_MSG_TRAILER_FORMAT_0
+	      /* The seqno is carried in the trailer of the message.  */
+	      mach_msg_format_0_trailer_t *trailer = (mach_msg_format_0_trailer_t *)
+		((vm_offset_t) inp + round_msg (inp->msgh_size));
+#endif
 	      mutex_lock (&_ports_lock);
+#ifdef MACH_MSG_TRAILER_FORMAT_0
+	      if (trailer->msgh_seqno < pi->cancel_threshold)
+		hurd_thread_cancel (link.thread);
+#else
 	      if (inp->msgh_seqno < pi->cancel_threshold)
 		hurd_thread_cancel (link.thread);
+#endif
 	      mutex_unlock (&_ports_lock);
 	      status = demuxer (inp, outheadp);
 	      ports_end_rpc (pi, &link);
@@ -134,7 +152,11 @@
 
       do
 	err = mach_msg_server_timeout (internal_demuxer, 0, bucket->portset,
-				       timeout ? MACH_RCV_TIMEOUT : 0,
+#ifdef MACH_RCV_TRAILER_SEQNO
+				       /* This is needed to get the seqnos.  */
+				       MACH_RCV_TRAILER_ELEMENTS (MACH_RCV_TRAILER_SEQNO) |
+#endif
+				       (timeout ? MACH_RCV_TIMEOUT : 0),
 				       timeout);
       while (err != MACH_RCV_TIMED_OUT);
 
@@ -163,8 +185,3 @@
   totalthreads = 1;
   thread_function (1);
 }
-
-
-
-
-
Index: libports/manage-one-thread.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/manage-one-thread.c,v
retrieving revision 1.6
diff -u -r1.6 manage-one-thread.c
--- libports/manage-one-thread.c	28 Mar 1996 20:21:36 -0000	1.6
+++ libports/manage-one-thread.c	8 Aug 2003 18:03:00 -0000
@@ -1,6 +1,6 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-   Writtenb by Michael I. Bushnell.
+   Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
+   Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
 
@@ -35,6 +35,7 @@
       struct rpc_info link;
       int status;
       error_t err;
+#ifdef MACH_MSG_TYPE_BIT
       register mig_reply_header_t *outp = (mig_reply_header_t *) outheadp;
       static const mach_msg_type_t RetCodeType = {
 		/* msgt_name = */		MACH_MSG_TYPE_INTEGER_32,
@@ -45,6 +46,9 @@
 		/* msgt_deallocate = */		FALSE,
 		/* msgt_unused = */		0
 	};
+#else  /* Untyped Mach IPC format.  */
+      register mig_reply_error_t *outp = (mig_reply_error_t *) outheadp;
+#endif
 
       /* Fill in default response. */
       outp->Head.msgh_bits 
@@ -52,9 +56,13 @@
       outp->Head.msgh_size = sizeof *outp;
       outp->Head.msgh_remote_port = inp->msgh_remote_port;
       outp->Head.msgh_local_port = MACH_PORT_NULL;
-      outp->Head.msgh_seqno = 0;
       outp->Head.msgh_id = inp->msgh_id + 100;
+#ifdef MACH_MSG_TYPE_BIT
+      outp->Head.msgh_seqno = 0;
       outp->RetCodeType = RetCodeType;
+#else
+      outp->Head.msgh_reserved = 0;
+#endif
       outp->RetCode = MIG_BAD_ID;
 
       pi = ports_lookup_port (bucket, inp->msgh_local_port, 0);
Index: libports/ports.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/ports.h,v
retrieving revision 1.27
diff -u -r1.27 ports.h
--- libports/ports.h	17 Mar 2000 10:24:30 -0000	1.27
+++ libports/ports.h	8 Aug 2003 18:03:01 -0000
@@ -1,5 +1,5 @@
 /* Ports library for server construction
-   Copyright (C) 1993,94,95,96,97,99,2000 Free Software Foundation, Inc.
+   Copyright (C) 1993,94,95,96,97,99,2000,03 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -40,7 +40,11 @@
   int refcnt;
   int weakrefcnt;
   mach_port_mscount_t mscount;
+#ifdef MACH_RCV_TRAILER_SEQNO
+  mach_port_seqno_t cancel_threshold;
+#else
   mach_msg_seqno_t cancel_threshold;
+#endif
   int flags;
   mach_port_t port_right;
   struct rpc_info *current_rpcs;
Index: libports/reallocate-from-external.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/reallocate-from-external.c,v
retrieving revision 1.5
diff -u -r1.5 reallocate-from-external.c
--- libports/reallocate-from-external.c	29 Mar 1996 15:23:38 -0000	1.5
+++ libports/reallocate-from-external.c	8 Aug 2003 18:03:01 -0000
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2003 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -33,7 +33,15 @@
   mach_port_t foo;
   error_t err;
 
+#ifdef MACH_PORT_RECEIVE_STATUS
+  mach_msg_type_number_t cnt = MACH_PORT_RECEIVE_STATUS_COUNT;
+  
+  err = mach_port_get_attributes (mach_task_self (), receive,
+				  MACH_PORT_RECEIVE_STATUS,
+				  (mach_port_info_t) &stat, &cnt);
+#else
   err = mach_port_get_receive_status (mach_task_self (), receive, &stat);
+#endif
   assert_perror (err);
   
   mutex_lock (&_ports_lock);

