bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] libports / libdiskfs -- weak aliases


From: Neal H Walfield
Subject: [PATCH] libports / libdiskfs -- weak aliases
Date: Mon, 26 Mar 2001 22:57:15 +0200
User-agent: Mutt/1.3.15i

I have cleaned up the code in libports a bit and, most significantly, I
have renamed all the public functions from x to _x and created weak
aliases from _x to x.  This allows other libraries to wrap or override
functions in libports as is currently attempted by libdiskfs in dead-name.c
(ports_dead_name).  However, the current meathod poses two problems:

        * libdiskfs has intimate knowledge of libports (i.e. it does
        not cleanly wrap the function, but rather, copies the code).

        * Link order matters.  If libports is linked before libdiskfs,
        the ports_dead_name from libports will be used and not the one
        from libdiskfs.

I feel that the other utility libraries should also be converted to
use weak aliases.


--- hurd-20010307-snapshot/libdiskfs/ChangeLog  Mon Feb 26 05:18:19 2001
+++ hurd-20010313/libdiskfs/ChangeLog   Sun Mar 25 17:00:57 2001
@@ -1,3 +1,9 @@
+2001-03-25  Neal H Walfield  <neal@cs.uml.edu>
+
+       * dead-name.c (ports_dead_name): Call the wrapper function
+       _ports_dead_name and not include the code when wrapping
+       functions.
+
 2001-02-25  Roland McGrath  <roland@frob.com>
 
        * readonly-changed.c: New file.
--- hurd-20010307-snapshot/libdiskfs/dead-name.c        Tue Apr 23 21:09:37 1996
+++ hurd-20010313/libdiskfs/dead-name.c Sun Mar 25 16:58:57 2001
@@ -1,5 +1,5 @@
 /* Handle dead name notifications on ports
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -40,6 +40,6 @@
       else
        mutex_unlock (&np->lock);
     }
-  
-  ports_interrupt_notified_rpcs (notify, dead_name, MACH_NOTIFY_DEAD_NAME);
+
+  _ports_dead_name (notify, dead_name);
 }
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/ChangeLog 
hurd-20010313/libports/ChangeLog
--- hurd-20010307-snapshot/libports/ChangeLog   Wed Jul 26 00:34:00 2000
+++ hurd-20010313/libports/ChangeLog    Sun Mar 25 16:49:56 2001
@@ -1,3 +1,83 @@
+2001-03-25  Neal H Walfield  <neal@cs.uml.edu>
+       
+       * priv.h: New file.  Define new macro weak_alias.
+
+       * begin-rpc.c (ports_begin_rpc): Prepend an underscore to the
+       function name.  Make the original name a weak alias to the new
+       name.
+       * claim-right.c (ports_claim_right): Likewise.
+       * class-iterate.c (ports_class_iterate): Likewise.
+       * count-bucket.c (ports_count_bucket): Likewise.
+       * count-class.c (ports_count_class): Likewise.
+       * create-bucket.c (ports_create_bucket): Likewise.
+       * create-class.c (ports_create_class): Likewise.
+       * create-port-noinstall.c (ports_create_port_noinstall): Likewise.
+       * create-port.c (ports_create_port): Likewise.
+       * dead-name.c (ports_dead_name): Likewise.
+       * destroy-right.c (ports_destroy_right): Likewise.
+       * enable-bucket.c (ports_enable_bucket): Likewise.
+       * enable-class.c (ports_enable_class): Likewise.
+       * end-rpc.c (ports_end_rpc): Likewise.
+       * get-right.c (ports_get_right): Likewise.
+       * get-send-right.c (ports_get_send_right): Likewise.
+       * import-port.c (ports_import_port): Likewise.
+       * inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Likewise.
+       * inhibit-bucket-rpcs.c (ports_inhibit_bucket_rpcs): Likewise.
+       * inhibit-class-rpcs.c (ports_inhibit_class_rpcs): Likewise.
+       * inhibit-port-rpcs.c (ports_inhibit_port_rpcs): Likewise.
+       * interrupt-notified-rpcs.c (ports_interrupt_notified_rpcs): Likewise.
+       (ports_remove_notified_rpc): Likewise.
+       * interrupt-on-notify.c (ports_interrupt_rpc_on_notification):
+       Likewise.
+       (ports_interrupt_self_on_notification): Likewise.
+       * interrupt-rpcs.c (ports_interrupt_rpcs): Likewise.
+       * interrupted.c (ports_self_interrupted): Likewise.
+       * lookup-port.c (ports_lookup_port): Likewise.
+       * manage-multithread.c (ports_manage_port_operations_multithread):
+       Likewise.
+       * manage-one-thread.c (ports_manage_port_operations_one_thread):
+       Likewise.
+       * no-senders.c (ports_no_senders): Likewise.
+       * notify-dead-name.c (ports_do_mach_notify_dead_name): Likewise.
+       * notify-msg-accepted.c (ports_do_mach_notify_msg_accepted): Likewise.
+       * notify-no-senders.c (ports_do_mach_notify_no_senders): Likewise.
+       * notify-port-deleted.c (ports_do_mach_notify_port_deleted): Likewise.
+       * notify-port-destroyed.c (ports_do_mach_notify_port_destroyed):
+       Likewise.
+       * notify-send-once.c (ports_do_mach_notify_send_once): Likewise.
+       * port-deref-weak.c (ports_port_deref_weak): Likewise.
+       * port-deref.c (ports_port_deref): Likewise.
+       * port-ref-weak.c (ports_port_ref_weak): Likewise.
+       * port-ref.c (ports_port_ref): Likewise.
+       * reallocate-from-external.c (ports_reallocate_from_external):
+       Likewise.
+       * reallocate-port.c (ports_reallocate_port): Likewise.
+       * resume-all-rpcs.c (ports_resume_all_rpcs): Likewise.
+       * resume-bucket-rpcs.c (ports_resume_bucket_rpcs): Likewise.
+       * resume-class-rpcs.c (ports_resume_class_rpcs): Likewise.
+       * resume-port-rpcs.c (ports_resume_port_rpcs): Likewise.
+       * transfer-right.c (ports_transfer_right): Likewise.
+
+       * claim-right.c (ports_claim_right):  Include errno.h and
+       assert.h.  Add assertions.  Clean up the logic.
+
+       * create-bucket.c (ports_create_bucket): Include errno.h
+       and stdlib.h.  Do not include assert.h.  Turn assertions
+       into errors that set errno and return NULL.
+       * create-class.c (ports_create_class): Likewise.
+
+       * create-internal.c (_ports_create_internal): On error, do
+       no deallocate a send right but a receive right.
+
+       * init.c: Do not initialize global variables to 0.
+       * interrupt-notified-rpcs.c: Likewise.
+
+       * port-deref.c (ports_port_deref):  Simplify logic.
+
+       * reallocate-port.c (ports_reallocate_port): Assert return from
+       mach_port_move_member.
+       * transfer-right.c (ports_transfer_right): Likewise.
+
 2000-07-25  Mark Kettenis  <kettenis@gnu.org>
 
        * inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Avoid calling
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/Makefile 
hurd-20010313/libports/Makefile
--- hurd-20010307-snapshot/libports/Makefile    Fri Mar 17 11:24:30 2000
+++ hurd-20010313/libports/Makefile     Sun Mar 25 16:28:30 2001
@@ -39,7 +39,7 @@
  claim-right.c transfer-right.c create-port-noinstall.c create-internal.c \
  interrupted.c
 
-LCLHDRS = ports.h
+LCLHDRS = ports.h priv.h
 installhdrs = ports.h
 
 HURDLIBS= ihash
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/allocate-port.c 
hurd-20010313/libports/allocate-port.c
--- hurd-20010307-snapshot/libports/allocate-port.c     Sun Apr 28 21:23:12 1996
+++ hurd-20010313/libports/allocate-port.c      Thu Jan  1 01:00:00 1970
@@ -1,38 +0,0 @@
-/*
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-   Written by Michael I. Bushnell.
-
-   This file is part of the GNU Hurd.
-
-   The GNU Hurd is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   The GNU Hurd is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "ports.h"
-
-/* Backward compatibility.  */
-void *ports_allocate_port (struct port_bucket *bucket,
-                          size_t size,
-                          struct port_class *class)
-{
-  void *result;
-  if (ports_create_port (class, bucket, size, &result))
-    result = 0;
-  return result;
-}
-
-
-#include "linkwarn.h"
-
-link_warning (ports_allocate_port,
-             "ports_allocate_port is obsolete; use ports_create_port instead")
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/begin-rpc.c 
hurd-20010313/libports/begin-rpc.c
--- hurd-20010307-snapshot/libports/begin-rpc.c Thu Mar 28 21:19:39 1996
+++ hurd-20010313/libports/begin-rpc.c  Sun Mar 25 16:24:44 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,13 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 
 #define INHIBITED (PORTS_INHIBITED | PORTS_INHIBIT_WAIT)
 
 error_t
-ports_begin_rpc (void *portstruct, mach_msg_id_t msg_id, struct rpc_info *info)
+_ports_begin_rpc (void *portstruct, mach_msg_id_t msg_id, struct rpc_info 
*info)
 {
   int *block_flags = 0;
 
@@ -108,4 +109,4 @@
   return 0;
 }
 
-  
+weak_alias (_ports_begin_rpc, ports_begin_rpc)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/claim-right.c 
hurd-20010313/libports/claim-right.c
--- hurd-20010307-snapshot/libports/claim-right.c       Tue May 14 14:56:33 1996
+++ hurd-20010313/libports/claim-right.c        Sun Mar 25 16:24:55 2001
@@ -1,5 +1,5 @@
 /* Take a receive right away from a port
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -19,34 +19,37 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
 
 
+#include "priv.h"
 #include "ports.h"
+#include <error.h>
+#include <assert.h>
 #include <hurd/ihash.h>
 
 mach_port_t
-ports_claim_right (void *portstruct)
+_ports_claim_right (void *portstruct)
 {
+  error_t err;
   struct port_info *pi = portstruct;
-  mach_port_t ret;
+  mach_port_t ret = pi->port_right;
 
-  if (pi->port_right != MACH_PORT_NULL)
+  if (ret != MACH_PORT_NULL)
     {
-      ret = pi->port_right;
-      
       mutex_lock (&_ports_lock);
       ihash_locp_remove (pi->bucket->htable, pi->hentry);
-      mach_port_move_member (mach_task_self (), ret, MACH_PORT_NULL);
+      err = mach_port_move_member (mach_task_self (), ret, MACH_PORT_NULL);
+      assert_perror (err);
+      mutex_unlock (&_ports_lock);
+
       pi->port_right = MACH_PORT_NULL;
+
       if (pi->flags & PORT_HAS_SENDRIGHTS)
        {
          pi->flags &= ~PORT_HAS_SENDRIGHTS;
-         mutex_unlock (&_ports_lock);
          ports_port_deref (pi);
        }
-      else
-       mutex_unlock (&_ports_lock);
     }
-  else
-    ret = MACH_PORT_NULL;
+
   return ret;
 }
 
+weak_alias (_ports_claim_right, ports_claim_right)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/class-iterate.c 
hurd-20010313/libports/class-iterate.c
--- hurd-20010307-snapshot/libports/class-iterate.c     Sun Feb 28 21:51:27 1999
+++ hurd-20010313/libports/class-iterate.c      Sun Mar 25 16:24:58 2001
@@ -1,5 +1,5 @@
 /* Iterate a function over the ports in a class.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
 
    This file is part of the GNU Hurd.
 
@@ -17,13 +17,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <hurd/ihash.h>
 
 error_t
-ports_class_iterate (struct port_class *class,
-                    error_t (*fun)(void *))
+_ports_class_iterate (struct port_class *class,
+                     error_t (*fun)(void *))
 {
   mutex_lock (&_ports_lock);
   if (class->ports != 0)
@@ -35,3 +36,5 @@
   mutex_unlock (&_ports_lock);
   return 0;
 }
+
+weak_alias (_ports_class_iterate, ports_class_iterate);
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/count-bucket.c 
hurd-20010313/libports/count-bucket.c
--- hurd-20010307-snapshot/libports/count-bucket.c      Tue Jun 20 18:36:58 1995
+++ hurd-20010313/libports/count-bucket.c       Sun Mar 25 16:25:02 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,11 +18,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 
 int
-ports_count_bucket (struct port_bucket *bucket)
+_ports_count_bucket (struct port_bucket *bucket)
 {
   int ret;
   
@@ -33,3 +34,5 @@
   
   return ret;
 }
+
+weak_alias (_ports_count_bucket, ports_count_bucket)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/count-class.c 
hurd-20010313/libports/count-class.c
--- hurd-20010307-snapshot/libports/count-class.c       Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/count-class.c        Sun Mar 25 16:25:06 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,11 +18,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 
 int
-ports_count_class (struct port_class *class)
+_ports_count_class (struct port_class *class)
 {
   int ret;
   
@@ -33,5 +34,4 @@
   return ret;
 }
 
-  
-
+weak_alias (_ports_count_class, ports_count_class)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/create-bucket.c 
hurd-20010313/libports/create-bucket.c
--- hurd-20010307-snapshot/libports/create-bucket.c     Fri Feb 14 06:58:46 1997
+++ hurd-20010313/libports/create-bucket.c      Sun Mar 25 16:25:09 2001
@@ -1,5 +1,5 @@
 /* Create a port bucket
-   Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1997, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,26 +18,44 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
-#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
 #include <hurd/ihash.h>
 #include <cthreads.h>
 
 struct port_bucket *
-ports_create_bucket ()
+_ports_create_bucket ()
 {
   struct port_bucket *ret;
   error_t err;
 
   ret = malloc (sizeof (struct port_bucket));
-  assert (ret);
+  if (! ret)
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
 
   err = mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_PORT_SET, 
                            &ret->portset);
-  assert_perror (err);
+  if (err)
+    {
+      errno = err;
+      free (ret);
+      return NULL;
+    }
 
   err = ihash_create (&ret->htable);
-  assert_perror (err);
+  if (err)
+    {
+      errno = err;
+      mach_port_mod_refs (mach_task_self (), ret->portset,
+                         MACH_PORT_RIGHT_PORT_SET, -1);
+      free (ret);
+      return NULL;
+    }
 
   ret->rpcs = ret->flags = ret->count = 0;
 
@@ -48,3 +66,5 @@
 
   return ret;
 }
+
+weak_alias (_ports_create_bucket, ports_create_bucket)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/create-class.c 
hurd-20010313/libports/create-class.c
--- hurd-20010307-snapshot/libports/create-class.c      Sat Jan 27 18:12:56 1996
+++ hurd-20010313/libports/create-class.c       Sun Mar 25 16:25:12 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,18 +18,26 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <stdlib.h>
-#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <errno.h>
 
 struct port_class *
-ports_create_class (void (*clean_routine)(void *),
-                   void (*dropweak_routine)(void *))
+_ports_create_class (void (*clean_routine)(void *),
+                    void (*dropweak_routine)(void *))
 {
   struct port_class *cl;
   
   cl = malloc (sizeof (struct port_class));
-  assert (cl);
+  if (! cl)
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
   cl->clean_routine = clean_routine;
   cl->dropweak_routine = dropweak_routine;
   cl->flags = 0;
@@ -40,3 +48,5 @@
 
   return cl;
 }
+
+weak_alias (_ports_create_class, ports_create_class)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/create-internal.c 
hurd-20010313/libports/create-internal.c
--- hurd-20010307-snapshot/libports/create-internal.c   Fri Jul 19 07:11:34 1996
+++ hurd-20010313/libports/create-internal.c    Sun Mar 18 17:56:02 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -48,7 +48,9 @@
   pi = malloc (size);
   if (! pi)
     {
-      mach_port_deallocate (mach_task_self (), port);
+      err = mach_port_mod_refs (mach_task_self (), port,
+                               MACH_PORT_RIGHT_RECEIVE, -1);
+      assert_perror (err);
       return ENOMEM;
     }
 
@@ -103,7 +105,9 @@
   err = EINTR;
  lose:
   mutex_unlock (&_ports_lock);
-  mach_port_mod_refs (mach_task_self (), port, MACH_PORT_RIGHT_RECEIVE, -1);
+  err = mach_port_mod_refs (mach_task_self (), port,
+                           MACH_PORT_RIGHT_RECEIVE, -1);
+  assert_perror (err);
   free (pi);
 
   return err;
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/create-port-noinstall.c 
hurd-20010313/libports/create-port-noinstall.c
--- hurd-20010307-snapshot/libports/create-port-noinstall.c     Fri Jul 19 
07:12:44 1996
+++ hurd-20010313/libports/create-port-noinstall.c      Sun Mar 25 16:25:17 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -18,18 +18,18 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
 
+#include "priv.h"
 #include "ports.h"
 
 /* Create and return in RESULT a new port in CLASS and BUCKET; SIZE bytes
    will be allocated to hold the port structure and whatever private data the
    user desires.  */
 error_t
-ports_create_port_noinstall (struct port_class *class, 
-                            struct port_bucket *bucket,
-                            size_t size, void *result)
+_ports_create_port_noinstall (struct port_class *class, 
+                             struct port_bucket *bucket,
+                             size_t size, void *result)
 {
   return _ports_create_port_internal (class, bucket, size, result, 0);
 }
 
-
-
+weak_alias (_ports_create_port_noinstall, ports_create_port_noinstall)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/create-port.c 
hurd-20010313/libports/create-port.c
--- hurd-20010307-snapshot/libports/create-port.c       Fri Jul 19 05:03:01 1996
+++ hurd-20010313/libports/create-port.c        Sun Mar 25 16:25:30 2001
@@ -1,6 +1,6 @@
 /* Create a new port structure
 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -19,17 +19,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 
 /* Create and return in RESULT a new port in CLASS and BUCKET; SIZE bytes
    will be allocated to hold the port structure and whatever private data the
    user desires.  */
 error_t
-ports_create_port (struct port_class *class, struct port_bucket *bucket,
-                  size_t size, void *result)
+_ports_create_port (struct port_class *class, struct port_bucket *bucket,
+                   size_t size, void *result)
 {
   return _ports_create_port_internal (class, bucket, size, result, 1);
 }
 
-
-
+weak_alias (_ports_create_port, ports_create_port)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/dead-name.c 
hurd-20010313/libports/dead-name.c
--- hurd-20010307-snapshot/libports/dead-name.c Sat Mar  6 23:18:15 1999
+++ hurd-20010313/libports/dead-name.c  Sun Mar 25 16:25:33 2001
@@ -1,6 +1,6 @@
 /* Handle various ports internal uses of dead-name notification
 
-   Copyright (C) 1995, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1999, 2001 Free Software Foundation, Inc.
 
    Written by Miles Bader <miles@gnu.ai.mit.edu>
 
@@ -18,11 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <mach/notify.h>
 
 void
-ports_dead_name (void *notify, mach_port_t dead_name)
+_ports_dead_name (void *notify, mach_port_t dead_name)
 {
   ports_interrupt_notified_rpcs (notify, dead_name, MACH_NOTIFY_DEAD_NAME);
 }
+
+weak_alias (_ports_dead_name, ports_dead_name)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/destroy-right.c 
hurd-20010313/libports/destroy-right.c
--- hurd-20010307-snapshot/libports/destroy-right.c     Sun Feb 28 21:51:52 1999
+++ hurd-20010313/libports/destroy-right.c      Sun Mar 25 16:25:36 2001
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1999, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,13 +18,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
+#include <error.h>
 #include <cthreads.h>
 #include <hurd/ihash.h>
 #include <assert.h>
 
 error_t
-ports_destroy_right (void *portstruct)
+_ports_destroy_right (void *portstruct)
 {
   struct port_info *pi = portstruct;
   error_t err;
@@ -49,3 +51,5 @@
 
   return 0;
 }
+
+weak_alias (_ports_destroy_right, ports_destroy_right)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/enable-bucket.c 
hurd-20010313/libports/enable-bucket.c
--- hurd-20010307-snapshot/libports/enable-bucket.c     Thu Jun 22 22:34:29 1995
+++ hurd-20010313/libports/enable-bucket.c      Sun Mar 25 16:25:38 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,11 +18,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 
 void
-ports_enable_bucket (struct port_bucket *bucket)
+_ports_enable_bucket (struct port_bucket *bucket)
 {
   mutex_lock (&_ports_lock);
   bucket->flags &= ~PORT_BUCKET_NO_ALLOC;
@@ -33,3 +34,5 @@
     }
   mutex_unlock (&_ports_lock);
 }
+
+weak_alias (_ports_enable_bucket, ports_enable_bucket)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/enable-class.c 
hurd-20010313/libports/enable-class.c
--- hurd-20010307-snapshot/libports/enable-class.c      Tue Jun 20 18:37:23 1995
+++ hurd-20010313/libports/enable-class.c       Sun Mar 25 16:25:41 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,11 +18,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 
 void
-ports_enable_class (struct port_class *class)
+_ports_enable_class (struct port_class *class)
 {
   mutex_lock (&_ports_lock);
   class->flags &= ~PORT_CLASS_NO_ALLOC;
@@ -33,3 +34,5 @@
     }
   mutex_unlock (&_ports_lock);
 }
+
+weak_alias (_ports_enable_class, port_enable_class)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/end-rpc.c 
hurd-20010313/libports/end-rpc.c
--- hurd-20010307-snapshot/libports/end-rpc.c   Thu Feb 25 17:22:28 1999
+++ hurd-20010313/libports/end-rpc.c    Sun Mar 25 16:25:44 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,11 +18,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 
 void
-ports_end_rpc (void *port, struct rpc_info *info)
+_ports_end_rpc (void *port, struct rpc_info *info)
 {
   struct port_info *pi = port;
 
@@ -54,3 +55,5 @@
 
   mutex_unlock (&_ports_lock);
 }
+
+weak_alias (_ports_end_rpc, ports_end_rpc)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/get-right.c 
hurd-20010313/libports/get-right.c
--- hurd-20010307-snapshot/libports/get-right.c Fri Mar 17 10:53:10 2000
+++ hurd-20010313/libports/get-right.c  Sun Mar 25 16:25:46 2001
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995,96,2000 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,2000,2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,13 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <mach/notify.h>
 #include <assert.h>
 
 mach_port_t
-ports_get_right (void *port)
+_ports_get_right (void *port)
 {
   struct port_info *pi = port;
   mach_port_t foo;
@@ -57,3 +58,5 @@
   mutex_unlock (&_ports_lock);
   return pi->port_right;
 }
+
+weak_alias (_ports_get_right, ports_get_right)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/get-send-right.c 
hurd-20010313/libports/get-send-right.c
--- hurd-20010307-snapshot/libports/get-send-right.c    Fri Mar 17 11:24:30 2000
+++ hurd-20010313/libports/get-send-right.c     Sun Mar 25 16:25:48 2001
@@ -1,5 +1,5 @@
 /* ports_get_send_right -- get a send right to a ports object
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of the GNU Hurd.
 
@@ -17,11 +17,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <assert.h>
 
 mach_port_t
-ports_get_send_right (void *port)
+_ports_get_send_right (void *port)
 {
   error_t err;
   mach_port_t right;
@@ -36,3 +37,5 @@
 
   return right;
 }
+
+weak_alias (_ports_get_send_right, ports_get_send_right)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/import-port.c 
hurd-20010313/libports/import-port.c
--- hurd-20010307-snapshot/libports/import-port.c       Thu Jul 18 06:31:47 1996
+++ hurd-20010313/libports/import-port.c        Sun Mar 25 16:25:53 2001
@@ -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, 2001 Free Software Foundation, Inc.
 
    Written by Michael I. Bushnell.
 
@@ -20,6 +20,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <assert.h>
 #include <cthreads.h>
@@ -29,8 +30,8 @@
 /* For an existing receive right PORT, create and return in RESULT a new port
    structure; BUCKET, SIZE, and CLASS args are as for ports_create_port. */
 error_t
-ports_import_port (struct port_class *class, struct port_bucket *bucket,
-                  mach_port_t port, size_t size, void *result)
+_ports_import_port (struct port_class *class, struct port_bucket *bucket,
+                   mach_port_t port, size_t size, void *result)
 {
   error_t err;
   mach_port_status_t stat;
@@ -114,3 +115,5 @@
 
   return err;
 }
+
+weak_alias (_ports_import_port, ports_import_port)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/inhibit-all-rpcs.c 
hurd-20010313/libports/inhibit-all-rpcs.c
--- hurd-20010307-snapshot/libports/inhibit-all-rpcs.c  Wed Jul 26 00:34:00 2000
+++ hurd-20010313/libports/inhibit-all-rpcs.c   Sun Mar 25 16:53:48 2001
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,13 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <hurd.h>
 #include <cthreads.h>
 #include <hurd/ihash.h>
 
 error_t
-ports_inhibit_all_rpcs ()
+_ports_inhibit_all_rpcs ()
 {
   error_t err = 0;
 
@@ -77,3 +78,5 @@
 
   return err;
 }
+
+weak_alias (_ports_inhibit_all_rpcs, ports_inhibit_all_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/inhibit-bucket-rpcs.c 
hurd-20010313/libports/inhibit-bucket-rpcs.c
--- hurd-20010307-snapshot/libports/inhibit-bucket-rpcs.c       Wed Jul 26 
00:34:00 2000
+++ hurd-20010313/libports/inhibit-bucket-rpcs.c        Sun Mar 25 16:26:00 2001
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,13 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <hurd.h>
 #include <cthreads.h>
 #include <hurd/ihash.h>
 
 error_t
-ports_inhibit_bucket_rpcs (struct port_bucket *bucket)
+_ports_inhibit_bucket_rpcs (struct port_bucket *bucket)
 {
   error_t err = 0;
 
@@ -74,3 +75,5 @@
 
   return err;
 }
+
+weak_alias (_ports_inhibit_bucket_rpcs, ports_inhibit_bucket_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/inhibit-class-rpcs.c 
hurd-20010313/libports/inhibit-class-rpcs.c
--- hurd-20010307-snapshot/libports/inhibit-class-rpcs.c        Wed Jul 26 
00:34:00 2000
+++ hurd-20010313/libports/inhibit-class-rpcs.c Sun Mar 25 16:26:04 2001
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <hurd.h>
 #include <cthreads.h>
 
 error_t
-ports_inhibit_class_rpcs (struct port_class *class)
+_ports_inhibit_class_rpcs (struct port_class *class)
 {
   error_t err = 0;
 
@@ -67,3 +68,5 @@
 
   return err;
 }
+
+weak_alias (_ports_inhibit_class_rpcs, ports_inhibit_class_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/inhibit-port-rpcs.c 
hurd-20010313/libports/inhibit-port-rpcs.c
--- hurd-20010307-snapshot/libports/inhibit-port-rpcs.c Wed Jul 26 00:34:00 2000
+++ hurd-20010313/libports/inhibit-port-rpcs.c  Sun Mar 25 16:26:06 2001
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <hurd.h>
 #include <cthreads.h>
 
 error_t
-ports_inhibit_port_rpcs (void *portstruct)
+_ports_inhibit_port_rpcs (void *portstruct)
 {
   error_t err = 0;
   struct port_info *pi = portstruct;
@@ -68,3 +69,5 @@
 
   return err;
 }
+
+weak_alias (_ports_inhibit_port_rpcs, ports_inhibit_port_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/init.c 
hurd-20010313/libports/init.c
--- hurd-20010307-snapshot/libports/init.c      Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/init.c       Sun Mar 18 17:31:11 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -23,6 +23,6 @@
 
 struct mutex _ports_lock = MUTEX_INITIALIZER;
 struct condition _ports_block = CONDITION_INITIALIZER;
-struct port_bucket *_ports_all_buckets = 0;
-int _ports_total_rpcs = 0;
-int _ports_flags = 0;
+struct port_bucket *_ports_all_buckets;
+int _ports_total_rpcs;
+int _ports_flags;
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/intern-external-port.c 
hurd-20010313/libports/intern-external-port.c
--- hurd-20010307-snapshot/libports/intern-external-port.c      Sun Apr 28 
21:22:56 1996
+++ hurd-20010313/libports/intern-external-port.c       Thu Jan  1 01:00:00 1970
@@ -1,37 +0,0 @@
-/*
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-   Written by Michael I. Bushnell.
-
-   This file is part of the GNU Hurd.
-
-   The GNU Hurd is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   The GNU Hurd is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "ports.h"
-
-/* Backward compatibility.  */
-void *ports_intern_external_port (struct port_bucket *bucket,
-                                 mach_port_t port,
-                                 size_t size,
-                                 struct port_class *class)
-{
-  void *result;
-  if (ports_import_port (class, bucket, port, size, &result))
-    result = 0;
-  return result;
-}
-
-#include "linkwarn.h"
-link_warning (ports_intern_external_port,
-             "ports_intern_external_port is obsolete; use ports_import_port")
diff --exclude CVS -rNu 
hurd-20010307-snapshot/libports/interrupt-notified-rpcs.c 
hurd-20010313/libports/interrupt-notified-rpcs.c
--- hurd-20010307-snapshot/libports/interrupt-notified-rpcs.c   Thu Dec 28 
19:15:10 1995
+++ hurd-20010313/libports/interrupt-notified-rpcs.c    Sun Mar 25 16:26:08 2001
@@ -1,8 +1,8 @@
 /* Handle interruping rpcs because of notification
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
 
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -18,19 +18,20 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 
 /* A linked list of ports for which notification has been requested.  */
-struct ports_notify *_ports_notifications = 0;
+struct ports_notify *_ports_notifications;
 
 /* Free lists for notify structures.  */
-struct ports_notify *_ports_free_ports_notifies = 0;
-struct rpc_notify *_ports_free_rpc_notifies = 0;
+struct ports_notify *_ports_free_ports_notifies;
+struct rpc_notify *_ports_free_rpc_notifies;
 
 /* Interrupt any rpcs on OBJECT that have requested such.  */
 void
-ports_interrupt_notified_rpcs (void *object,
-                              mach_port_t port, mach_msg_id_t what)
+_ports_interrupt_notified_rpcs (void *object,
+                               mach_port_t port, mach_msg_id_t what)
 {
   if (_ports_notifications)
     {
@@ -52,6 +53,7 @@
       mutex_unlock (&_ports_lock);
     }
 }
+weak_alias (_ports_interrupt_notified_rpcs, ports_interrupt_notified_rpcs)
 
 static void
 remove_req (struct rpc_notify *req)
@@ -115,3 +117,4 @@
     }
 }
 
+weak_alias (_ports_remove_notified_rpc, ports_remove_notified_rpc)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/interrupt-on-notify.c 
hurd-20010313/libports/interrupt-on-notify.c
--- hurd-20010307-snapshot/libports/interrupt-on-notify.c       Fri Jan  1 
20:11:32 1999
+++ hurd-20010313/libports/interrupt-on-notify.c        Sun Mar 25 16:26:11 2001
@@ -1,6 +1,6 @@
 /* Mark an rpc to be interrupted when a port dies
 
-   Copyright (C) 1995, 96, 99 Free Software Foundation, Inc.
+   Copyright (C) 1995, 96, 99, 2001 Free Software Foundation, Inc.
 
    Written by Miles Bader <miles@gnu.org>
 
@@ -18,6 +18,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <assert.h>
 
@@ -25,9 +26,9 @@
    that any of the things in COND have happened to PORT.  RPC should be an
    rpc on OBJECT.  */
 error_t
-ports_interrupt_rpc_on_notification (void *object,
-                                    struct rpc_info *rpc,
-                                    mach_port_t port, mach_msg_id_t what)
+_ports_interrupt_rpc_on_notification (void *object,
+                                     struct rpc_info *rpc,
+                                     mach_port_t port, mach_msg_id_t what)
 {
   int req_notify;
   struct ports_notify *pn;
@@ -159,11 +160,14 @@
   else
     return 0;
 }
+
+weak_alias (_ports_interrupt_rpc_on_notification,
+           ports_interrupt_rpc_on_notification)
 
 /* Arrange for hurd_cancel to be called on the current thread, which should
    be an rpc on OBJECT, if PORT gets notified with the condition WHAT.  */
 error_t
-ports_interrupt_self_on_notification (void *object,
+_ports_interrupt_self_on_notification (void *object,
                                      mach_port_t port, mach_msg_id_t what)
 {
   struct rpc_info *rpc;
@@ -182,3 +186,6 @@
      because we're that thread, and we're still here.  */
   return ports_interrupt_rpc_on_notification (object, rpc, port, what);
 }
+
+weak_alias (_ports_interrupt_self_on_notification, 
+           ports_interrupt_self_on_notification)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/interrupt-rpcs.c 
hurd-20010313/libports/interrupt-rpcs.c
--- hurd-20010307-snapshot/libports/interrupt-rpcs.c    Wed Aug 20 22:38:47 1997
+++ hurd-20010313/libports/interrupt-rpcs.c     Sun Mar 25 16:26:13 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <hurd.h>
 #include <cthreads.h>
 
 void
-ports_interrupt_rpcs (void *portstruct)
+_ports_interrupt_rpcs (void *portstruct)
 {
   struct port_info *pi = portstruct;
   struct rpc_info *rpc;
@@ -38,3 +39,5 @@
 
   mutex_unlock (&_ports_lock);
 }
+
+weak_alias (_ports_interrupt_rpcs, ports_interrupt_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/interrupted.c 
hurd-20010313/libports/interrupted.c
--- hurd-20010307-snapshot/libports/interrupted.c       Wed Aug 20 22:33:03 1997
+++ hurd-20010313/libports/interrupted.c        Sun Mar 25 16:26:17 2001
@@ -1,7 +1,7 @@
 /* Keeping track of thread interruption
 
-   Copyright (C) 1997 Free Software Foundation, Inc.
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Copyright (C) 1997, 2001 Free Software Foundation, Inc.
+   Written by Miles Bader <miles@gnu.org>
    This file is part of the GNU Hurd.
 
    The GNU Hurd is free software; you can redistribute it and/or
@@ -18,17 +18,18 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
 
+#include "priv.h"
 #include "ports.h"
 
 static spin_lock_t interrupted_lock = SPIN_LOCK_INITIALIZER;
 
 /* True if some active rpc has been interrupted.  */
-static struct rpc_info *interrupted = 0;
+static struct rpc_info *interrupted;
 
 /* If the current thread's rpc has been interrupted with
    ports_interrupt_rpcs, return true (and clear the interrupted flag).  */
 int
-ports_self_interrupted ()
+_ports_self_interrupted ()
 {
   struct rpc_info **rpc_p, *rpc;
   thread_t self = hurd_thread_self ();
@@ -49,6 +50,8 @@
 
   return 0;
 }
+
+weak_alias (_ports_self_interrupted, ports_self_interrupted)
 
 /* Add RPC to the list of rpcs that have been interrupted.  */
 void
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/lookup-port.c 
hurd-20010313/libports/lookup-port.c
--- hurd-20010307-snapshot/libports/lookup-port.c       Thu Jun 22 19:52:39 1995
+++ hurd-20010313/libports/lookup-port.c        Sun Mar 25 16:26:21 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,16 +18,18 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <hurd/ihash.h>
+#include <stdlib.h>
 
 void *
-ports_lookup_port (struct port_bucket *bucket,
-                  mach_port_t port,
-                  struct port_class *class)
+_ports_lookup_port (struct port_bucket *bucket,
+                   mach_port_t port,
+                   struct port_class *class)
 {
-  struct port_info *pi = 0;
+  struct port_info *pi = NULL;
   
   mutex_lock (&_ports_lock);
 
@@ -42,7 +44,7 @@
       }
   
   if (pi && class && pi->class != class)
-    pi = 0;
+    pi = NULL;
 
   if (pi)
     pi->refcnt++;
@@ -52,4 +54,4 @@
   return pi;
 }
 
-  
+weak_alias (_ports_lookup_port, ports_lookup_port)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/manage-multithread.c 
hurd-20010313/libports/manage-multithread.c
--- hurd-20010307-snapshot/libports/manage-multithread.c        Wed Aug 20 
22:41:57 1997
+++ hurd-20010313/libports/manage-multithread.c Sun Mar 25 16:26:23 2001
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,6 +18,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <spin-lock.h>
 #include <assert.h>
@@ -25,11 +26,11 @@
 #include <mach/message.h>
 
 void
-ports_manage_port_operations_multithread (struct port_bucket *bucket,
-                                         ports_demuxer_type demuxer,
-                                         int thread_timeout,
-                                         int global_timeout,
-                                         void (*hook)())
+_ports_manage_port_operations_multithread (struct port_bucket *bucket,
+                                          ports_demuxer_type demuxer,
+                                          int thread_timeout,
+                                          int global_timeout,
+                                          void (*hook)())
 {
   volatile int nreqthreads;
   volatile int totalthreads;
@@ -164,7 +165,5 @@
   thread_function (1);
 }
 
-
-
-
-
+weak_alias (_ports_manage_port_operations_multithread,
+           ports_manage_port_operations_multithread)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/manage-one-thread.c 
hurd-20010313/libports/manage-one-thread.c
--- hurd-20010307-snapshot/libports/manage-one-thread.c Thu Mar 28 21:21:36 1996
+++ hurd-20010313/libports/manage-one-thread.c  Sun Mar 25 16:26:25 2001
@@ -1,6 +1,6 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-   Writtenb by Michael I. Bushnell.
+   Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
+   Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
 
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 
 void
-ports_manage_port_operations_one_thread (struct port_bucket *bucket,
-                                        ports_demuxer_type demuxer,
-                                        int timeout)
+_ports_manage_port_operations_one_thread (struct port_bucket *bucket,
+                                         ports_demuxer_type demuxer,
+                                         int timeout)
 {
   error_t err;
 
@@ -91,3 +92,6 @@
                                   timeout ? MACH_RCV_TIMEOUT : 0, timeout);
   while (err != MACH_RCV_TIMED_OUT);
 }
+
+weak_alias (_ports_manage_port_operations_one_thread,
+           ports_manage_port_operations_one_thread)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/no-senders.c 
hurd-20010313/libports/no-senders.c
--- hurd-20010307-snapshot/libports/no-senders.c        Sat Jan 27 18:22:57 1996
+++ hurd-20010313/libports/no-senders.c Sun Mar 25 16:26:28 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,13 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <mach/notify.h>
 
 void
-ports_no_senders (void *portstruct,
-                 mach_port_mscount_t mscount)
+_ports_no_senders (void *portstruct,
+                  mach_port_mscount_t mscount)
 {
   struct port_info *pi = portstruct;
   int dealloc;
@@ -64,3 +65,5 @@
       ports_port_deref (pi);
     }
 }
+
+weak_alias (_ports_no_senders, ports_no_senders)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/notify-dead-name.c 
hurd-20010313/libports/notify-dead-name.c
--- hurd-20010307-snapshot/libports/notify-dead-name.c  Sat Mar  6 23:18:17 1999
+++ hurd-20010313/libports/notify-dead-name.c   Sun Mar 25 16:26:30 2001
@@ -1,8 +1,8 @@
 /* Dead name notification
 
-   Copyright (C) 1995, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1999, 2001 Free Software Foundation, Inc.
 
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -18,12 +18,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include "notify_S.h"
 
 error_t
-ports_do_mach_notify_dead_name (mach_port_t notify, mach_port_t dead_name)
-{
+_ports_do_mach_notify_dead_name (mach_port_t notify, mach_port_t dead_name) {
   void *pi = ports_lookup_port (0, notify, 0);
   if (!pi)
     return EOPNOTSUPP;
@@ -35,3 +35,5 @@
   
   return 0;
 }
+
+weak_alias (_ports_do_mach_notify_dead_name, ports_do_mach_notify_dead_name)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/notify-msg-accepted.c 
hurd-20010313/libports/notify-msg-accepted.c
--- hurd-20010307-snapshot/libports/notify-msg-accepted.c       Tue Nov 21 
16:29:22 1995
+++ hurd-20010313/libports/notify-msg-accepted.c        Sun Mar 25 16:26:32 2001
@@ -1,8 +1,8 @@
 /* Msg accepted notification
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
 
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -18,11 +18,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include "notify_S.h"
 
 error_t
-ports_do_mach_notify_msg_accepted (mach_port_t notify, mach_port_t name)
+_ports_do_mach_notify_msg_accepted (mach_port_t notify, mach_port_t name)
 {
   return 0;
 }
+
+weak_alias (_ports_do_mach_notify_msg_accepted,
+           ports_do_mach_notify_msg_accepted)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/notify-no-senders.c 
hurd-20010313/libports/notify-no-senders.c
--- hurd-20010307-snapshot/libports/notify-no-senders.c Tue Nov 21 16:28:23 1995
+++ hurd-20010313/libports/notify-no-senders.c  Sun Mar 25 16:26:34 2001
@@ -1,8 +1,8 @@
 /* No sender notification
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
 
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -18,11 +18,12 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include "notify_S.h"
 
 error_t
-ports_do_mach_notify_no_senders (mach_port_t port, mach_port_mscount_t count)
+_ports_do_mach_notify_no_senders (mach_port_t port, mach_port_mscount_t count)
 {
   void *pi = ports_lookup_port (0, port, 0);
   if (!pi)
@@ -31,3 +32,6 @@
   ports_port_deref (pi);
   return 0;
 }
+
+weak_alias (_ports_do_mach_notify_no_senders,
+           ports_do_mach_notify_no_senders)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/notify-port-deleted.c 
hurd-20010313/libports/notify-port-deleted.c
--- hurd-20010307-snapshot/libports/notify-port-deleted.c       Tue Nov 21 
16:29:54 1995
+++ hurd-20010313/libports/notify-port-deleted.c        Sun Mar 25 16:26:36 2001
@@ -1,8 +1,8 @@
 /* Port deleted notification
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
 
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -18,11 +18,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include "notify_S.h"
 
 error_t
-ports_do_mach_notify_port_deleted (mach_port_t notify, mach_port_t name)
+_ports_do_mach_notify_port_deleted (mach_port_t notify, mach_port_t name)
 {
   return 0;
 }
+
+weak_alias (_ports_do_mach_notify_port_deleted,
+           ports_do_mach_notify_port_deleted)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/notify-port-destroyed.c 
hurd-20010313/libports/notify-port-destroyed.c
--- hurd-20010307-snapshot/libports/notify-port-destroyed.c     Tue Nov 21 
16:28:52 1995
+++ hurd-20010313/libports/notify-port-destroyed.c      Sun Mar 25 16:26:41 2001
@@ -1,8 +1,8 @@
 /* Port destroyed notification
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
 
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -18,11 +18,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include "notify_S.h"
 
 error_t
-ports_do_mach_notify_port_destroyed (mach_port_t notify, mach_port_t name)
+_ports_do_mach_notify_port_destroyed (mach_port_t notify, mach_port_t name)
 {
   return 0;
 }
+
+weak_alias (_ports_do_mach_notify_port_destroyed,
+           ports_do_mach_notify_port_destroyed)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/notify-send-once.c 
hurd-20010313/libports/notify-send-once.c
--- hurd-20010307-snapshot/libports/notify-send-once.c  Tue Nov 21 16:30:25 1995
+++ hurd-20010313/libports/notify-send-once.c   Sun Mar 25 16:26:43 2001
@@ -1,8 +1,8 @@
 /* Send once notification
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
 
-   Written by Miles Bader <miles@gnu.ai.mit.edu>
+   Written by Miles Bader <miles@gnu.org>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -18,11 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include "notify_S.h"
 
 error_t
-ports_do_mach_notify_send_once (mach_port_t notify)
+_ports_do_mach_notify_send_once (mach_port_t notify)
 {
   return 0;
 }
+
+weak_alias (_ports_do_mach_notify_send_once, ports_do_mach_notify_send_once) 
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/port-deref-weak.c 
hurd-20010313/libports/port-deref-weak.c
--- hurd-20010307-snapshot/libports/port-deref-weak.c   Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/port-deref-weak.c    Sun Mar 25 16:26:45 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_port_deref_weak (void *portstruct)
+_ports_port_deref_weak (void *portstruct)
 {
   struct port_info *pi = portstruct;
   
@@ -36,3 +37,4 @@
     mutex_unlock (&_ports_lock);
 }
 
+weak_alias (_ports_port_deref_weak, ports_port_deref_weak)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/port-deref.c 
hurd-20010313/libports/port-deref.c
--- hurd-20010307-snapshot/libports/port-deref.c        Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/port-deref.c Sun Mar 25 16:26:49 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,27 +18,23 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_port_deref (void *portstruct)
+_ports_port_deref (void *portstruct)
 {
   struct port_info *pi = portstruct;
-  int trieddroppingweakrefs = 0;
 
- retry:
-  
   mutex_lock (&_ports_lock);
   
-  if (pi->refcnt == 1 && pi->weakrefcnt && !trieddroppingweakrefs)
+  if (pi->refcnt == 1 && pi->weakrefcnt && pi->class->dropweak_routine)
     {
       mutex_unlock (&_ports_lock);
-      if (pi->class->dropweak_routine)
-       (*pi->class->dropweak_routine) (pi);
-      trieddroppingweakrefs = 1;
-      goto retry;
+      (*pi->class->dropweak_routine) (pi);
+      mutex_lock (&_ports_lock);
     }
   
   assert (pi->refcnt);
@@ -50,4 +46,4 @@
     mutex_unlock (&_ports_lock);
 }
 
-      
+weak_alias (_ports_port_deref, ports_port_deref)       
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/port-ref-weak.c 
hurd-20010313/libports/port-ref-weak.c
--- hurd-20010307-snapshot/libports/port-ref-weak.c     Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/port-ref-weak.c      Sun Mar 25 16:26:52 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_port_ref_weak (void *portstruct)
+_ports_port_ref_weak (void *portstruct)
 {
   struct port_info *pi = portstruct;
   
@@ -32,3 +33,5 @@
   pi->weakrefcnt++;
   mutex_unlock (&_ports_lock);
 }
+
+weak_alias (_ports_port_ref_weak, ports_port_ref_weak)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/port-ref.c 
hurd-20010313/libports/port-ref.c
--- hurd-20010307-snapshot/libports/port-ref.c  Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/port-ref.c   Sun Mar 25 16:26:55 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_port_ref (void *portstruct)
+_ports_port_ref (void *portstruct)
 {
   struct port_info *pi = portstruct;
   
@@ -33,4 +34,4 @@
   mutex_unlock (&_ports_lock);
 }
 
-  
+weak_alias (_ports_port_ref, ports_port_ref)   
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/priv.h 
hurd-20010313/libports/priv.h
--- hurd-20010307-snapshot/libports/priv.h      Thu Jan  1 01:00:00 1970
+++ hurd-20010313/libports/priv.h       Sun Mar 25 16:24:11 2001
@@ -0,0 +1,26 @@
+/* 
+   Copyright (C) 2001 Free Software Foundation, Inc.
+
+   This file is part of the GNU Hurd.
+
+   The GNU Hurd is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   The GNU Hurd is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* Ripped right from libc/include/libc-symbols.h  */
+#ifndef weak_alias
+#define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+#define _weak_alias(name, aliasname) \
+  extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+#endif
+
diff --exclude CVS -rNu 
hurd-20010307-snapshot/libports/reallocate-from-external.c 
hurd-20010313/libports/reallocate-from-external.c
--- hurd-20010307-snapshot/libports/reallocate-from-external.c  Fri Mar 29 
16:23:38 1996
+++ hurd-20010313/libports/reallocate-from-external.c   Sun Mar 25 16:26:59 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,6 +18,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <assert.h>
 #include <cthreads.h>
@@ -25,7 +26,7 @@
 #include <mach/notify.h>
 
 void
-ports_reallocate_from_external (void *portstruct, mach_port_t receive)
+_ports_reallocate_from_external (void *portstruct, mach_port_t receive)
 {
   struct port_info *pi = portstruct;
   mach_port_status_t stat;
@@ -81,3 +82,5 @@
   if (dropref)
     ports_port_deref (pi);
 }
+
+weak_alias (_ports_reallocate_from_external, ports_reallocate_from_external)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/reallocate-port.c 
hurd-20010313/libports/reallocate-port.c
--- hurd-20010307-snapshot/libports/reallocate-port.c   Fri Mar 29 16:24:08 1996
+++ hurd-20010313/libports/reallocate-port.c    Sun Mar 25 16:27:01 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,13 +18,14 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <hurd/ihash.h>
 #include <assert.h>
 #include <cthreads.h>
 
 void
-ports_reallocate_port (void *portstruct)
+_ports_reallocate_port (void *portstruct)
 {
   struct port_info *pi = portstruct;
   error_t err;
@@ -52,14 +53,12 @@
   ihash_add (pi->bucket->htable, pi->port_right, pi, &pi->hentry);
   mutex_unlock (&_ports_lock);
 
-  mach_port_move_member (mach_task_self (), pi->port_right, 
-                        pi->bucket->portset);
+  err = mach_port_move_member (mach_task_self (), pi->port_right, 
+                              pi->bucket->portset);
+  assert_perror (err);
 
   if (dropref)
     ports_port_deref (pi);
 }
 
-  
-
-                     
-    
+weak_alias (_ports_reallocate_port, ports_reallocate_port)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/resume-all-rpcs.c 
hurd-20010313/libports/resume-all-rpcs.c
--- hurd-20010307-snapshot/libports/resume-all-rpcs.c   Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/resume-all-rpcs.c    Sun Mar 25 16:27:03 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_resume_all_rpcs ()
+_ports_resume_all_rpcs ()
 {
   mutex_lock (&_ports_lock);
   assert (_ports_flags & _PORTS_INHIBITED);
@@ -36,4 +37,4 @@
   mutex_unlock (&_ports_lock);
 }
 
-      
+weak_alias (_ports_resume_all_rpcs, ports_resume_all_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/resume-bucket-rpcs.c 
hurd-20010313/libports/resume-bucket-rpcs.c
--- hurd-20010307-snapshot/libports/resume-bucket-rpcs.c        Tue Jun 20 
18:31:54 1995
+++ hurd-20010313/libports/resume-bucket-rpcs.c Sun Mar 25 16:28:19 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_resume_bucket_rpcs (struct port_bucket *bucket)
+_ports_resume_bucket_rpcs (struct port_bucket *bucket)
 {
   mutex_lock (&_ports_lock);
   assert (bucket->flags & PORT_BUCKET_INHIBITED);
@@ -35,3 +36,5 @@
     }
   mutex_unlock (&_ports_lock);
 }
+
+weak_alias (_ports_resume_bucket_rpcs, ports_resume_bucket_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/resume-class-rpcs.c 
hurd-20010313/libports/resume-class-rpcs.c
--- hurd-20010307-snapshot/libports/resume-class-rpcs.c Wed Jul 12 22:29:08 1995
+++ hurd-20010313/libports/resume-class-rpcs.c  Sun Mar 25 16:27:12 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_resume_class_rpcs (struct port_class *class)
+_ports_resume_class_rpcs (struct port_class *class)
 {
   mutex_lock (&_ports_lock);
   assert (class->flags & PORT_CLASS_INHIBITED);
@@ -36,3 +37,4 @@
   mutex_unlock (&_ports_lock);
 }
 
+weak_alias (_ports_resume_class_rpcs, ports_resume_class_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/resume-port-rpcs.c 
hurd-20010313/libports/resume-port-rpcs.c
--- hurd-20010307-snapshot/libports/resume-port-rpcs.c  Tue Jun 20 18:31:54 1995
+++ hurd-20010313/libports/resume-port-rpcs.c   Sun Mar 25 16:27:16 2001
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -18,12 +18,13 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "priv.h"
 #include "ports.h"
 #include <cthreads.h>
 #include <assert.h>
 
 void
-ports_resume_port_rpcs (void *portstruct)
+_ports_resume_port_rpcs (void *portstruct)
 {
   struct port_info *pi = portstruct;
   
@@ -39,5 +40,4 @@
   mutex_unlock (&_ports_lock);
 }
 
-
-  
+weak_alias (_ports_resume_port_rpcs, ports_resume_port_rpcs)
diff --exclude CVS -rNu hurd-20010307-snapshot/libports/transfer-right.c 
hurd-20010313/libports/transfer-right.c
--- hurd-20010307-snapshot/libports/transfer-right.c    Fri Mar 29 15:34:56 1996
+++ hurd-20010313/libports/transfer-right.c     Sun Mar 25 16:27:19 2001
@@ -1,5 +1,5 @@
 /* Transfer the receive right from one port structure to another
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2001 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -19,12 +19,14 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
 
 
+#include "priv.h"
 #include "ports.h"
+#include <assert.h>
 #include <hurd/ihash.h>
 
 error_t
-ports_transfer_right (void *tostruct, 
-                     void *fromstruct)
+_ports_transfer_right (void *tostruct, 
+                      void *fromstruct)
 {
   struct port_info *topi = tostruct;
   struct port_info *frompi = fromstruct;
@@ -56,6 +58,7 @@
       ihash_locp_remove (topi->bucket->htable, topi->hentry);
       err = mach_port_mod_refs (mach_task_self (), topi->port_right,
                                MACH_PORT_RIGHT_RECEIVE, -1);
+      assert_perror (err);
       if ((topi->flags & PORT_HAS_SENDRIGHTS) && !hassendrights)
        {
          dereftopi = 1;
@@ -77,7 +80,11 @@
     {
       ihash_add (topi->bucket->htable, port, topi, &topi->hentry);
       if (topi->bucket != frompi->bucket)
-       mach_port_move_member (mach_task_self (), port, topi->bucket->portset);
+       {
+         err = mach_port_move_member (mach_task_self (), port,
+                                      topi->bucket->portset);
+         assert_perror (err);
+       }
     }
   
   mutex_unlock (&_ports_lock);
@@ -90,5 +97,5 @@
   return 0;
 }
 
-
+weak_alias (_ports_transfer_right, ports_transfer_right)
   

Attachment: pgprqVUtJX6s3.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]