commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 01/08: New upstream snapshot


From: Samuel Thibault
Subject: [hurd] 01/08: New upstream snapshot
Date: Thu, 14 Jan 2016 01:04:15 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch master
in repository hurd.

commit fa55130df5eeec999d51f130880bd3f85dd32aa4
Author: Samuel Thibault <address@hidden>
Date:   Thu Jan 14 00:01:12 2016 +0000

    New upstream snapshot
---
 Makeconf                                     |   9 +-
 Makefile                                     |   4 +-
 auth/Makefile                                |   2 +-
 boot/Makefile                                |   2 +-
 boot/boot.c                                  |   4 +-
 console-client/Makefile                      |   5 +-
 console-client/bdf.c                         |   4 +-
 console-client/driver.c                      |   2 +-
 console-client/pc-kbd.c                      |  23 ++--
 console-client/vga-dynacolor.h               |  10 +-
 console-client/vga-dynafont.c                |   8 +-
 console-client/vga-support.c                 |   8 +-
 console-client/vga-support.h                 |   4 +-
 console-client/vga.c                         |   2 +-
 console/Makefile                             |   2 +-
 console/pager.c                              |   1 -
 daemons/Makefile                             |   3 +-
 daemons/lmail.c                              |   2 +-
 devnode/ChangeLog                            |  34 -----
 devnode/Makefile                             |   2 +-
 devnode/devnode.c                            |   6 +-
 devnode/mig-mutate.h                         |   2 +
 devnode/util.h                               |   8 +-
 doc/hurd.texi                                |  78 +++++++++--
 exec/Makefile                                |   2 +-
 exec/elfcore.c                               |   4 +-
 exec/main.c                                  |   2 +-
 ext2fs/Makefile                              |   2 +-
 ext2fs/balloc.c                              |  12 +-
 ext2fs/bitmap.c                              |   2 +-
 ext2fs/dir.c                                 |   2 +-
 ext2fs/ext2fs.h                              |  17 +--
 ext2fs/hyper.c                               |   2 +-
 ext2fs/ialloc.c                              |   8 +-
 ext2fs/pager.c                               | 105 +++++++++------
 fatfs/Makefile                               |   2 +-
 fatfs/dir.c                                  |   9 +-
 fatfs/fat.c                                  |   6 +-
 fatfs/fat.h                                  |   4 +-
 fatfs/inode.c                                |   9 +-
 fatfs/pager.c                                |   2 -
 fstests/fstests.c                            |   6 +-
 ftpfs/Makefile                               |   2 +-
 hostmux/Makefile                             |   2 +-
 hurd/console.h                               |   7 +
 include/sys/procfs.h                         |   4 +-
 isofs/Makefile                               |   2 +-
 isofs/rr.c                                   |   2 +-
 isofs/rr.h                                   |  28 ++--
 libdde-linux26/contrib/include/linux/ioctl.h |   1 -
 libdde-linux26/lib/src/kernel/timeconst.pl   |   2 +-
 libdiskfs/Makefile                           |   2 +-
 libdiskfs/boot-start.c                       |   4 +-
 libdiskfs/dir-chg.c                          |   2 +-
 libdiskfs/dir-lookup.c                       |  21 ++-
 libdiskfs/diskfs.h                           |   5 +-
 libdiskfs/name-cache.c                       |  89 +-----------
 libdiskfs/node-cache.c                       | 107 +++++++--------
 libftpconn/cmd.c                             |   3 +-
 libftpconn/reply.c                           |   4 +-
 libhurd-slab/Makefile                        |   2 +-
 libihash/Makefile                            |   2 +-
 libihash/ihash.c                             | 195 ++++++++++++++++++++-------
 libihash/ihash.h                             |  81 ++++++++++-
 libihash/murmur3.c                           |  93 +++++++++++++
 libnetfs/dir-lookup.c                        |  24 +++-
 libshouldbeinlibc/portinfo.c                 |   8 +-
 libshouldbeinlibc/ugids-verify-auth.c        |   5 +-
 libshouldbeinlibc/xportinfo.c                |   2 +-
 libstore/decode.c                            |   4 +-
 libstore/file.c                              |   4 +-
 libstore/zero.c                              |   5 +-
 libtrivfs/Makefile                           |   1 -
 libtrivfs/cntl-classes.c                     |  22 ---
 libtrivfs/mig-decls.h                        |  18 +--
 libtrivfs/protid-classes.c                   |  22 ---
 libtrivfs/trivfs.h                           |  13 --
 mach-defpager/Makefile                       |   4 +-
 mach-defpager/kalloc.c                       |  29 +---
 nfs/Makefile                                 |   2 +-
 nfs/ops.c                                    |   2 +-
 nfsd/Makefile                                |   2 +-
 nfsd/cache.c                                 |  23 ++--
 nfsd/fsys.c                                  |   2 +-
 nfsd/nfsd.h                                  |   7 +-
 nfsd/ops.c                                   |  14 +-
 pfinet/Makefile                              |   2 +-
 pfinet/glue-include/linux/kernel.h           |   8 +-
 pfinet/glue-include/linux/sched.h            |   9 +-
 pfinet/linux-src/include/asm-i386/checksum.h |   6 +-
 pfinet/linux-src/include/linux/atalk.h       |   2 +-
 pfinet/linux-src/include/linux/bitops.h      |   8 +-
 pfinet/linux-src/include/linux/filter.h      |   2 +-
 pfinet/linux-src/include/linux/firewall.h    |   6 +-
 pfinet/linux-src/include/linux/hfs_fs.h      |   4 +-
 pfinet/linux-src/include/linux/igmp.h        |   2 +-
 pfinet/linux-src/include/linux/inetdevice.h  |   8 +-
 pfinet/linux-src/include/linux/ipsec.h       |   4 +-
 pfinet/linux-src/include/linux/netdevice.h   |  10 +-
 pfinet/linux-src/include/linux/netlink.h     |   2 +-
 pfinet/linux-src/include/linux/notifier.h    |   6 +-
 pfinet/linux-src/include/linux/parport.h     |   6 +-
 pfinet/linux-src/include/linux/parport_pc.h  |  32 ++---
 pfinet/linux-src/include/linux/quotaops.h    |  16 +--
 pfinet/linux-src/include/linux/rtnetlink.h   |  22 +--
 pfinet/linux-src/include/linux/sched.h       |  10 +-
 pfinet/linux-src/include/linux/skbuff.h      |  96 ++++++-------
 pfinet/linux-src/include/linux/tqueue.h      |   4 +-
 pfinet/linux-src/include/net/addrconf.h      |  10 +-
 pfinet/linux-src/include/net/checksum.h      |   2 +-
 pfinet/linux-src/include/net/dst.h           |  22 +--
 pfinet/linux-src/include/net/if_inet6.h      |   2 +-
 pfinet/linux-src/include/net/ip.h            |  12 +-
 pfinet/linux-src/include/net/ip6_fib.h       |   4 +-
 pfinet/linux-src/include/net/ip6_route.h     |   2 +-
 pfinet/linux-src/include/net/ip_fib.h        |  14 +-
 pfinet/linux-src/include/net/ipv6.h          |  12 +-
 pfinet/linux-src/include/net/ndisc.h         |   2 +-
 pfinet/linux-src/include/net/neighbour.h     |  18 +--
 pfinet/linux-src/include/net/pkt_cls.h       |   4 +-
 pfinet/linux-src/include/net/pkt_sched.h     |   6 +-
 pfinet/linux-src/include/net/profile.h       |  30 ++---
 pfinet/linux-src/include/net/route.h         |   6 +-
 pfinet/linux-src/include/net/sock.h          |  23 ++--
 pfinet/linux-src/include/net/tcp.h           |  28 ++--
 pfinet/linux-src/net/ipv4/fib_hash.c         |  10 +-
 pfinet/linux-src/net/ipv4/fib_semantics.c    |   4 +-
 pfinet/linux-src/net/ipv4/ip_fragment.c      |   6 +-
 pfinet/linux-src/net/ipv4/tcp_input.c        |   6 +-
 pfinet/linux-src/net/ipv6/reassembly.c       |   6 +-
 pfinet/main.c                                |   6 +-
 pfinet/mapped-time.h                         |   4 +-
 pfinet/timer-emul.c                          |   4 +-
 pflocal/Makefile                             |   2 +-
 pflocal/socket.c                             |  25 +++-
 proc/Makefile                                |   3 +-
 proc/mgt.c                                   |   1 +
 procfs/Makefile                              |   2 +-
 procfs/process.c                             |   4 +-
 procfs/rootdir.c                             |  10 +-
 random/Makefile                              |   4 +-
 random/gnupg-random.c                        |  14 +-
 random/gnupg-rmd.h                           |   2 +-
 random/gnupg-rmd160.c                        |  21 ++-
 random/random.c                              |  81 ++++++-----
 startup/startup.c                            |   2 +-
 storeio/Makefile                             |   2 +-
 storeio/pager.c                              |   1 -
 term/Makefile                                |   6 +-
 term/mig-mutate.h                            |   1 +
 tmpfs/Makefile                               |   2 +-
 trans/Makefile                               |  27 ++--
 trans/mtab.c                                 |   2 +-
 trans/streamio.c                             |   2 +-
 usermux/Makefile                             |   2 +-
 utils/Makefile                               |   7 +-
 utils/rpcscan.c                              |   3 +-
 utils/rpctrace.c                             |  23 ++--
 utils/shd.c                                  |   3 +-
 utils/vminfo.c                               |  22 +--
 utils/vmstat.c                               |  22 ++-
 utils/w.c                                    |   3 +-
 162 files changed, 1168 insertions(+), 933 deletions(-)

diff --git a/Makeconf b/Makeconf
index b42e4c7..8e24fc4 100644
--- a/Makeconf
+++ b/Makeconf
@@ -36,7 +36,6 @@
 
 # Types `server' and `utility' should define
 #   target (the name of the program built)
-#   OTHERLIBS (all libraries used)
 
 # Types `servers' and `utilities' should define
 #   targets (the names of all the programs built)
@@ -309,7 +308,7 @@ $(installationdirlist): %:
 ifneq ($(makemode),misc)
 
 ifeq ($(doinst),one)
-$(linktarg): $(OBJS) $(OTHERLIBS) $(library_deps)
+$(linktarg): $(OBJS) $(library_deps)
 endif
 
 # Determine which sort of library we should link against from whether -static
@@ -324,7 +323,7 @@ _libsubst=${libsubst$(patsubst 
%,-override,${libsubst-override})}
 
 # Direct the linker where to find shared objects specified in the
 # dependencies of other shared objects it encounters.
-rpath := -Wl,-rpath-link=.:$(subst $. ,:,$(dir $(wildcard ../lib*/lib*.so)))
+lpath := -L. $(patsubst %,-L%,$(dir $(wildcard ../lib*/lib*.so)))
 
 # Main rule to link executables
 #
@@ -333,7 +332,7 @@ rpath := -Wl,-rpath-link=.:$(subst $. ,:,$(dir $(wildcard 
../lib*/lib*.so)))
 ifeq ($(prof-depend),)
 
 define link-executable
-$(CC) $(rpath) $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) \
+$(CC) $(lpath) $(CFLAGS) $($*-CFLAGS) $(LDFLAGS) $($*-LDFLAGS) \
       $(BUGADDR_REF) \
       -o $@
 endef
@@ -382,7 +381,7 @@ $(libname)_pic.a: $(patsubst %.o,%_pic.o,$(OBJS))
 # we make that a symlink.
 $(libname).so.$(hurd-version): $(patsubst %.o,%_pic.o,$(OBJS)) $(library_deps)
        $(CC) -shared -Wl,-soname=$@ -o $@ \
-             $(rpath) $(CFLAGS) $(LDFLAGS) $($(libname).so-LDFLAGS) \
+             $(lpath) $(CFLAGS) $(LDFLAGS) $($(libname).so-LDFLAGS) \
              '-Wl,-(' $(filter-out %.map,$^) \
                       $($(libname).so-LDLIBS) $(LDLIBS) \
              '-Wl,-)' $(filter %.map,$^)
diff --git a/Makefile b/Makefile
index 3178740..d48baaa 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,8 @@ include ./Makeconf
 # Hurd libraries
 lib-subdirs = libshouldbeinlibc libihash libiohelp libports libthreads \
              libpager libfshelp libdiskfs libtrivfs libps \
-             libnetfs libpipe libstore libhurdbugaddr libftpconn libcons
+             libnetfs libpipe libstore libhurdbugaddr libftpconn libcons \
+             libhurd-slab
 
 # Hurd programs
 prog-subdirs = auth proc exec term \
@@ -42,6 +43,7 @@ prog-subdirs = auth proc exec term \
               procfs \
               startup \
               init \
+              devnode \
 
 ifeq ($(HAVE_SUN_RPC),yes)
 prog-subdirs += nfs nfsd
diff --git a/auth/Makefile b/auth/Makefile
index b9eedda..b82de07 100644
--- a/auth/Makefile
+++ b/auth/Makefile
@@ -23,7 +23,7 @@ SRCS = auth.c
 OBJS = auth.o authServer.o auth_replyUser.o
 target = auth
 HURDLIBS = ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
 
diff --git a/boot/Makefile b/boot/Makefile
index 0afdb43..c877295 100644
--- a/boot/Makefile
+++ b/boot/Makefile
@@ -28,7 +28,7 @@ UX-OBJS = mach-crt0.o uxboot.o sigvec.o syscall.o ux.o 
$(COMMON-OBJS)
 target = boot
 io-MIGSFLAGS=-DREPLY_PORTS
 HURDLIBS = store shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS += -lpthread
 
 include ../Makeconf
 
diff --git a/boot/boot.c b/boot/boot.c
index f688860..4dda26b 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -243,7 +243,9 @@ load_image (task_t t,
     }
 
   read (fd, &hdr, sizeof hdr);
-  if (*(Elf32_Word *) hdr.e.e_ident == *(Elf32_Word *) "\177ELF")
+  /* File must have magic ELF number.  */
+  if (hdr.e.e_ident[0] == 0177 && hdr.e.e_ident[1] == 'E' &&
+      hdr.e.e_ident[2] == 'L' && hdr.e.e_ident[3] == 'F')
     {
       Elf32_Phdr phdrs[hdr.e.e_phnum], *ph;
       lseek (fd, hdr.e.e_phoff, SEEK_SET);
diff --git a/console-client/Makefile b/console-client/Makefile
index 03dad1f..4ebdc82 100644
--- a/console-client/Makefile
+++ b/console-client/Makefile
@@ -52,8 +52,9 @@ driver-CPPFLAGS = -D'CONSOLE_DEFPATH="$(module-dir)\0"' \
 driver-DEPS = $(..)config.make
 
 console: $(CONSOLE_SRCS:.c=.o) \
-       ../libnetfs/libnetfs.a ../libfshelp/libfshelp.a \
-       ../libcons/libcons.a ../libports/libports.a \
+       ../libcons/libcons.a ../libfshelp/libfshelp.a \
+       ../libnetfs/libnetfs.a ../libiohelp/libiohelp.a \
+       ../libihash/libihash.a ../libports/libports.a \
        ../libshouldbeinlibc/libshouldbeinlibc.a
 
 modules = vga pc_kbd generic_speaker pc_mouse current_vcs
diff --git a/console-client/bdf.c b/console-client/bdf.c
index 467c139..b61ef35 100644
--- a/console-client/bdf.c
+++ b/console-client/bdf.c
@@ -128,7 +128,7 @@ parse_hexbyte (char *line, unsigned char *byte)
    COMMENT lines, and removes whitespace at the beginning and end of a
    line.  */
 static int
-next_line (char **line, int *size, FILE *file, int *count)
+next_line (char **line, size_t *size, FILE *file, int *count)
 {
   int len;
 
@@ -184,7 +184,7 @@ bdf_read (FILE *filep, bdf_font_t *font, int *linecount)
 {
   bdf_error_t err = 0;
   char *line = 0;
-  int line_size = 0;
+  size_t line_size = 0;
   int len;
   int done = 0;
   bdf_font_t bdf;
diff --git a/console-client/driver.c b/console-client/driver.c
index 6407824..7a55bbe 100644
--- a/console-client/driver.c
+++ b/console-client/driver.c
@@ -130,7 +130,7 @@ error_t driver_add (const char *const name, const char 
*const driver,
       shobj = dlopen (filename, RTLD_LAZY);
       if (!shobj)
        {
-         const char *errstring = dlerror (); /* Must always call or it leaks! 
*/
+         (void) dlerror (); /* Must always call or it leaks! */
          if (errno != ENOENT)
            {
              free (filename);
diff --git a/console-client/pc-kbd.c b/console-client/pc-kbd.c
index 21c0987..2fc7608 100644
--- a/console-client/pc-kbd.c
+++ b/console-client/pc-kbd.c
@@ -656,7 +656,7 @@ update_leds (void)
   else
     {
       char leds[2];
-      mach_msg_type_number_t data_cnt = 2;
+      int data_cnt = 2;
 
       leds[0] = '\xed';
       leds[1] = (led_state.scroll_lock ? 1 : 0)
@@ -1100,10 +1100,11 @@ input_loop (void *unused)
        }
       else if (state.extended == 1)
        {
+         const enum scancode_x1 scx1 = (enum scancode_x1) sc;
          state.extended = 0;
-         if (sc == SC_X1_RIGHT_CTRL)
+         if (scx1 == SC_X1_RIGHT_CTRL)
            state.right_ctrl = down;
-         else if (sc == SC_X1_RIGHT_ALT)
+         else if (scx1 == SC_X1_RIGHT_ALT)
            {
              state.right_alt = down;
              
@@ -1139,23 +1140,23 @@ input_loop (void *unused)
                    }
                }
            }
-         else if (state.right_alt && down && sc == SC_X1_PAD_SLASH) /* XXX */
+         else if (state.right_alt && down && scx1 == SC_X1_PAD_SLASH) /* XXX */
            state.direct = (state.direct << 4) | 0xb;
-         else if (state.right_alt && down && sc == SC_X1_PAD_ENTER) /* XXX */
+         else if (state.right_alt && down && scx1 == SC_X1_PAD_ENTER) /* XXX */
            state.direct = (state.direct << 4) | 0xf;
-         else if (state.left_alt && down && sc == SC_X1_RIGHT) /* XXX */
+         else if (state.left_alt && down && scx1 == SC_X1_RIGHT) /* XXX */
            console_switch (0, 1);
-         else if (state.left_alt && down && sc == SC_X1_LEFT) /* XXX */
+         else if (state.left_alt && down && scx1 == SC_X1_LEFT) /* XXX */
            console_switch (0, -1);
-         else if (state.left_alt && down && sc == SC_X1_UP) /* XXX */
+         else if (state.left_alt && down && scx1 == SC_X1_UP) /* XXX */
            console_scrollback (CONS_SCROLL_DELTA_LINES, 1);
-         else if (state.left_alt && down && sc == SC_X1_DOWN) /* XXX */
+         else if (state.left_alt && down && scx1 == SC_X1_DOWN) /* XXX */
            console_scrollback (CONS_SCROLL_DELTA_LINES, -1);
          else if ((state.right_shift || state.left_shift)
-                  && down && sc == SC_X1_PGUP) /* XXX */
+                  && down && scx1 == SC_X1_PGUP) /* XXX */
            console_scrollback (CONS_SCROLL_DELTA_SCREENS, 0.5);
          else if ((state.right_shift || state.left_shift)
-                  && down && sc == SC_X1_PGDN) /* XXX */
+                  && down && scx1 == SC_X1_PGDN) /* XXX */
            console_scrollback (CONS_SCROLL_DELTA_SCREENS, -0.5);
          else if (down && sc < sizeof (sc_x1_to_kc)/sizeof (sc_x1_to_kc[0]))
            {
diff --git a/console-client/vga-dynacolor.h b/console-client/vga-dynacolor.h
index 304bcc1..0526e0d 100644
--- a/console-client/vga-dynacolor.h
+++ b/console-client/vga-dynacolor.h
@@ -77,11 +77,17 @@ signed char dynacolor_allocate (dynacolor_t *dc, unsigned 
char col);
 
 /* Add a reference to palette entry P in the dynamic font DC.  */
 #define dynacolor_add_ref(dc,p)                                                
\
-  ((dc).ref[0] >= 0 && (dc).ref[p]++)
+  do {                                                                  \
+      if ((dc).ref[0] >= 0)                                             \
+        (dc).ref[p]++;                                                  \
+  } while (0)
 
 /* Deallocate a reference for palette entry P in the dynamic font DC.  */
 #define dynacolor_release(dc,p)                                                
\
-  ((dc).ref[0] >= 0 && (dc).ref[p]--)
+  do {                                                                  \
+      if ((dc).ref[0] >= 0)                                             \
+        (dc).ref[p]--;                                                  \
+  } while (0)
 
 /* This is a convenience function that looks up a replacement color
    pair if the original colors are not available.  The function always
diff --git a/console-client/vga-dynafont.c b/console-client/vga-dynafont.c
index 573d63b..2cee47e 100644
--- a/console-client/vga-dynafont.c
+++ b/console-client/vga-dynafont.c
@@ -46,7 +46,7 @@ static dynafont_t active_dynafont;
 /* One glyph in a VGA font is 8 pixels wide and 32 pixels high.  Only
    the first N lines are visible, and N depends on the VGA register
    settings.  */
-typedef char vga_font_glyph[VGA_FONT_HEIGHT];
+typedef unsigned char vga_font_glyph[VGA_FONT_HEIGHT];
 
 
 /* For each glyph in the VGA font, one instance of this structure is
@@ -329,7 +329,7 @@ create_system_font (void)
       else
        {
          int i;
-         char glyph_bitmap[32];
+         unsigned char glyph_bitmap[32];
          
          for (i = 0; i < 16; i++)
            {
@@ -591,7 +591,7 @@ dynafont_new (bdf_font_t font, bdf_font_t font_italic, 
bdf_font_t font_bold,
     else
       {
        int i;
-       char *gl = df->vga_font[FONT_INDEX_UNKNOWN];
+       unsigned char *gl = df->vga_font[FONT_INDEX_UNKNOWN];
        /* XXX Take font height into account.  */
        gl[0] = 0x7E;   /*  ******  */
        gl[1] = 0xC3;   /* **    ** */
@@ -988,7 +988,7 @@ dynafont_activate (dynafont_t df)
 {
   int height = (df->font->bbox.height > 32) ? 32 : df->font->bbox.height;
 
-  vga_write_font_buffer (0, 0, (char *) df->vga_font,
+  vga_write_font_buffer (0, 0, (unsigned char *) df->vga_font,
                         df->size * VGA_FONT_HEIGHT);
   vga_select_font_buffer (0, (df->size == 512) ? 1 : 0);
 
diff --git a/console-client/vga-support.c b/console-client/vga-support.c
index e8497f8..3a2d758 100644
--- a/console-client/vga-support.c
+++ b/console-client/vga-support.c
@@ -216,7 +216,7 @@ vga_fini (void)
    DATALEN bytes from DATA (if WRITE is not 0).  */
 static void
 vga_read_write_font_buffer (int write, int buffer, int index,
-                           char *data, size_t datalen)
+                           unsigned char *data, size_t datalen)
 {
   char saved_seq_map;
   char saved_seq_mode;
@@ -271,7 +271,8 @@ vga_read_write_font_buffer (int write, int buffer, int 
index,
 /* Write DATALEN bytes from DATA to the font buffer BUFFER, starting
    from glyph INDEX.  */
 void
-vga_write_font_buffer (int buffer, int index, char *data, size_t datalen)
+vga_write_font_buffer (int buffer, int index, unsigned char *data,
+                       size_t datalen)
 {
   vga_read_write_font_buffer (1, buffer, index, data, datalen);
 }
@@ -279,7 +280,8 @@ vga_write_font_buffer (int buffer, int index, char *data, 
size_t datalen)
 /* Read DATALEN bytes into DATA from the font buffer BUFFER, starting
    from glyph INDEX.  */
 void
-vga_read_font_buffer (int buffer, int index, char *data, size_t datalen)
+vga_read_font_buffer (int buffer, int index, unsigned char *data,
+                      size_t datalen)
 {
   vga_read_write_font_buffer (0, buffer, index, data, datalen);
 }
diff --git a/console-client/vga-support.h b/console-client/vga-support.h
index 38c6248..17c0b5f 100644
--- a/console-client/vga-support.h
+++ b/console-client/vga-support.h
@@ -44,12 +44,12 @@ void vga_fini (void);
 /* Write DATALEN bytes from DATA to the font buffer BUFFER, starting
    from glyph index.  */
 void vga_write_font_buffer (int buffer, int index,
-                           char *data, size_t datalen);
+                           unsigned char *data, size_t datalen);
 
 /* Read DATALEN bytes into DATA from the font buffer BUFFER, starting
    from glyph INDEX.  */
 void vga_read_font_buffer (int buffer, int index,
-                          char *data, size_t datalen);
+                          unsigned char *data, size_t datalen);
 
 /* Set FONT_BUFFER_SUPP to FONT_BUFFER if the font is small.  */
 void vga_select_font_buffer (int font_buffer, int font_buffer_supp);
diff --git a/console-client/vga.c b/console-client/vga.c
index cf6c8c3..2d74aae 100644
--- a/console-client/vga.c
+++ b/console-client/vga.c
@@ -713,7 +713,7 @@ vga_display_write (void *handle, conchar_t *str, size_t 
length,
        return 0;
 
       if (!disp->cur_conchar_attr_init
-         || *(uint32_t *) &disp->cur_conchar_attr != *(uint32_t *) &str->attr)
+         || !conchar_attr_equal (&disp->cur_conchar_attr, &str->attr))
        {
          if (!disp->cur_conchar_attr_init)
            disp->cur_conchar_attr_init = 1;
diff --git a/console/Makefile b/console/Makefile
index c5ab543..c229407 100644
--- a/console/Makefile
+++ b/console/Makefile
@@ -27,7 +27,7 @@ SRCS = console.c display.c pager.c input.c
 MIGSTUBS = notifyServer.o tioctlServer.o fs_notifyUser.o
 
 HURDLIBS = netfs fshelp iohelp pager ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 OBJS = $(sort $(SRCS:.c=.o) $(MIGSTUBS))
 
 MIGSFLAGS += -imacros $(srcdir)/mutations.h
diff --git a/console/pager.c b/console/pager.c
index 818e49d..05074a7 100644
--- a/console/pager.c
+++ b/console/pager.c
@@ -125,7 +125,6 @@ pager_dropweak (struct user_pager_info *upi)
 void
 user_pager_init (void)
 {
-  pthread_t thread;
   error_t err;
 
   /* Create the pager bucket, and start to serve paging requests.  */
diff --git a/daemons/Makefile b/daemons/Makefile
index db1acc7..9d32617 100644
--- a/daemons/Makefile
+++ b/daemons/Makefile
@@ -38,7 +38,8 @@ include ../Makeconf
 rc: rc.sh
 getty: getty.o ../libshouldbeinlibc/libshouldbeinlibc.a
 mail.local: lmail.o ../libshouldbeinlibc/libshouldbeinlibc.a
-console-run: console-run.o ../libfshelp/libfshelp.a ../libports/libports.a
+console-run: console-run.o ../libfshelp/libfshelp.a ../libports/libports.a \
+       ../libihash/libihash.a ../libshouldbeinlibc/libshouldbeinlibc.a
 
 runttys: runttys.o
 runttys-LDLIBS = -lutil
diff --git a/daemons/lmail.c b/daemons/lmail.c
index 963f5dc..33ccf66 100644
--- a/daemons/lmail.c
+++ b/daemons/lmail.c
@@ -510,7 +510,7 @@ main (int argc, char **argv)
   else
     /* Multiple recipients.  */
     {
-      int cached;              /* Temporary processed input file.  */
+      int cached = 0;          /* Temporary processed input file.  */
 
       ex = cache (in, file ?: "-", &params, &cached);
       if (! ex)
diff --git a/devnode/ChangeLog b/devnode/ChangeLog
deleted file mode 100644
index 54ae55f..0000000
--- a/devnode/ChangeLog
+++ /dev/null
@@ -1,34 +0,0 @@
-2008-09-26  Zheng Da  <address@hidden>
-
-       * README: Update.
-
-       * devnode.c (args_doc): New variable.
-       (options): Remove '-d' and change the description of '-n'.
-       (parse_opt): Get the device in ARGP_KEY_ARG instead of from '-d'.
-       (main): Set args_doc to the field of argp.
-
-2008-08-28 Zheng Da <address@hidden>
-
-       * devnode.c (ds_device_open): Return the error instead of stopping the
-       translator.
-
-2008-08-20 Zheng Da <address@hidden>
-
-       * devnode.c (ds_device_open): Test device_name before using it.
-
-       * util.h (DEBUG): Remove the macro.
-
-2008-08-18 Zheng Da <address@hidden>
-
-       * README: New file.
-
-       * devnode.c (options): Replace the option '-i' with '-d'.
-       (parse_opt): Handle the option '-d'. 
-
-2008-08-17 Zheng Da <address@hidden>
-
-       * Makefile: New file.
-
-       * util.h: New file.
-
-       * devnode.c: New file.
diff --git a/devnode/Makefile b/devnode/Makefile
index 9529fa7..0964f8d 100644
--- a/devnode/Makefile
+++ b/devnode/Makefile
@@ -20,7 +20,7 @@ makemode := server
 
 SRCS = devnode.c
 LCLHDRS = util.h
-HURDLIBS = ports trivfs fshelp shouldbeinlibc
+HURDLIBS = fshelp ihash iohelp ports shouldbeinlibc trivfs
 target = devnode
 MIGSTUBS = deviceServer.o notifyServer.o
 MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
diff --git a/devnode/devnode.c b/devnode/devnode.c
index 6ec8a65..2802471 100644
--- a/devnode/devnode.c
+++ b/devnode/devnode.c
@@ -145,7 +145,7 @@ ds_device_open (mach_port_t master_port, mach_port_t 
reply_port,
 {
   error_t err;
 
-  debug ("ds_device_open is called\n");
+  devnode_debug ("ds_device_open is called\n");
 
   if ((user_device_name && strcmp (user_device_name, name))
       || device_name == NULL) 
@@ -273,7 +273,7 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
   ports_inhibit_class_rpcs (trivfs_protid_class);
 
   count = ports_count_class (trivfs_protid_class);
-  debug ("the number of ports alive: %d\n", count);
+  devnode_debug ("the number of ports alive: %d\n", count);
 
   if (count && !(flags & FSYS_GOAWAY_FORCE)) 
     {
@@ -285,7 +285,7 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
     } 
 
   mach_port_deallocate (mach_task_self (), master_device);
-  debug ("the translator is gone away\n");
+  devnode_debug ("the translator is gone away\n");
   exit (0);
 }
 
diff --git a/devnode/mig-mutate.h b/devnode/mig-mutate.h
index 0656014..b7a9ed6 100644
--- a/devnode/mig-mutate.h
+++ b/devnode/mig-mutate.h
@@ -25,3 +25,5 @@
   end_using_port_info (port_info_t)
 #define NOTIFY_IMPORTS                                         \
   import "libports/mig-decls.h";
+#define DEVICE_IMPORTS                                         \
+  import "libports/ports.h";
diff --git a/devnode/util.h b/devnode/util.h
index 2efc1ef..f3cc3c1 100644
--- a/devnode/util.h
+++ b/devnode/util.h
@@ -25,17 +25,15 @@
 
 #ifdef DEBUG 
 
-#define debug(format, ...) do                          \
+#define devnode_debug(format, ...) do                  \
 {                                                      \
-  char buf[1024];                                       \
-  snprintf (buf, 1024, "devnode: %s", format);       \
-  fprintf (stderr , buf, ## __VA_ARGS__);              \
+  fprintf (stderr , "devnode: " format, ## __VA_ARGS__);\
   fflush (stderr);                                     \
 } while (0)
 
 #else
 
-#define debug(format, ...) do {} while (0)
+#define devnode_debug(format, ...) do {} while (0)
 
 #endif
 
diff --git a/doc/hurd.texi b/doc/hurd.texi
index 21a7895..525bfa7 100644
--- a/doc/hurd.texi
+++ b/doc/hurd.texi
@@ -314,6 +314,9 @@ File Transfer Protocol
 
 Networking
 
+* pfinet::                     TCP/IP stack.
+* pflocal::
+* libpipe::
 * Socket Interface::            Network communication I/O protocol.
 
 Authentication
@@ -2318,17 +2321,6 @@ The functions and variables described in this subsection 
already have
 default definitions in @code{libtrivfs}, so you are not forced to define
 them; rather, they may be redefined on a case-by-case basis.
 
address@hidden {extern struct port_class *} trivfs_protid_portclasses []
address@hidden {extern int} trivfs_protid_nportclasses
address@hidden {extern struct port_class *} trivfs_cntl_portclasses []
address@hidden {extern int} trivfs_cntl_nportclasses
-If you define these, they should be vectors (and the associated sizes)
-of port classes that will be translated into control and protid pointers
-for passing to RPCs, in addition to those passed to or created by
address@hidden (or @code{trivfs_startup}), which will
-automatically be recognized.
address@hidden deftypevar
-
 @deftypefn {Variable} error_t {(*trivfs_check_open_hook)} (@w{struct 
trivfs_control address@hidden, @w{struct iouser address@hidden, @w{int 
@var{flags}})
 If this variable is non-zero, it will be called every time an open happens.
 @var{user} and @var{flags} are from the open; @var{cntl} identifies the
@@ -2907,6 +2899,14 @@ FIXME: finish
 @node Special Files
 @chapter Special Files
 
address@hidden
+* fifo::
+* ifsock::
+* magic::
+* null::
+* devnode::
address@hidden menu
+
 In Unix, any file that does not act as a general-purpose unit of storage
 is called a @dfn{special file}.  These are FIFOs, Unix-domain sockets,
 and device nodes.  In the Hurd, there is no need for the ``special
@@ -2925,11 +2925,58 @@ storeio server (FIXME xref).
 
 FIXME: finish
 
address@hidden fifo
 @section fifo
+
address@hidden ifsock
 @section ifsock
+
address@hidden magic
 @section magic
+
address@hidden null
 @section null
 
address@hidden devnode
address@hidden devnode
+
address@hidden
+* Invoking devnode::
address@hidden menu
+
address@hidden is a translator that creates the device file for the device,
+which provides another way for other programs to open the device.
+
+Clients need to get the port to the @dfn{devnode} translator by calling
address@hidden() and uses this port as a master device port to open
+the device by calling @dfn{device_open}(). The device name used in
address@hidden() is specified by @option{--name} of @dfn{devnode}.
+
address@hidden Invoking devnode
address@hidden Invoking devnode
+
+Usage: devnode address@hidden@dots{}]
+
address@hidden @code
address@hidden address@hidden
address@hidden -n
+Define the device name used by clients in device_open().
+
address@hidden address@hidden
address@hidden -M
+Get a pseudo master device port
+
address@hidden table
+
+Mandatory or optional arguments to long options are also mandatory or optional
+for any corresponding short options.
+
+If @option{--name} is specified, the client must use the device name in
address@hidden Otherwise, any device name is acceptable.
+
address@hidden can be useful to open the virtual interface
+created by some other programs, for example by eth-multiplexer.
+
 
 FIXME: a chapter on libtreefs and libdirmgt will probably go here
 
@@ -4550,12 +4597,19 @@ FIXME: finish
 FIXME: this subsystem is in flux @c Thomas, 26-03-1998
 
 @menu
+* pfinet::                     TCP/IP stack.
+* pflocal::
+* libpipe::
 * Socket Interface::            Network communication I/O protocol.
 @end menu
 
-
address@hidden pfinet
 @section pfinet
+
address@hidden pflocal
 @section pflocal
+
address@hidden libpipe
 @section libpipe
 
 @node Socket Interface
diff --git a/exec/Makefile b/exec/Makefile
index d332f36..2406203 100644
--- a/exec/Makefile
+++ b/exec/Makefile
@@ -27,7 +27,7 @@ OBJS = main.o hostarch.o exec.o hashexec.o \
 target = exec
 #targets = exec exec.static
 HURDLIBS = trivfs fshelp iohelp ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 exec-MIGSFLAGS = -imacros $(srcdir)/execmutations.h
 exec_startup-MIGSFLAGS = -imacros $(srcdir)/execmutations.h
diff --git a/exec/elfcore.c b/exec/elfcore.c
index 3e4551e..4840217 100644
--- a/exec/elfcore.c
+++ b/exec/elfcore.c
@@ -408,8 +408,8 @@ dump_core (task_t task, file_t file, off_t corelimit,
        if (err == 0)
          {
            err = proc_get_arg_locations (proc,
-                                         &psinfo.data.pr_argv,
-                                         &psinfo.data.pr_envp);
+                                         (vm_address_t *) &psinfo.data.pr_argv,
+                                         (vm_address_t *) 
&psinfo.data.pr_envp);
            mach_port_deallocate (mach_task_self (), proc);
          }
        {
diff --git a/exec/main.c b/exec/main.c
index beb6f61..1ed7763 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -145,7 +145,7 @@ trivfs_append_args (struct trivfs_control *fsys,
 
   if (MACH_PORT_VALID (opt_device_master))
     {
-      asprintf (&opt, "--device-master-port=%d", opt_device_master);
+      asprintf (&opt, "--device-master-port=%lu", opt_device_master);
 
       if (opt)
        {
diff --git a/ext2fs/Makefile b/ext2fs/Makefile
index 8d2e68c..88f8f46 100644
--- a/ext2fs/Makefile
+++ b/ext2fs/Makefile
@@ -24,7 +24,7 @@ SRCS = balloc.c dir.c ext2fs.c getblk.c hyper.c ialloc.c \
        inode.c pager.c pokel.c truncate.c storeinfo.c msg.c xinl.c
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = diskfs pager iohelp fshelp store ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
+LDLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
 
 include ../Makeconf
 
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index efef8ae..0b9e5a5 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -57,7 +57,7 @@ memscan (void *buf, unsigned char ch, size_t len)
 void
 ext2_free_blocks (block_t block, unsigned long count)
 {
-  char *bh;
+  unsigned char *bh;
   unsigned long block_group;
   unsigned long bit;
   unsigned long i;
@@ -140,8 +140,8 @@ ext2_new_block (block_t goal,
                block_t prealloc_goal,
                block_t *prealloc_count, block_t *prealloc_block)
 {
-  char *bh = NULL;
-  char *p, *r;
+  unsigned char *bh = NULL;
+  unsigned char *p, *r;
   int i, j, k, tmp;
   unsigned long lmap;
   struct ext2_group_desc *gdp;
@@ -231,9 +231,9 @@ repeat:
        * Search first in the remainder of the current group; then,
        * cyclicly search through the rest of the groups.
        */
-      p = ((char *) bh) + (j >> 3);
+      p = bh + (j >> 3);
       r = memscan (p, 0, (sblock->s_blocks_per_group - j + 7) >> 3);
-      k = (r - ((char *) bh)) << 3;
+      k = (r - bh) << 3;
       if (k < sblock->s_blocks_per_group)
        {
          j = k;
@@ -434,7 +434,7 @@ block_in_use (block_t block, unsigned char *map)
 void
 ext2_check_blocks_bitmap ()
 {
-  char *bh;
+  unsigned char *bh;
   unsigned long desc_count, bitmap_count, x;
   unsigned long desc_blocks;
   struct ext2_group_desc *gdp;
diff --git a/ext2fs/bitmap.c b/ext2fs/bitmap.c
index 9285023..c6d882b 100644
--- a/ext2fs/bitmap.c
+++ b/ext2fs/bitmap.c
@@ -32,7 +32,7 @@
 static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
 
 static inline
-unsigned long count_free (char * map, unsigned int numchars)
+unsigned long count_free (unsigned char *map, unsigned int numchars)
 {
        unsigned int i;
        unsigned long sum = 0;
diff --git a/ext2fs/dir.c b/ext2fs/dir.c
index 6cdfba2..bc375c3 100644
--- a/ext2fs/dir.c
+++ b/ext2fs/dir.c
@@ -413,7 +413,7 @@ dirscanblock (vm_address_t blockaddr, struct node *dp, int 
idx,
          || EXT2_DIR_REC_LEN (entry->name_len) > entry->rec_len
          || memchr (entry->name, '\0', entry->name_len))
        {
-         ext2_warning ("bad directory entry: inode: %Ld offset: %zd",
+         ext2_warning ("bad directory entry: inode: %Ld offset: %lu",
                        dp->cache_id,
                        currentoff - blockaddr + idx * DIRBLKSIZ);
          return ENOENT;
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 42717c5..070d5bd 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -116,14 +116,14 @@ void pokel_inherit (struct pokel *pokel, struct pokel 
*from);
 
 #include <stdint.h>
 
-extern int test_bit (unsigned num, char *bitmap);
+extern int test_bit (unsigned num, unsigned char *bitmap);
 
-extern int set_bit (unsigned num, char *bitmap);
+extern int set_bit (unsigned num, unsigned char *bitmap);
 
 #if defined(__USE_EXTERN_INLINES) || defined(EXT2FS_DEFINE_EI)
 /* Returns TRUE if bit NUM is set in BITMAP.  */
 EXT2FS_EI int
-test_bit (unsigned num, char *bitmap)
+test_bit (unsigned num, unsigned char *bitmap)
 {
   const uint32_t *const bw = (uint32_t *) bitmap + (num >> 5);
   const uint_fast32_t mask = 1 << (num & 31);
@@ -133,7 +133,7 @@ test_bit (unsigned num, char *bitmap)
 /* Sets bit NUM in BITMAP, and returns the previous state of the bit.  Unlike
    the linux version, this function is NOT atomic!  */
 EXT2FS_EI int
-set_bit (unsigned num, char *bitmap)
+set_bit (unsigned num, unsigned char *bitmap)
 {
   uint32_t *const bw = (uint32_t *) bitmap + (num >> 5);
   const uint_fast32_t mask = 1 << (num & 31);
@@ -143,7 +143,7 @@ set_bit (unsigned num, char *bitmap)
 /* Clears bit NUM in BITMAP, and returns the previous state of the bit.
    Unlike the linux version, this function is NOT atomic!  */
 EXT2FS_EI int
-clear_bit (unsigned num, char *bitmap)
+clear_bit (unsigned num, unsigned char *bitmap)
 {
   uint32_t *const bw = (uint32_t *) bitmap + (num >> 5);
   const uint_fast32_t mask = 1 << (num & 31);
@@ -244,7 +244,7 @@ extern int disk_cache_blocks;
 
 #define DC_NO_BLOCK    ((block_t) -1L)
 
-#ifndef NDEBUG
+#ifdef DEBUG_DISK_CACHE
 #define DISK_CACHE_LAST_READ_XOR       0xDEADBEEF
 #endif
 
@@ -254,7 +254,8 @@ struct disk_cache_info
   block_t block;
   uint16_t flags;
   uint16_t ref_count;
-#ifndef NDEBUG
+  struct disk_cache_info *next;        /* List of reusable entries.  */
+#ifdef DEBUG_DISK_CACHE
   block_t last_read, last_read_xor;
 #endif
 };
@@ -436,7 +437,7 @@ struct pokel global_pokel;
 /* If the block size is less than the page size, then this bitmap is used to
    record which disk blocks are actually modified, so we don't stomp on parts
    of the disk which are backed by file pagers.  */
-char *modified_global_blocks;
+unsigned char *modified_global_blocks;
 pthread_spinlock_t modified_global_blocks_lock;
 
 extern int global_block_modified (block_t block);
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c
index 5f288bf..91d9d12 100644
--- a/ext2fs/hyper.c
+++ b/ext2fs/hyper.c
@@ -24,7 +24,7 @@
 #include "ext2fs.h"
 
 vm_address_t zeroblock;
-char *modified_global_blocks;
+unsigned char *modified_global_blocks;
 
 static void
 allocate_mod_map (void)
diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c
index 7cfc4f3..2809371 100644
--- a/ext2fs/ialloc.c
+++ b/ext2fs/ialloc.c
@@ -52,7 +52,7 @@
 void
 diskfs_free_node (struct node *np, mode_t old_mode)
 {
-  char *bh;
+  unsigned char *bh;
   unsigned long block_group;
   unsigned long bit;
   struct ext2_group_desc *gdp;
@@ -114,7 +114,7 @@ diskfs_free_node (struct node *np, mode_t old_mode)
 ino_t
 ext2_alloc_inode (ino_t dir_inum, mode_t mode)
 {
-  char *bh = NULL;
+  unsigned char *bh = NULL;
   int i, j, avefreei;
   ino_t inum;
   struct ext2_group_desc *gdp;
@@ -225,7 +225,7 @@ repeat:
     {
       if (set_bit (inum, bh))
        {
-         ext2_warning ("bit already set for inode %d", inum);
+         ext2_warning ("bit already set for inode %llu", inum);
          disk_cache_block_deref (bh);
          bh = NULL;
          goto repeat;
@@ -250,7 +250,7 @@ repeat:
   if (inum < EXT2_FIRST_INO (sblock) || inum > sblock->s_inodes_count)
     {
       ext2_error ("reserved inode or inode > inodes count - "
-                 "block_group = %d,inode=%d", i, inum);
+                 "block_group = %d,inode=%llu", i, inum);
       inum = 0;
       goto sync_out;
     }
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index 3e080f8..458b822 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -433,7 +433,7 @@ disk_pager_read_page (vm_offset_t page, void **buf, int 
*writelock)
     + offset % block_size;
   disk_cache_info[index].flags |= DC_INCORE;
   disk_cache_info[index].flags &=~ DC_UNTOUCHED;
-#ifndef NDEBUG
+#ifdef DEBUG_DISK_CACHE
   disk_cache_info[index].last_read = disk_cache_info[index].block;
   disk_cache_info[index].last_read_xor
     = disk_cache_info[index].block ^ DISK_CACHE_LAST_READ_XOR;
@@ -469,7 +469,7 @@ disk_pager_write_page (vm_offset_t page, void *buf)
   assert (disk_cache_info[index].block != DC_NO_BLOCK);
   offset = ((store_offset_t) disk_cache_info[index].block << log2_block_size)
     + offset % block_size;
-#ifndef NDEBUG                 /* Not strictly needed.  */
+#ifdef DEBUG_DISK_CACHE                        /* Not strictly needed.  */
   assert ((disk_cache_info[index].last_read ^ DISK_CACHE_LAST_READ_XOR)
          == disk_cache_info[index].last_read_xor);
   assert (disk_cache_info[index].last_read
@@ -636,7 +636,7 @@ pager_unlock_page (struct user_pager_info *pager, 
vm_offset_t page)
       if (err == ENOSPC)
        ext2_warning ("This filesystem is out of space, and will now crash.  
Bye!");
       else if (err)
-       ext2_warning ("inode=%Ld, page=0x%zx: %s",
+       ext2_warning ("inode=%Ld, page=0x%lx: %s",
                      node->cache_id, page, strerror (err));
 
       return err;
@@ -840,13 +840,50 @@ int disk_cache_blocks;
 hurd_ihash_t disk_cache_bptr;
 /* Cached blocks' info.  */
 struct disk_cache_info *disk_cache_info;
-/* Hint index for which cache block to reuse next.  */
-int disk_cache_hint;
 /* Lock for these structures.  */
 pthread_mutex_t disk_cache_lock;
 /* Fired when a re-association is done.  */
 pthread_cond_t disk_cache_reassociation;
 
+/* Linked list of potentially unused blocks. */
+static struct disk_cache_info *disk_cache_info_free;
+static pthread_mutex_t disk_cache_info_free_lock;
+
+/* Get a reusable entry.  Must be called with disk_cache_lock
+   held.  */
+static struct disk_cache_info *
+disk_cache_info_free_pop (void)
+{
+  struct disk_cache_info *p;
+
+  do
+    {
+      pthread_mutex_lock (&disk_cache_info_free_lock);
+      p = disk_cache_info_free;
+      if (p)
+       {
+         disk_cache_info_free = p->next;
+         p->next = NULL;
+       }
+      pthread_mutex_unlock (&disk_cache_info_free_lock);
+    }
+  while (p && (p->flags & DC_DONT_REUSE || p->ref_count > 0));
+  return p;
+}
+
+/* Add P to the list of potentially re-usable entries.  */
+static void
+disk_cache_info_free_push (struct disk_cache_info *p)
+{
+  pthread_mutex_lock (&disk_cache_info_free_lock);
+  if (! p->next)
+    {
+      p->next = disk_cache_info_free;
+      disk_cache_info_free = p;
+    }
+  pthread_mutex_unlock (&disk_cache_info_free_lock);
+}
+
 /* Finish mapping initialization. */
 static void
 disk_cache_init (void)
@@ -857,6 +894,7 @@ disk_cache_init (void)
 
   pthread_mutex_init (&disk_cache_lock, NULL);
   pthread_cond_init (&disk_cache_reassociation, NULL);
+  pthread_mutex_init (&disk_cache_info_free_lock, NULL);
 
   /* Allocate space for block num -> in-memory pointer mapping.  */
   if (hurd_ihash_create (&disk_cache_bptr, HURD_IHASH_NO_LOCP))
@@ -867,19 +905,22 @@ disk_cache_init (void)
   if (!disk_cache_info)
     ext2_panic ("Cannot allocate space for disk cache info");
 
-  /* Initialize disk_cache_info.  */
-  for (int i = 0; i < disk_cache_blocks; i++)
+  /* Initialize disk_cache_info.  Start with the last entry so that
+     the first ends up at the front of the free list.  This keeps the
+     assertions at the end of this function happy.  */
+  for (int i = disk_cache_blocks; i >= 0; i--)
     {
       disk_cache_info[i].block = DC_NO_BLOCK;
       disk_cache_info[i].flags = 0;
       disk_cache_info[i].ref_count = 0;
-#ifndef NDEBUG
+      disk_cache_info[i].next = NULL;
+      disk_cache_info_free_push (&disk_cache_info[i]);
+#ifdef DEBUG_DISK_CACHE
       disk_cache_info[i].last_read = DC_NO_BLOCK;
       disk_cache_info[i].last_read_xor
        = DC_NO_BLOCK ^ DISK_CACHE_LAST_READ_XOR;
 #endif
     }
-  disk_cache_hint = 0;
 
   /* Map the superblock and the block group descriptors.  */
   block_t fixed_first = boffs_block (SBLOCK_OFFS);
@@ -947,7 +988,7 @@ disk_cache_return_unused (void)
                       1);
   else
     {
-      printf ("ext2fs: disk cache is starving\n");
+      ext2_debug ("ext2fs: disk cache is starving\n");
 
       /* Give it some time.  This should happen rarely.  */
       sleep (1);
@@ -958,8 +999,10 @@ disk_cache_return_unused (void)
 void *
 disk_cache_block_ref (block_t block)
 {
+  struct disk_cache_info *info;
   int index;
   void *bptr;
+  hurd_ihash_locp_t slot;
 
   assert (block < store->size >> log2_block_size);
 
@@ -968,7 +1011,7 @@ disk_cache_block_ref (block_t block)
 retry_ref:
   pthread_mutex_lock (&disk_cache_lock);
 
-  bptr = hurd_ihash_find (disk_cache_bptr, block);
+  bptr = hurd_ihash_locp_find (disk_cache_bptr, block, &slot);
   if (bptr)
     /* Already mapped.  */
     {
@@ -1004,34 +1047,10 @@ retry_ref:
     }
 
   /* Search for a block that is not in core and is not referenced.  */
-  index = disk_cache_hint;
-  while ((disk_cache_info[index].flags & DC_DONT_REUSE)
-        || (disk_cache_info[index].ref_count))
-    {
-      ext2_debug ("reject %u -> %d (ref_count = %hu, flags = %#hx)",
-                 disk_cache_info[index].block, index,
-                 disk_cache_info[index].ref_count,
-                 disk_cache_info[index].flags);
-
-      /* Just move to next block.  */
-      index++;
-      if (index >= disk_cache_blocks)
-       index -= disk_cache_blocks;
-
-      /* If we return to where we started, than there is no suitable
-        block. */
-      if (index == disk_cache_hint)
-       break;
-    }
-
-  /* The next place in the disk cache becomes the current hint.  */
-  disk_cache_hint = index + 1;
-  if (disk_cache_hint >= disk_cache_blocks)
-    disk_cache_hint -= disk_cache_blocks;
+  info = disk_cache_info_free_pop ();
 
   /* Is suitable place found?  */
-  if ((disk_cache_info[index].flags & DC_DONT_REUSE)
-      || disk_cache_info[index].ref_count)
+  if (info == NULL)
     /* No place is found.  Try to release some blocks and try
        again.  */
     {
@@ -1045,6 +1064,7 @@ retry_ref:
     }
 
   /* Suitable place is found.  */
+  index = info - disk_cache_info;
 
   /* Calculate pointer to data.  */
   bptr = (char *)disk_cache + (index << log2_block_size);
@@ -1091,12 +1111,13 @@ retry_ref:
 #endif
 
   /* Re-associate.  */
+
+  /* New association.  */
+  if (hurd_ihash_locp_add (disk_cache_bptr, slot, block, bptr))
+    ext2_panic ("Couldn't hurd_ihash_locp_add new disk block");
   if (disk_cache_info[index].block != DC_NO_BLOCK)
     /* Remove old association.  */
     hurd_ihash_remove (disk_cache_bptr, disk_cache_info[index].block);
-  /* New association.  */
-  if (hurd_ihash_add (disk_cache_bptr, block, bptr))
-    ext2_panic ("Couldn't hurd_ihash_add new disk block");
   assert (! (disk_cache_info[index].flags & DC_DONT_REUSE & ~DC_UNTOUCHED));
   disk_cache_info[index].block = block;
   assert (! disk_cache_info[index].ref_count);
@@ -1175,6 +1196,8 @@ disk_cache_block_deref (void *ptr)
   assert (! (disk_cache_info[index].flags & DC_UNTOUCHED));
   assert (disk_cache_info[index].ref_count >= 1);
   disk_cache_info[index].ref_count--;
+  if (disk_cache_info[index].ref_count == 0)
+    disk_cache_info_free_push (&disk_cache_info[index]);
   pthread_mutex_unlock (&disk_cache_lock);
 }
 
@@ -1200,8 +1223,6 @@ disk_cache_block_is_ref (block_t block)
 void
 create_disk_pager (void)
 {
-  pthread_t thread;
-  pthread_attr_t attr;
   error_t err;
 
   /* The disk pager.  */
diff --git a/fatfs/Makefile b/fatfs/Makefile
index 6224b64..ee8cd83 100644
--- a/fatfs/Makefile
+++ b/fatfs/Makefile
@@ -23,7 +23,7 @@ SRCS = inode.c main.c dir.c pager.c fat.c virt-inode.c 
node-create.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = diskfs iohelp fshelp store pager ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
+LDLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
 
 include ../Makeconf
 
diff --git a/fatfs/dir.c b/fatfs/dir.c
index 66c95d2..b9b7ae5 100644
--- a/fatfs/dir.c
+++ b/fatfs/dir.c
@@ -497,13 +497,14 @@ dirscanblock (vm_address_t blockaddr, struct node *dp, 
int idx,
               component.  */
            continue;
          
-         if (fatnamematch (entry->name, name, namelen))
+         if (fatnamematch ((const char *) entry->name, name, namelen))
            break;
        }
 
       if (consider_compress
-         && (ds->type == LOOKING
-             || (ds->type == COMPRESS && ds->nbytes > nbytes)))
+         && ((enum slot_status) ds->type == LOOKING
+             || ((enum slot_status) ds->type == COMPRESS &&
+                  ds->nbytes > nbytes)))
        {
          ds->type = CREATE;
          ds->stat = COMPRESS;
@@ -934,7 +935,7 @@ diskfs_get_directs (struct node *dp,
 
       /* See if there's room to hold this one.  */
       
-      fat_to_unix_filename(ep->name, name);
+      fat_to_unix_filename ((const char *) ep->name, name);
       namlen = strlen(name);
 
       /* Perhaps downcase it?  */
diff --git a/fatfs/fat.c b/fatfs/fat.c
index 14926ff..4c98f62 100644
--- a/fatfs/fat.c
+++ b/fatfs/fat.c
@@ -69,7 +69,7 @@ void
 fat_read_sblock (void)
 {
   error_t err;
-  int read;
+  size_t read;
 
   sblock = malloc (sizeof (struct boot_sector));
   err = store_read (store, 0, sizeof (struct boot_sector),
@@ -706,7 +706,7 @@ fat_from_unix_filename(char *fn, const char *un, int ul)
 
 /* Return Epoch-based time from a MSDOS time/date pair.  */
 void
-fat_to_epoch (char *date, char *time, struct timespec *ts)
+fat_to_epoch (unsigned char *date, unsigned char *time, struct timespec *ts)
 {
   struct tm tm;
 
@@ -735,7 +735,7 @@ fat_to_epoch (char *date, char *time, struct timespec *ts)
 
 /* Return MSDOS time/date pair from Epoch-based time.  */
 void
-fat_from_epoch (char *date, char *time, time_t *tp)
+fat_from_epoch (unsigned char *date, unsigned char *time, time_t *tp)
 {
   struct tm *tm;
 
diff --git a/fatfs/fat.h b/fatfs/fat.h
index eac7015..d4a509e 100644
--- a/fatfs/fat.h
+++ b/fatfs/fat.h
@@ -318,8 +318,8 @@ struct cluster_chain
 
 /* Prototyping.  */
 void fat_read_sblock (void);
-void fat_to_epoch (char *, char *, struct timespec *);
-void fat_from_epoch (char *, char *, time_t *);
+void fat_to_epoch (unsigned char *, unsigned char *, struct timespec *);
+void fat_from_epoch (unsigned char *, unsigned char *, time_t *);
 error_t fat_getcluster (struct node *, cluster_t, int, cluster_t *);
 void fat_truncate_node (struct node *, cluster_t);
 error_t fat_extend_chain (struct node *, cluster_t, int);
diff --git a/fatfs/inode.c b/fatfs/inode.c
index 610f357..4f28d14 100644
--- a/fatfs/inode.c
+++ b/fatfs/inode.c
@@ -22,6 +22,7 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
 
 #include <string.h>
+#include <error.h>
 #include "fatfs.h"
 #include "libdiskfs/fs_S.h"
 
@@ -73,7 +74,6 @@ diskfs_user_make_node (struct node **npp, struct 
lookup_context *ctx)
 error_t
 diskfs_cached_lookup_in_dirbuf (int inum, struct node **npp, vm_address_t buf)
 {
-  error_t err;
   struct lookup_context ctx = { buf: buf, inode: vi_lookup (inum) };
   return diskfs_cached_lookup_context (inum, npp, &ctx);
 }
@@ -165,7 +165,7 @@ diskfs_user_read_node (struct node *np, struct 
lookup_context *ctx)
      allocated node that has no directory entry yet, only set a
      minimal amount of data until the dirent is created (and we get
      called a second time?).  */
-  if (vk.dir_inode == 0 && vk.dir_offset == (void *) 2)
+  if (vk.dir_inode == 0 && vk.dir_offset == 2)
     return 0;
 
   if (vk.dir_inode == 0)
@@ -363,6 +363,11 @@ write_node (struct node *np)
       err = vm_map (mach_task_self (),
                    &buf, buflen, 0, 1, memobj, 0, 0, prot, prot, 0);
       mach_port_deallocate (mach_task_self (), memobj);
+      if (err)
+        {
+          pthread_mutex_unlock (&dp->lock);
+          error (1, err, "Could not map memory");
+        }
 
       dr = (struct dirrect *) (buf + vk.dir_offset);
 
diff --git a/fatfs/pager.c b/fatfs/pager.c
index d255f29..84376bd 100644
--- a/fatfs/pager.c
+++ b/fatfs/pager.c
@@ -764,8 +764,6 @@ pager_dropweak (struct user_pager_info *p __attribute__ 
((unused)))
 void
 create_fat_pager (void)
 {
-  pthread_t thread;
-  pthread_attr_t attr;
   error_t err;
 
   /* The disk pager.  */
diff --git a/fstests/fstests.c b/fstests/fstests.c
index c652a70..c71b13a 100644
--- a/fstests/fstests.c
+++ b/fstests/fstests.c
@@ -42,8 +42,8 @@ int check_refs (mach_port_t port) /* To call from gdb */
 int
 main ()
 {
-  mach_port_t root;
 #if HURDISH_TESTS
+  mach_port_t root;
   extern file_t *_hurd_init_dtable;
   char string[] = "Did this get into the file?\n";
   file_t filetowrite;
@@ -53,7 +53,11 @@ main ()
   error_t err;
 #endif
 
+#ifdef HURDISH_TESTS
   root = getcrdir ();
+#else
+  (void) getcrdir ();
+#endif
 
   printf ("fstests running...\n");
 
diff --git a/ftpfs/Makefile b/ftpfs/Makefile
index 7039890..ec8a673 100644
--- a/ftpfs/Makefile
+++ b/ftpfs/Makefile
@@ -25,6 +25,6 @@ SRCS = ftpfs.c fs.c host.c netfs.c dir.c conn.c ccache.c 
node.c ncache.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = netfs fshelp iohelp ports ihash ftpconn shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/hostmux/Makefile b/hostmux/Makefile
index 939a9f6..4776ac9 100644
--- a/hostmux/Makefile
+++ b/hostmux/Makefile
@@ -25,6 +25,6 @@ SRCS = hostmux.c mux.c leaf.c node.c stubs.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = netfs fshelp iohelp ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/hurd/console.h b/hurd/console.h
index 05177eb..f037493 100644
--- a/hurd/console.h
+++ b/hurd/console.h
@@ -20,6 +20,7 @@
 #define _HURD_CONSOLE_H
 
 #include <stdint.h>
+#include <string.h>
 #include <wchar.h>
 
 typedef enum
@@ -51,6 +52,12 @@ typedef struct
   uint32_t bold : 1;
 } conchar_attr_t; 
 
+static inline int
+conchar_attr_equal (conchar_attr_t *c1, conchar_attr_t *c2)
+{
+  return !memcmp (c1, c2, sizeof (conchar_attr_t));
+}
+
 /* We support double-width characters by using an extra bit to identify the
    continuation in the character matrix.  The constants below document our
    usage of wchar_t.  */
diff --git a/include/sys/procfs.h b/include/sys/procfs.h
index ec82308..09d2030 100644
--- a/include/sys/procfs.h
+++ b/include/sys/procfs.h
@@ -63,8 +63,8 @@ struct elf_psinfo
   char pr_psargs[ELF_PRARGSZ]; /* Initial part of argument list.  */
   int pr_wstat;                        /* Zombie exit status (not really 
used).  */
   int pr_argc;                 /* The argument count at startup.  */
-  uintptr_t pr_argv;           /* Original argument vector address.  */
-  uintptr_t pr_envp;           /* Original environment vector address.  */
+  vm_address_t pr_argv;                /* Original argument vector address.  */
+  vm_address_t pr_envp;                /* Original environment vector address. 
 */
 };
 typedef struct elf_psinfo psinfo_t;
 
diff --git a/isofs/Makefile b/isofs/Makefile
index 6475c52..25ac09a 100644
--- a/isofs/Makefile
+++ b/isofs/Makefile
@@ -22,7 +22,7 @@ SRCS = inode.c main.c lookup.c pager.c rr.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = diskfs iohelp fshelp store pager ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
+LDLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
 
 include ../Makeconf
 
diff --git a/isofs/rr.c b/isofs/rr.c
index adc95c3..59205da 100644
--- a/isofs/rr.c
+++ b/isofs/rr.c
@@ -84,7 +84,7 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
     {
       struct dirrect *p;
       off_t filestart;
-      char *c;
+      unsigned char *c;
       error_t err;
 
       /* Look at the first directory entry in root. */
diff --git a/isofs/rr.h b/isofs/rr.h
index ab80e4b..59838eb 100644
--- a/isofs/rr.h
+++ b/isofs/rr.h
@@ -99,9 +99,9 @@ struct su_header
 /* The body of a CE (Continuation Area) field */
 struct su_ce
 {
-  char continuation[8];
-  char offset[8];
-  char size[8];
+  unsigned char continuation[8];
+  unsigned char offset[8];
+  unsigned char size[8];
 };
 
 /* The body of a SP (Sharing Protocol Indicator) field */
@@ -142,17 +142,17 @@ struct su_er
 /* The body of a PX (Posix Attributes) field. */
 struct rr_px
 {
-  char mode[8];
-  char nlink[8];
-  char uid[8];
-  char gid[8];
+  unsigned char mode[8];
+  unsigned char nlink[8];
+  unsigned char uid[8];
+  unsigned char gid[8];
 };
 
 /* The body of a PN (Posix Device Node) field. */
 struct rr_pn
 {
-  char high[8];
-  char low[8];
+  unsigned char high[8];
+  unsigned char low[8];
 };
 
 /* The body of a SL (Symbolic Link) field. */
@@ -188,13 +188,13 @@ struct rr_nm
 /* The body of a CL (Child Directory Location) field. */
 struct rr_cl
 {
-  char loc[8];
+  unsigned char loc[8];
 };
 
 /* The body of a PL (Parent Directory Location) field. */
 struct rr_pl
 {
-  char loc[8];
+  unsigned char loc[8];
 };
 
 /* The body of a TF (Time Stamp) field. */
@@ -234,7 +234,7 @@ struct rr_sf
 /* AU -- author (version 1) */
 struct gn_au
 {
-  char author[8];
+  unsigned char author[8];
 };
 
 /* TR -- translator (version 1) */
@@ -247,13 +247,13 @@ struct gn_tr
 /* MD -- full mode (version 1) */
 struct gn_md
 {
-  char mode[8];
+  unsigned char mode[8];
 };
 
 /* FL -- flags (version 1) */
 struct gn_fl
 {
-  char flags[8];
+  unsigned char flags[8];
 };
 
 
diff --git a/libdde-linux26/contrib/include/linux/ioctl.h 
b/libdde-linux26/contrib/include/linux/ioctl.h
index aa91eb3..7e55c36 100644
--- a/libdde-linux26/contrib/include/linux/ioctl.h
+++ b/libdde-linux26/contrib/include/linux/ioctl.h
@@ -4,4 +4,3 @@
 #include <asm/ioctl.h>
 
 #endif /* _LINUX_IOCTL_H */
-
diff --git a/libdde-linux26/lib/src/kernel/timeconst.pl 
b/libdde-linux26/lib/src/kernel/timeconst.pl
index d459895..664d667 100755
--- a/libdde-linux26/lib/src/kernel/timeconst.pl
+++ b/libdde-linux26/lib/src/kernel/timeconst.pl
@@ -370,7 +370,7 @@ if ($hz eq '--can') {
        }
 
        @val = @{$canned_values{$hz}};
-       if (!defined(@val)) {
+       if (address@hidden) {
                @val = compute_values($hz);
        }
        output($hz, @val);
diff --git a/libdiskfs/Makefile b/libdiskfs/Makefile
index 47b9339..803761d 100644
--- a/libdiskfs/Makefile
+++ b/libdiskfs/Makefile
@@ -61,7 +61,7 @@ MIGSTUBS = fsServer.o ioServer.o fsysServer.o 
exec_startupServer.o \
        startup_notifyServer.o
 OBJS = $(sort $(SRCS:.c=.o) $(MIGSTUBS))
 
-HURDLIBS = fshelp iohelp store ports shouldbeinlibc pager
+HURDLIBS = fshelp iohelp store ports shouldbeinlibc pager ihash
 LDLIBS += -lpthread
 
 fsys-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h -DREPLY_PORTS
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index 731d8c6..60bf33d 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -228,8 +228,8 @@ diskfs_start_bootstrap ()
     }
 
  lookup_init:
-  err = dir_lookup (root_pt, initname, O_READ, 0,
-                   &retry, pathbuf, &startup_pt);
+  err = dir_lookup (root_pt, (char *) initname, O_READ, 0, &retry, pathbuf,
+                    &startup_pt);
   init_lookups++;
   if (err)
     {
diff --git a/libdiskfs/dir-chg.c b/libdiskfs/dir-chg.c
index ed8f40c..0657c45 100644
--- a/libdiskfs/dir-chg.c
+++ b/libdiskfs/dir-chg.c
@@ -68,7 +68,7 @@ diskfs_notice_dirchange (struct node *dp, enum 
dir_changed_type type,
   while (*preq)
     {
       struct modreq *req = *preq;
-      err = dir_changed (req->port, dp->dirmod_tick, type, name);
+      err = dir_changed (req->port, dp->dirmod_tick, type, (char *) name);
       if (err && err != MACH_SEND_TIMED_OUT)
        {
          /* Remove notify port.  */
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index 75df9b8..8b986e4 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -161,7 +161,9 @@ diskfs_S_dir_lookup (struct protid *dircred,
                  *retry = FS_RETRY_REAUTH;
                  *returned_port = dircred->po->shadow_root_parent;
                  *returned_port_poly = MACH_MSG_TYPE_COPY_SEND;
-                 if (! lastcomp)
+                 if (lastcomp && mustbedir) /* Trailing slash.  */
+                   strcpy (retryname, "/");
+                 else if (!lastcomp)
                    strcpy (retryname, nextname);
                  err = 0;
                  goto out;
@@ -175,7 +177,9 @@ diskfs_S_dir_lookup (struct protid *dircred,
              *retry = FS_RETRY_REAUTH;
              *returned_port = dircred->po->root_parent;
              *returned_port_poly = MACH_MSG_TYPE_COPY_SEND;
-             if (!lastcomp)
+             if (lastcomp && mustbedir) /* Trailing slash.  */
+               strcpy (retryname, "/");
+             else if (!lastcomp)
                strcpy (retryname, nextname);
              err = 0;
              goto out;
@@ -213,7 +217,7 @@ diskfs_S_dir_lookup (struct protid *dircred,
 
       /* If this is translated, start the translator (if necessary)
         and return.  */
-      if ((((flags & O_NOTRANS) == 0) || !lastcomp)
+      if ((((flags & O_NOTRANS) == 0) || !lastcomp || mustbedir)
          && ((np->dn_stat.st_mode & S_IPTRANS)
              || S_ISFIFO (np->dn_stat.st_mode)
              || S_ISCHR (np->dn_stat.st_mode)
@@ -304,11 +308,16 @@ diskfs_S_dir_lookup (struct protid *dircred,
          if (err != ENOENT)
            {
              *returned_port_poly = MACH_MSG_TYPE_MOVE_SEND;
-             if (!lastcomp && !err)
+             if (!err)
                {
                  char *end = strchr (retryname, '\0');
-                 *end++ = '/';
-                 strcpy (end, nextname);
+                 if (mustbedir)
+                   *end++ = '/'; /* Trailing slash.  */
+                 else if (!lastcomp) {
+                   if (end != retryname)
+                     *end++ = '/';
+                   strcpy (end, nextname);
+                 }
                }
 
              if (register_translator)
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index 11fb0ad..106aeb0 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -25,6 +25,7 @@
 #include <pthread.h>
 #include <hurd/ports.h>
 #include <hurd/fshelp.h>
+#include <hurd/ihash.h>
 #include <hurd/iohelp.h>
 #include <idvec.h>
 #include <features.h>
@@ -80,8 +81,8 @@ struct peropen
    filesystem.  */
 struct node
 {
-  /* Links on hash list. */
-  struct node *hnext, **hprevp;
+  /* The slot we occupy in the node cache.  */
+  hurd_ihash_locp_t slot;
 
   struct disknode *dn;
 
diff --git a/libdiskfs/name-cache.c b/libdiskfs/name-cache.c
index e9fe27e..53935ab 100644
--- a/libdiskfs/name-cache.c
+++ b/libdiskfs/name-cache.c
@@ -21,6 +21,7 @@
 
 #include "priv.h"
 #include <assert.h>
+#include <hurd/ihash.h>
 #include <string.h>
 
 /* The name cache is implemented using a hash table.
@@ -118,90 +119,6 @@ valid_entry (struct cache_bucket *b, int i)
   return b->name[i] != 0;
 }
 
-/* This is the Murmur3 hash algorithm.  */
-
-#define FORCE_INLINE inline __attribute__((always_inline))
-
-inline uint32_t rotl32 ( uint32_t x, int8_t r )
-{
-  return (x << r) | (x >> (32 - r));
-}
-
-#define ROTL32(x,y)     rotl32(x,y)
-
-/* Block read - if your platform needs to do endian-swapping or can
-   only handle aligned reads, do the conversion here.  */
-
-FORCE_INLINE uint32_t getblock32 ( const uint32_t * p, int i )
-{
-  return p[i];
-}
-
-/* Finalization mix - force all bits of a hash block to avalanche.  */
-
-FORCE_INLINE uint32_t fmix32 ( uint32_t h )
-{
-  h ^= h >> 16;
-  h *= 0x85ebca6b;
-  h ^= h >> 13;
-  h *= 0xc2b2ae35;
-  h ^= h >> 16;
-
-  return h;
-}
-
-/* The Murmur3 hash function.  */
-void MurmurHash3_x86_32 ( const void * key, int len,
-                          uint32_t seed, void * out )
-{
-  const uint8_t * data = (const uint8_t*)key;
-  const int nblocks = len / 4;
-
-  uint32_t h1 = seed;
-
-  const uint32_t c1 = 0xcc9e2d51;
-  const uint32_t c2 = 0x1b873593;
-
-  /* body */
-
-  const uint32_t * blocks = (const uint32_t *)(data + nblocks*4);
-
-  for(int i = -nblocks; i; i++)
-  {
-    uint32_t k1 = getblock32(blocks,i);
-
-    k1 *= c1;
-    k1 = ROTL32(k1,15);
-    k1 *= c2;
-
-    h1 ^= k1;
-    h1 = ROTL32(h1,13);
-    h1 = h1*5+0xe6546b64;
-  }
-
-  /* tail */
-
-  const uint8_t * tail = (const uint8_t*)(data + nblocks*4);
-
-  uint32_t k1 = 0;
-
-  switch(len & 3)
-  {
-  case 3: k1 ^= tail[2] << 16;
-  case 2: k1 ^= tail[1] << 8;
-  case 1: k1 ^= tail[0];
-          k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
-  };
-
-  /* finalization */
-
-  h1 ^= len;
-
-  h1 = fmix32(h1);
-
-  *(uint32_t*)out = h1;
-}
-
 /* If there is no best candidate to replace, pick any.  We approximate
    any by picking the slot depicted by REPLACE, and increment REPLACE
    then.  */
@@ -259,8 +176,8 @@ static inline unsigned long
 hash (ino64_t dir_cache_id, const char *name)
 {
   unsigned long h;
-  MurmurHash3_x86_32 (&dir_cache_id, sizeof dir_cache_id, 0, &h);
-  MurmurHash3_x86_32 (name, strlen (name), h, &h);
+  h = hurd_ihash_hash32 (&dir_cache_id, sizeof dir_cache_id, 0);
+  h = hurd_ihash_hash32 (name, strlen (name), h);
   return h;
 }
 
diff --git a/libdiskfs/node-cache.c b/libdiskfs/node-cache.c
index a76474a..ee7e6fd 100644
--- a/libdiskfs/node-cache.c
+++ b/libdiskfs/node-cache.c
@@ -17,46 +17,49 @@
    You should have received a copy of the GNU General Public License
    along with the GNU Hurd.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include "priv.h"
-
-#define        INOHSZ  8192
-#if    ((INOHSZ&(INOHSZ-1)) == 0)
-#define        INOHASH(ino)    ((ino)&(INOHSZ-1))
-#else
-#define        INOHASH(ino)    (((unsigned)(ino))%INOHSZ)
-#endif
+#include <hurd/ihash.h>
 
-/* The nodehash is a cache of nodes.
+#include "priv.h"
 
-   Access to nodehash and nodehash_nr_items is protected by
-   nodecache_lock.
+/* The node cache is implemented using a hash table.  Access to the
+   cache is protected by nodecache_lock.
 
-   Every node in the nodehash carries a light reference.  When we are
+   Every node in the cache carries a light reference.  When we are
    asked to give up that light reference, we reacquire our lock
    momentarily to check whether someone else reacquired a reference
-   through the nodehash.  */
-static struct node *nodehash[INOHSZ];
-static size_t nodehash_nr_items;
-static pthread_rwlock_t nodecache_lock = PTHREAD_RWLOCK_INITIALIZER;
+   through the cache.  */
+
+/* The size of ino_t is larger than hurd_ihash_key_t on 32 bit
+   platforms.  We therefore have to use libihashs generalized key
+   interface.  */
+
+/* This is the mix function of fasthash, see
+   https://code.google.com/p/fast-hash/ for reference.  */
+#define mix_fasthash(h) ({              \
+        (h) ^= (h) >> 23;               \
+        (h) *= 0x2127599bf4325c37ULL;   \
+        (h) ^= (h) >> 47; })
 
-/* Initialize the inode hash table. */
-static void __attribute__ ((constructor))
-nodecache_init ()
+static hurd_ihash_key_t
+hash (const void *key)
 {
+  ino_t i;
+  i = *(ino_t *) key;
+  mix_fasthash (i);
+  return (hurd_ihash_key_t) i;
 }
 
-/* Lookup node with inode number INUM.  Returns NULL if the node is
-   not found in the node cache.  */
-static struct node *
-lookup (ino_t inum)
+static int
+compare (const void *a, const void *b)
 {
-  struct node *np;
-  for (np = nodehash[INOHASH(inum)]; np; np = np->hnext)
-    if (np->cache_id == inum)
-      return np;
-  return NULL;
+  return *(ino_t *) a == *(ino_t *) b;
 }
 
+static struct hurd_ihash nodecache =
+  HURD_IHASH_INITIALIZER_GKI (offsetof (struct node, slot), NULL, NULL,
+                              hash, compare);
+static pthread_rwlock_t nodecache_lock = PTHREAD_RWLOCK_INITIALIZER;
+
 /* Fetch inode INUM, set *NPP to the node structure;
    gain one user reference and lock the node.  */
 error_t __attribute__ ((weak))
@@ -73,9 +76,10 @@ diskfs_cached_lookup_context (ino_t inum, struct node **npp,
 {
   error_t err;
   struct node *np, *tmp;
+  hurd_ihash_locp_t slot;
 
   pthread_rwlock_rdlock (&nodecache_lock);
-  np = lookup (inum);
+  np = hurd_ihash_locp_find (&nodecache, (hurd_ihash_key_t) &inum, &slot);
   if (np)
     goto gotit;
   pthread_rwlock_unlock (&nodecache_lock);
@@ -89,7 +93,8 @@ diskfs_cached_lookup_context (ino_t inum, struct node **npp,
 
   /* Put NP in NODEHASH.  */
   pthread_rwlock_wrlock (&nodecache_lock);
-  tmp = lookup (inum);
+  tmp = hurd_ihash_locp_find (&nodecache, (hurd_ihash_key_t) &np->cache_id,
+                             &slot);
   if (tmp)
     {
       /* We lost a race.  */
@@ -98,13 +103,10 @@ diskfs_cached_lookup_context (ino_t inum, struct node 
**npp,
       goto gotit;
     }
 
-  np->hnext = nodehash[INOHASH(inum)];
-  if (np->hnext)
-    np->hnext->hprevp = &np->hnext;
-  np->hprevp = &nodehash[INOHASH(inum)];
-  nodehash[INOHASH(inum)] = np;
+  err = hurd_ihash_locp_add (&nodecache, slot,
+                            (hurd_ihash_key_t) &np->cache_id, np);
+  assert_perror (err);
   diskfs_nref_light (np);
-  nodehash_nr_items += 1;
   pthread_rwlock_unlock (&nodecache_lock);
 
   /* Get the contents of NP off disk.  */
@@ -133,7 +135,7 @@ diskfs_cached_ifind (ino_t inum)
   struct node *np;
 
   pthread_rwlock_rdlock (&nodecache_lock);
-  np = lookup (inum);
+  np = hurd_ihash_find (&nodecache, (hurd_ihash_key_t) &inum);
   pthread_rwlock_unlock (&nodecache_lock);
 
   assert (np);
@@ -144,7 +146,7 @@ void __attribute__ ((weak))
 diskfs_try_dropping_softrefs (struct node *np)
 {
   pthread_rwlock_wrlock (&nodecache_lock);
-  if (np->hprevp != NULL)
+  if (np->slot != NULL)
     {
       /* Check if someone reacquired a reference through the
         nodehash.  */
@@ -159,12 +161,8 @@ diskfs_try_dropping_softrefs (struct node *np)
          return;
        }
 
-      *np->hprevp = np->hnext;
-      if (np->hnext)
-       np->hnext->hprevp = np->hprevp;
-      np->hnext = NULL;
-      np->hprevp = NULL;
-      nodehash_nr_items -= 1;
+      hurd_ihash_locp_remove (&nodecache, np->slot);
+      np->slot = NULL;
       diskfs_nrele_light (np);
     }
   pthread_rwlock_unlock (&nodecache_lock);
@@ -179,7 +177,6 @@ error_t __attribute__ ((weak))
 diskfs_node_iterate (error_t (*fun)(struct node *))
 {
   error_t err = 0;
-  int n;
   size_t num_nodes;
   struct node *node, **node_list, **p;
 
@@ -191,7 +188,7 @@ diskfs_node_iterate (error_t (*fun)(struct node *))
      nodecache_lock, but we can't hold this while locking the
      individual node locks).  */
   /* XXX: Can we?  */
-  num_nodes = nodehash_nr_items;
+  num_nodes = nodecache.nr_items;
 
   /* TODO This method doesn't scale beyond a few dozen nodes and should be
      replaced.  */
@@ -203,17 +200,15 @@ diskfs_node_iterate (error_t (*fun)(struct node *))
     }
 
   p = node_list;
-  for (n = 0; n < INOHSZ; n++)
-    for (node = nodehash[n]; node; node = node->hnext)
-      {
-       *p++ = node;
-
-       /* We acquire a hard reference for node, but without using
-          diskfs_nref.  We do this so that diskfs_new_hardrefs will not
-          get called.  */
-       refcounts_ref (&node->refcounts, NULL);
-      }
+  HURD_IHASH_ITERATE (&nodecache, i)
+    {
+      *p++ = node = i;
 
+      /* We acquire a hard reference for node, but without using
+        diskfs_nref.  We do this so that diskfs_new_hardrefs will not
+        get called.  */
+      refcounts_ref (&node->refcounts, NULL);
+    }
   pthread_rwlock_unlock (&nodecache_lock);
 
   p = node_list;
diff --git a/libftpconn/cmd.c b/libftpconn/cmd.c
index 803dda7..9916d03 100644
--- a/libftpconn/cmd.c
+++ b/libftpconn/cmd.c
@@ -156,9 +156,8 @@ ftp_conn_abort (struct ftp_conn *conn)
          && write (conn->control, abor, sizeof abor) == sizeof abor)
        {
          int reply;
-         error_t err;
          do
-           err = ftp_conn_get_raw_reply (conn, &reply, 0);
+           ftp_conn_get_raw_reply (conn, &reply, 0);
          while (reply == REPLY_ABORTED);
          if (reply != REPLY_TRANS_OK && reply != REPLY_ABORT_OK)
            ftp_conn_close (conn);
diff --git a/libftpconn/reply.c b/libftpconn/reply.c
index d39cdb0..a3eb4cf 100644
--- a/libftpconn/reply.c
+++ b/libftpconn/reply.c
@@ -151,8 +151,8 @@ ftp_conn_get_raw_reply (struct ftp_conn *conn, int *reply,
 
   do
     {
-      const char *l;
-      size_t len;
+      const char *l = NULL;
+      size_t len = 0;
       error_t err = ftp_conn_getline (conn, &l, &len);
 
       if (err)
diff --git a/libhurd-slab/Makefile b/libhurd-slab/Makefile
index 925f70c..7bb0e59 100644
--- a/libhurd-slab/Makefile
+++ b/libhurd-slab/Makefile
@@ -26,7 +26,7 @@ installhdrs = slab.h
 MIGSTUBS = 
 OBJS = $(sort $(SRCS:.c=.o) $(MIGSTUBS))
 
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 MIGCOMSFLAGS =
 
diff --git a/libihash/Makefile b/libihash/Makefile
index 09bb136..3377ef4 100644
--- a/libihash/Makefile
+++ b/libihash/Makefile
@@ -20,7 +20,7 @@ dir := libihash
 makemode := library
 
 libname := libihash
-SRCS = ihash.c
+SRCS = ihash.c murmur3.c
 installhdrs = ihash.h
 
 OBJS = $(SRCS:.c=.o)
diff --git a/libihash/ihash.c b/libihash/ihash.c
index fa29257..4bc54fd 100644
--- a/libihash/ihash.c
+++ b/libihash/ihash.c
@@ -1,5 +1,5 @@
 /* ihash.c - Integer-keyed hash table functions.
-   Copyright (C) 1993-1997, 2001, 2003, 2004, 2006
+   Copyright (C) 1993-1997, 2001, 2003, 2004, 2006, 2014, 2015
      Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
    Revised by Miles Bader <address@hidden>.
@@ -32,13 +32,29 @@
 
 #include "ihash.h"
 
+/* This function is used to hash the key.  */
+static inline hurd_ihash_key_t
+hash (hurd_ihash_t ht, hurd_ihash_key_t k)
+{
+  return ht->fct_hash ? ht->fct_hash ((const void *) k) : k;
+}
+
+/* This function is used to compare the key.  Returns true if A is
+   equal to B.  */
+static inline int
+compare (hurd_ihash_t ht, hurd_ihash_key_t a, hurd_ihash_key_t b)
+{
+  return
+    ht->fct_cmp ? (a && ht->fct_cmp ((const void *) a, (const void *) b))
+               : a == b;
+}
+
 /* Return 1 if the slot with the index IDX in the hash table HT is
    empty, and 0 otherwise.  */
 static inline int
 index_empty (hurd_ihash_t ht, unsigned int idx)
 {
-  return ht->items[idx].value == _HURD_IHASH_EMPTY
-    || ht->items[idx].value == _HURD_IHASH_DELETED;
+  return ! hurd_ihash_value_valid (ht->items[idx].value);
 }
 
 
@@ -47,7 +63,7 @@ index_empty (hurd_ihash_t ht, unsigned int idx)
 static inline int
 index_valid (hurd_ihash_t ht, unsigned int idx, hurd_ihash_key_t key)
 {
-  return !index_empty (ht, idx) && ht->items[idx].key == key;
+  return !index_empty (ht, idx) && compare (ht, ht->items[idx].key, key);
 }
 
 
@@ -59,11 +75,14 @@ find_index (hurd_ihash_t ht, hurd_ihash_key_t key)
 {
   unsigned int idx;
   unsigned int up_idx;
+  unsigned int first_deleted = 0;
+  int first_deleted_set = 0;
   unsigned int mask = ht->size - 1;
 
-  idx = key & mask;
+  idx = hash (ht, key) & mask;
 
-  if (ht->items[idx].value == _HURD_IHASH_EMPTY || ht->items[idx].key == key)
+  if (ht->items[idx].value == _HURD_IHASH_EMPTY
+      || compare (ht, ht->items[idx].key, key))
     return idx;
 
   up_idx = idx;
@@ -71,15 +90,21 @@ find_index (hurd_ihash_t ht, hurd_ihash_key_t key)
   do
     {
       up_idx = (up_idx + 1) & mask;
-      if (ht->items[up_idx].value == _HURD_IHASH_EMPTY
-         || ht->items[up_idx].key == key)
+      if (ht->items[up_idx].value == _HURD_IHASH_EMPTY)
+        return first_deleted_set ? first_deleted : up_idx;
+      if (compare (ht, ht->items[up_idx].key, key))
        return up_idx;
+      if (! first_deleted_set
+          && ht->items[up_idx].value == _HURD_IHASH_DELETED)
+        first_deleted = up_idx, first_deleted_set = 1;
     }
   while (up_idx != idx);
 
-  /* If we end up here, the item could not be found.  Return any
-     invalid index.  */
-  return idx;
+  /* If we end up here, the item could not be found.  Return the index
+     of the first deleted item, as this is the position where we can
+     insert an item with the given key once we established that it is
+     not in the table.  */
+  return first_deleted;
 }
 
 
@@ -89,9 +114,11 @@ find_index (hurd_ihash_t ht, hurd_ihash_key_t key)
 static inline void
 locp_remove (hurd_ihash_t ht, hurd_ihash_locp_t locp)
 {
+  struct _hurd_ihash_item *item = (struct _hurd_ihash_item *) locp;
   if (ht->cleanup)
-    (*ht->cleanup) (*locp, ht->cleanup_data);
-  *locp = _HURD_IHASH_DELETED;
+    (*ht->cleanup) (item->value, ht->cleanup_data);
+  item->value = _HURD_IHASH_DELETED;
+  item->key = 0;
   ht->nr_items--;
 }
 
@@ -107,6 +134,8 @@ hurd_ihash_init (hurd_ihash_t ht, intptr_t locp_offs)
   ht->locp_offset = locp_offs;
   ht->max_load = HURD_IHASH_MAX_LOAD_DEFAULT;
   ht->cleanup = 0;
+  ht->fct_hash = NULL;
+  ht->fct_cmp = NULL;
 }
 
 
@@ -167,6 +196,21 @@ hurd_ihash_set_cleanup (hurd_ihash_t ht, 
hurd_ihash_cleanup_t cleanup,
 }
 
 
+/* Use the generalized key interface.  Must be called before any item
+   is inserted into the table.  */
+void
+hurd_ihash_set_gki (hurd_ihash_t ht,
+                   hurd_ihash_fct_hash_t fct_hash,
+                   hurd_ihash_fct_cmp_t fct_cmp)
+{
+  assert (ht->size == 0 || !"called after insertion");
+  assert (fct_hash);
+  assert (fct_cmp);
+  ht->fct_hash = fct_hash;
+  ht->fct_cmp = fct_cmp;
+}
+
+
 /* Set the maximum load factor in binary percent to MAX_LOAD, which
    should be between 64 and 128.  The default is
    HURD_IHASH_MAX_LOAD_DEFAULT.  New elements are only added to the
@@ -197,47 +241,22 @@ static inline int
 add_one (hurd_ihash_t ht, hurd_ihash_key_t key, hurd_ihash_value_t value)
 {
   unsigned int idx;
-  unsigned int first_free;
-  unsigned int mask = ht->size - 1;
 
-  idx = key & mask;
-  first_free = idx;
-
-  if (ht->items[idx].value != _HURD_IHASH_EMPTY && ht->items[idx].key != key)
-    {
-      unsigned int up_idx = idx;
-
-      do
-       {
-        up_idx = (up_idx + 1) & mask;
-         if (ht->items[up_idx].value == _HURD_IHASH_EMPTY
-             || ht->items[up_idx].key == key)
-           {
-             idx = up_idx;
-             break;
-           }
-       }
-      while (up_idx != idx);
-    }
+  idx = find_index (ht, key);
 
   /* Remove the old entry for this key if necessary.  */
   if (index_valid (ht, idx, key))
     locp_remove (ht, &ht->items[idx].value);
 
-  /* If we have not found an empty slot, maybe the last one we
-     looked at was empty (or just got deleted).  */
-  if (!index_empty (ht, first_free))
-    first_free = idx;
- 
-  if (index_empty (ht, first_free))
+  if (index_empty (ht, idx))
     {
       ht->nr_items++;
-      ht->items[first_free].value = value;
-      ht->items[first_free].key = key;
+      ht->items[idx].value = value;
+      ht->items[idx].key = key;
 
       if (ht->locp_offset != HURD_IHASH_NO_LOCP)
        *((hurd_ihash_locp_t *) (((char *) value) + ht->locp_offset))
-         = &ht->items[first_free].value;
+         = &ht->items[idx].value;
 
       return 1;
     }
@@ -245,7 +264,55 @@ add_one (hurd_ihash_t ht, hurd_ihash_key_t key, 
hurd_ihash_value_t value)
   return 0;
 }
 
-  
+
+/* Add VALUE to the hash table HT under the key KEY at LOCP.  If there
+   already is an item under this key, call the cleanup function (if
+   any) for it before overriding the value.  This function is faster
+   than hurd_ihash_add.
+
+   If LOCP is NULL, fall back to hurd_ihash_add.  Otherwise, LOCP must
+   be valid and may either be obtained from hurd_ihash_locp_find, or
+   from an item that is currently in the hash table.  If an item is
+   replaced, KEY must match the key of the previous item.
+
+   If a memory allocation error occurs, ENOMEM is returned, otherwise
+   0.  */
+error_t
+hurd_ihash_locp_add (hurd_ihash_t ht, hurd_ihash_locp_t locp,
+                     hurd_ihash_key_t key, hurd_ihash_value_t value)
+{
+  struct _hurd_ihash_item *item = (struct _hurd_ihash_item *) locp;
+
+  /* In case of complications, fall back to hurd_ihash_add.  */
+  if (ht->size == 0
+      || item == NULL
+      || item->value == _HURD_IHASH_DELETED
+      || ! compare (ht, item->key, key)
+      || hurd_ihash_get_load (ht) > ht->max_load)
+    return hurd_ihash_add (ht, key, value);
+
+  if (item->value == _HURD_IHASH_EMPTY)
+    {
+      item->key = key;
+      ht->nr_items += 1;
+    }
+  else
+    {
+      assert (compare (ht, item->key, key));
+      if (ht->cleanup)
+        (*ht->cleanup) (locp, ht->cleanup_data);
+    }
+
+  item->value = value;
+
+  if (ht->locp_offset != HURD_IHASH_NO_LOCP)
+    *((hurd_ihash_locp_t *) (((char *) value) + ht->locp_offset))
+      = locp;
+
+  return 0;
+}
+
+
 /* Add ITEM to the hash table HT under the key KEY.  If there already
    is an item under this key, call the cleanup function (if any) for
    it before overriding the value.  If a memory allocation error
@@ -255,12 +322,14 @@ hurd_ihash_add (hurd_ihash_t ht, hurd_ihash_key_t key, 
hurd_ihash_value_t item)
 {
   struct hurd_ihash old_ht = *ht;
   int was_added;
+  int fatal = 0;       /* bail out on allocation errors */
   unsigned int i;
 
   if (ht->size)
     {
       /* Only fill the hash table up to its maximum load factor.  */
       if (hurd_ihash_get_load (ht) <= ht->max_load)
+      add_one:
        if (add_one (ht, key, item))
          return 0;
     }
@@ -278,7 +347,15 @@ hurd_ihash_add (hurd_ihash_t ht, hurd_ihash_key_t key, 
hurd_ihash_value_t item)
   if (ht->items == NULL)
     {
       *ht = old_ht;
-      return ENOMEM;
+      if (fatal || ht->size == 0)
+        return ENOMEM;
+
+      /* We prefer performance degradation over failure.  Therefore,
+        we add the item even though we are above the load factor.  If
+        the table is full, this will fail.  We set the fatal flag to
+        avoid looping.  */
+      fatal = 1;
+      goto add_one;
     }
 
   /* We have to rehash the old entries.  */
@@ -314,6 +391,34 @@ hurd_ihash_find (hurd_ihash_t ht, hurd_ihash_key_t key)
     }
 }
 
+/* Find and return the item in the hash table HT with key KEY, or NULL
+   if it doesn't exist.  If it is not found, this function may still
+   return a location in SLOT.
+
+   If the lookup is successful, the returned location can be used with
+   hurd_ihash_locp_add to update the item, and with
+   hurd_ihash_locp_remove to remove it.
+
+   If the lookup is not successful, the returned location can be used
+   with hurd_ihash_locp_add to add the item.
+
+   Note that returned location is only valid until the next insertion
+   or deletion.  */
+hurd_ihash_value_t
+hurd_ihash_locp_find (hurd_ihash_t ht,
+                     hurd_ihash_key_t key,
+                     hurd_ihash_locp_t *slot)
+{
+  int idx;
+
+  if (ht->size == 0)
+    return NULL;
+
+  idx = find_index (ht, key);
+  *slot = &ht->items[idx].value;
+  return index_valid (ht, idx, key) ? ht->items[idx].value : NULL;
+}
+
 
 /* Remove the entry with the key KEY from the hash table HT.  If such
    an entry was found and removed, 1 is returned, otherwise 0.  */
diff --git a/libihash/ihash.h b/libihash/ihash.h
index 849a55a..356f647 100644
--- a/libihash/ihash.h
+++ b/libihash/ihash.h
@@ -1,5 +1,5 @@
 /* ihash.h - Integer keyed hash table interface.
-   Copyright (C) 1995, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2003, 2004, 2014, 2015 Free Software Foundation, Inc.
    Written by Miles Bader <address@hidden>.
    Revised by Marcus Brinkmann <address@hidden>.
 
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <limits.h>
 #include <stdint.h>
+#include <stddef.h>
 
 
 /* The type of the values corresponding to the keys.  Must be a
@@ -41,6 +42,13 @@ typedef void *hurd_ihash_value_t;
 #define _HURD_IHASH_EMPTY      ((hurd_ihash_value_t) 0)
 #define _HURD_IHASH_DELETED    ((hurd_ihash_value_t) -1)
 
+/* Test if VALUE is valid.  */
+static inline int
+hurd_ihash_value_valid (hurd_ihash_value_t value)
+{
+  return value != _HURD_IHASH_EMPTY && value != _HURD_IHASH_DELETED;
+}
+
 /* The type of integer we want to use for the keys.  */
 typedef uintptr_t hurd_ihash_key_t;
 
@@ -49,6 +57,20 @@ typedef uintptr_t hurd_ihash_key_t;
 typedef hurd_ihash_value_t *hurd_ihash_locp_t;
 
 
+/* We support non-integer keys using the generalized key interface.
+
+   To use it, supply a pair of functions matching the following
+   specification, and use pointers to the key instead of the key
+   itself in all calls to libihash.  */
+
+/* The type of a function computing a hash for the given key.  */
+typedef hurd_ihash_key_t (*hurd_ihash_fct_hash_t) (const void *);
+
+/* The type of a function comparing two given keys.  Return true if
+   both keys are equal.  */
+typedef int (*hurd_ihash_fct_cmp_t) (const void *, const void *);
+
+
 /* The type of the cleanup function, which is called for every value
    removed from the hash table.  */
 typedef void (*hurd_ihash_cleanup_t) (hurd_ihash_value_t value, void *arg);
@@ -87,6 +109,10 @@ struct hurd_ihash
      second argument.  This does not happen if CLEANUP is NULL.  */
   hurd_ihash_cleanup_t cleanup;
   void *cleanup_data;
+
+  /* User-supplied functions for the generalized key interface.  */
+  hurd_ihash_fct_hash_t fct_hash;
+  hurd_ihash_fct_cmp_t fct_cmp;
 };
 typedef struct hurd_ihash *hurd_ihash_t;
 
@@ -110,6 +136,16 @@ typedef struct hurd_ihash *hurd_ihash_t;
     .max_load = HURD_IHASH_MAX_LOAD_DEFAULT,                           \
     .locp_offset = (locp_offs)}
 
+#define HURD_IHASH_INITIALIZER_GKI(locp_offs, f_clean, f_clean_data,   \
+                                  f_hash, f_compare)                   \
+  { .nr_items = 0, .size = 0,                                          \
+    .cleanup = (f_clean),                                              \
+    .cleanup_data = (f_clean_data),                                    \
+    .max_load = HURD_IHASH_MAX_LOAD_DEFAULT,                           \
+    .locp_offset = (locp_offs),                                                
\
+    .fct_hash = (f_hash),                                              \
+    .fct_cmp = (f_compare)}                                            \
+
 /* Initialize the hash table at address HT.  If LOCP_OFFSET is not
    HURD_IHASH_NO_LOCP, then this is an offset (in bytes) from the
    address of a hash value where a location pointer can be found.  The
@@ -144,6 +180,12 @@ void hurd_ihash_free (hurd_ihash_t ht);
 void hurd_ihash_set_cleanup (hurd_ihash_t ht, hurd_ihash_cleanup_t cleanup,
                             void *cleanup_data);
 
+/* Use the generalized key interface.  Must be called before any item
+   is inserted into the table. */
+void hurd_ihash_set_gki (hurd_ihash_t ht,
+                        hurd_ihash_fct_hash_t fct_hash,
+                        hurd_ihash_fct_cmp_t fct_cmp);
+
 /* Set the maximum load factor in binary percent to MAX_LOAD, which
    should be between 64 and 128.  The default is
    HURD_IHASH_MAX_LOAD_DEFAULT.  New elements are only added to the
@@ -191,10 +233,42 @@ hurd_ihash_get_load (hurd_ihash_t ht)
 error_t hurd_ihash_add (hurd_ihash_t ht, hurd_ihash_key_t key,
                        hurd_ihash_value_t item);
 
+/* Add VALUE to the hash table HT under the key KEY at LOCP.  If there
+   already is an item under this key, call the cleanup function (if
+   any) for it before overriding the value.  This function is faster
+   than hurd_ihash_add.
+
+   If LOCP is NULL, fall back to hurd_ihash_add.  Otherwise, LOCP must
+   be valid and may either be obtained from hurd_ihash_locp_find, or
+   from an item that is currently in the hash table.  If an item is
+   replaced, KEY must match the key of the previous item.
+
+   If a memory allocation error occurs, ENOMEM is returned, otherwise
+   0.  */
+error_t hurd_ihash_locp_add (hurd_ihash_t ht, hurd_ihash_locp_t locp,
+                             hurd_ihash_key_t key, hurd_ihash_value_t value);
+
 /* Find and return the item in the hash table HT with key KEY, or NULL
    if it doesn't exist.  */
 hurd_ihash_value_t hurd_ihash_find (hurd_ihash_t ht, hurd_ihash_key_t key);
 
+/* Find and return the item in the hash table HT with key KEY, or NULL
+   if it doesn't exist.  If it is not found, this function may still
+   return a location in SLOT.
+
+   If the lookup is successful, the returned location can be used with
+   hurd_ihash_locp_add to update the item, and with
+   hurd_ihash_locp_remove to remove it.
+
+   If the lookup is not successful, the returned location can be used
+   with hurd_ihash_locp_add to add the item.
+
+   Note that returned location is only valid until the next insertion
+   or deletion.  */
+hurd_ihash_value_t hurd_ihash_locp_find (hurd_ihash_t ht,
+                                        hurd_ihash_key_t key,
+                                        hurd_ihash_locp_t *slot);
+
 /* Iterate over all elements in the hash table.  You use this macro
    with a block, for example like this:
 
@@ -275,5 +349,10 @@ int hurd_ihash_remove (hurd_ihash_t ht, hurd_ihash_key_t 
key);
    was provided to hurd_ihash_add().  This call is faster than
    hurd_ihash_remove().  */
 void hurd_ihash_locp_remove (hurd_ihash_t ht, hurd_ihash_locp_t locp);
+
+/* We provide a general purpose hash function.  This function can be
+   used with the generalized key interface to use arbitrary data as
+   keys using this library.  */
+uint32_t hurd_ihash_hash32 (const void *buf, size_t len, uint32_t seed);
 
 #endif /* _HURD_IHASH_H */
diff --git a/libihash/murmur3.c b/libihash/murmur3.c
new file mode 100644
index 0000000..e45180a
--- /dev/null
+++ b/libihash/murmur3.c
@@ -0,0 +1,93 @@
+/* This is the Murmur3 hash algorithm.
+ *
+ * MurmurHash3 was written by Austin Appleby, and is placed in the public
+ * domain.  The author hereby disclaims copyright to this source code.
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+
+#define FORCE_INLINE static inline __attribute__((always_inline))
+
+static inline uint32_t rotl32 ( uint32_t x, int8_t r )
+{
+  return (x << r) | (x >> (32 - r));
+}
+
+#define ROTL32(x,y)     rotl32(x,y)
+
+/* Block read - if your platform needs to do endian-swapping or can
+   only handle aligned reads, do the conversion here.  */
+
+FORCE_INLINE uint32_t getblock32 ( const uint32_t * p, int i )
+{
+  return p[i];
+}
+
+/* Finalization mix - force all bits of a hash block to avalanche.  */
+
+FORCE_INLINE uint32_t fmix32 ( uint32_t h )
+{
+  h ^= h >> 16;
+  h *= 0x85ebca6b;
+  h ^= h >> 13;
+  h *= 0xc2b2ae35;
+  h ^= h >> 16;
+
+  return h;
+}
+
+/* The Murmur3 hash function.  */
+static uint32_t
+MurmurHash3_x86_32 (const void *key, size_t len, uint32_t seed)
+{
+  const uint8_t * data = (const uint8_t*)key;
+  const int nblocks = (int) (len / 4);
+
+  uint32_t h1 = seed;
+
+  const uint32_t c1 = 0xcc9e2d51;
+  const uint32_t c2 = 0x1b873593;
+
+  /* body */
+
+  const uint32_t * blocks = (const uint32_t *)(data + nblocks*4);
+
+  for(int i = -nblocks; i; i++)
+  {
+    uint32_t k1 = getblock32(blocks,i);
+
+    k1 *= c1;
+    k1 = ROTL32(k1,15);
+    k1 *= c2;
+
+    h1 ^= k1;
+    h1 = ROTL32(h1,13);
+    h1 = h1*5+0xe6546b64;
+  }
+
+  /* tail */
+
+  const uint8_t * tail = (const uint8_t*)(data + nblocks*4);
+
+  uint32_t k1 = 0;
+
+  switch(len & 3)
+  {
+  case 3: k1 ^= tail[2] << 16;
+  case 2: k1 ^= tail[1] << 8;
+  case 1: k1 ^= tail[0];
+          k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
+  };
+
+  /* finalization */
+
+  h1 ^= len;
+
+  h1 = fmix32(h1);
+
+  return h1;
+}
+
+uint32_t hurd_ihash_hash32 (const void *, size_t, uint32_t)
+  __attribute__ ((weak, alias ("MurmurHash3_x86_32")));
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c
index 7ca526b..1fefd3f 100644
--- a/libnetfs/dir-lookup.c
+++ b/libnetfs/dir-lookup.c
@@ -49,7 +49,7 @@ netfs_S_dir_lookup (struct protid *diruser,
   char *nextname;
   char *relpath;
   error_t error;
-  struct protid *newpi;
+  struct protid *newpi = NULL;
   struct iouser *user;
 
   if (!diruser)
@@ -128,7 +128,9 @@ netfs_S_dir_lookup (struct protid *diruser,
            *do_retry = FS_RETRY_REAUTH;
            *retry_port = diruser->po->shadow_root_parent;
            *retry_port_type = MACH_MSG_TYPE_COPY_SEND;
-           if (! lastcomp)
+           if (lastcomp && mustbedir) /* Trailing slash.  */
+             strcpy (retry_name, "/");
+           else if (!lastcomp)
              strcpy (retry_name, nextname);
            error = 0;
            pthread_mutex_unlock (&dnp->lock);
@@ -142,7 +144,9 @@ netfs_S_dir_lookup (struct protid *diruser,
            *do_retry = FS_RETRY_REAUTH;
            *retry_port = diruser->po->root_parent;
            *retry_port_type = MACH_MSG_TYPE_COPY_SEND;
-           if (!lastcomp)
+           if (lastcomp && mustbedir) /* Trailing slash.  */
+             strcpy (retry_name, "/");
+           else if (!lastcomp)
              strcpy (retry_name, nextname);
            error = 0;
            pthread_mutex_unlock (&dnp->lock);
@@ -194,7 +198,7 @@ netfs_S_dir_lookup (struct protid *diruser,
       if (error)
        goto out;
 
-      if ((((flags & O_NOTRANS) == 0) || !lastcomp)
+      if ((((flags & O_NOTRANS) == 0) || !lastcomp || mustbedir)
          && ((np->nn_translated & S_IPTRANS)
              || S_ISFIFO (np->nn_translated)
              || S_ISCHR (np->nn_translated)
@@ -288,10 +292,16 @@ netfs_S_dir_lookup (struct protid *diruser,
          if (error != ENOENT)
            {
              *retry_port_type = MACH_MSG_TYPE_MOVE_SEND;
-             if (!lastcomp && !error)
+             if (!error)
                {
-                 strcat (retry_name, "/");
-                 strcat (retry_name, nextname);
+                 char *end = strchr (retry_name, '\0');
+                 if (mustbedir)
+                   *end++ = '/'; /* Trailing slash.  */
+                 else if (!lastcomp) {
+                   if (end != retry_name)
+                     *end++ = '/';
+                   strcpy (end, nextname);
+                 }
                }
 
              if (register_translator)
diff --git a/libshouldbeinlibc/portinfo.c b/libshouldbeinlibc/portinfo.c
index e6305c6..f3c540f 100644
--- a/libshouldbeinlibc/portinfo.c
+++ b/libshouldbeinlibc/portinfo.c
@@ -53,7 +53,7 @@ print_port_info (mach_port_t name, mach_port_type_t type, 
task_t task,
        return err;
     }
 
-  fprintf (stream, hex_names ? "%#6zx: " : "%6zd: ", name);
+  fprintf (stream, hex_names ? "%#6lx: " : "%6lu: ", name);
 
   if (type & MACH_PORT_TYPE_RECEIVE)
     {
@@ -68,7 +68,7 @@ print_port_info (mach_port_t name, mach_port_type_t type, 
task_t task,
              fprintf (stream, " (");
              if (status.mps_pset != MACH_PORT_NULL)
                fprintf (stream,
-                        hex_names ? "port-set: %#zx, " : "port-set: %zd, ",
+                        hex_names ? "port-set: %#lx, " : "port-set: %lu, ",
                         status.mps_pset);
              fprintf (stream, "seqno: %zu", status.mps_seqno);
              if (status.mps_mscount)
@@ -119,9 +119,9 @@ print_port_info (mach_port_t name, mach_port_type_t type, 
task_t task,
                fprintf (stream, " (empty)");
              else
                {
-                 fprintf (stream, hex_names ? " (%#zx" : " (%zu", members[0]);
+                 fprintf (stream, hex_names ? " (%#lx" : " (%lu", members[0]);
                  for (i = 1; i < members_len; i++)
-                   fprintf (stream, hex_names ? ", %#zx" : ", %zu",
+                   fprintf (stream, hex_names ? ", %#lx" : ", %lu",
                             members[i]);
                  fprintf (stream, ")");
                  munmap ((caddr_t) members, members_len * sizeof *members);
diff --git a/libshouldbeinlibc/ugids-verify-auth.c 
b/libshouldbeinlibc/ugids-verify-auth.c
index 0e85b1b..f6991aa 100644
--- a/libshouldbeinlibc/ugids-verify-auth.c
+++ b/libshouldbeinlibc/ugids-verify-auth.c
@@ -65,9 +65,10 @@ server_verify_make_auth (const char *password,
 {
   auth_t auth;
   struct svma_state *svma_state = hook;
-  error_t (*check) (io_t server, uid_t id, const char *passwd, auth_t *auth) =
+  /* Mig routines don't use 'const' for passwd.  */
+  error_t (*check) (io_t server, uid_t id, char *passwd, auth_t *auth) =
     is_group ? password_check_group : password_check_user;
-  error_t err = (*check) (svma_state->server, id, password, &auth);
+  error_t err = (*check) (svma_state->server, id, (char *) password, &auth);
 
   if (! err)
     /* PASSWORD checked out ok; the corresponding authentication is in AUTH. */
diff --git a/libshouldbeinlibc/xportinfo.c b/libshouldbeinlibc/xportinfo.c
index cce6fb6..47e6dd9 100644
--- a/libshouldbeinlibc/xportinfo.c
+++ b/libshouldbeinlibc/xportinfo.c
@@ -35,7 +35,7 @@ print_xlated_port_info (mach_port_t name, mach_port_type_t 
type,
   error_t err = port_name_xlator_xlate (x, name, type, &name, &type);
   if (! err)
     {
-      fprintf (stream, (show & PORTINFO_HEX_NAMES) ? "%#6zx => " : "%6zd => ",
+      fprintf (stream, (show & PORTINFO_HEX_NAMES) ? "%#6lx => " : "%6lu => ",
               old_name);
       err = print_port_info (name, type, x->to_task, show, stream);
     }
diff --git a/libstore/decode.c b/libstore/decode.c
index 64405ec..4bb23c1 100644
--- a/libstore/decode.c
+++ b/libstore/decode.c
@@ -35,7 +35,7 @@ store_std_leaf_decode (struct store_enc *enc,
 {
   char *misc, *name;
   error_t err;
-  int type, flags;
+  int flags;
   mach_port_t port;
   size_t block_size, num_runs, name_len, misc_len;
   /* Call CREATE appriately from within store_with_decoded_runs.  */
@@ -49,7 +49,7 @@ store_std_leaf_decode (struct store_enc *enc,
     return EINVAL;
 
   /* Read encoded ints.  */
-  type = enc->ints[enc->cur_int++];
+  enc->cur_int++; /* Ignore type.  */
   flags = enc->ints[enc->cur_int++];
   block_size = enc->ints[enc->cur_int++];
   num_runs = enc->ints[enc->cur_int++];
diff --git a/libstore/file.c b/libstore/file.c
index 49f1c3f..ce02f1f 100644
--- a/libstore/file.c
+++ b/libstore/file.c
@@ -65,7 +65,7 @@ file_write (struct store *store,
            size_t *amount)
 {
   size_t bsize = store->block_size;
-  return io_write (store->port, buf, len, addr * bsize, amount);
+  return io_write (store->port, (void *) buf, len, addr * bsize, amount);
 }
 
 static error_t
@@ -235,7 +235,7 @@ file_byte_write (struct store *store,
                 const void *buf, size_t len,
                 size_t *amount)
 {
-  return io_write (store->port, buf, len, addr, amount);
+  return io_write (store->port, (void *) buf, len, addr, amount);
 }
 
 struct store_class
diff --git a/libstore/zero.c b/libstore/zero.c
index 2fba72c..878b227 100644
--- a/libstore/zero.c
+++ b/libstore/zero.c
@@ -103,13 +103,14 @@ zero_decode (struct store_enc *enc, const struct 
store_class *const *classes,
             struct store **store)
 {
   store_offset_t size;
-  int type, flags;
+  int flags;
 
   if (enc->cur_int + 2 > enc->num_ints
       || enc->cur_offset + 1 > enc->num_offsets)
     return EINVAL;
 
-  type = enc->ints[enc->cur_int++];
+  /* Ignore type.  */
+  enc->cur_int++;
   flags = enc->ints[enc->cur_int++];
   size = enc->offsets[enc->cur_offset++];
 
diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile
index 48a53d7..4f9c71f 100644
--- a/libtrivfs/Makefile
+++ b/libtrivfs/Makefile
@@ -40,7 +40,6 @@ FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-stubs.c 
fsys-syncfs.c \
 OTHERSRCS=demuxer.c protid-clean.c protid-dup.c cntl-create.c \
        cntl-clean.c times.c startup.c open.c \
        runtime-argp.c set-options.c append-args.c dyn-classes.c \
-       protid-classes.c cntl-classes.c
 
 SRCS=$(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(OTHERSRCS)
 
diff --git a/libtrivfs/cntl-classes.c b/libtrivfs/cntl-classes.c
deleted file mode 100644
index 356c9e9..0000000
--- a/libtrivfs/cntl-classes.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Defaults for TRIVFS_CNTL_[N]PORTCLASSES
-
-   Copyright (C) 1997 Free Software Foundation, Inc.
-
-   This program 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.
-
-   This program 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 "trivfs.h"
-
-struct port_class *trivfs_cntl_portclasses[1];
-int trivfs_cntl_nportclasses;
diff --git a/libtrivfs/mig-decls.h b/libtrivfs/mig-decls.h
index 1909199..f3afd5a 100644
--- a/libtrivfs/mig-decls.h
+++ b/libtrivfs/mig-decls.h
@@ -45,9 +45,6 @@ trivfs_begin_using_protid (mach_port_t port)
       for (i = 0; i < trivfs_num_dynamic_protid_port_classes; i++)
        if (pi->class == trivfs_dynamic_protid_port_classes[i])
          return (struct trivfs_protid *) pi;
-      for (i = 0; i < trivfs_protid_nportclasses; i++)
-       if (pi->class == trivfs_protid_portclasses[i])
-         return (struct trivfs_protid *) pi;
       ports_port_deref (pi);
     }
 
@@ -65,9 +62,6 @@ trivfs_begin_using_protid_payload (unsigned long payload)
       for (i = 0; i < trivfs_num_dynamic_protid_port_classes; i++)
        if (pi->class == trivfs_dynamic_protid_port_classes[i])
          return (struct trivfs_protid *) pi;
-      for (i = 0; i < trivfs_protid_nportclasses; i++)
-       if (pi->class == trivfs_protid_portclasses[i])
-         return (struct trivfs_protid *) pi;
       ports_port_deref (pi);
     }
 
@@ -81,6 +75,12 @@ trivfs_end_using_protid (struct trivfs_protid *cred)
     ports_port_deref (cred);
 }
 
+static inline mach_port_t __attribute__ ((unused))
+trivfs_convert_to_port(struct trivfs_protid *protid)
+{
+  return protid->pi.port_right;
+}
+
 static inline struct trivfs_control * __attribute__ ((unused))
 trivfs_begin_using_control (mach_port_t port)
 {
@@ -92,9 +92,6 @@ trivfs_begin_using_control (mach_port_t port)
       for (i = 0; i < trivfs_num_dynamic_control_port_classes; i++)
        if (pi->class == trivfs_dynamic_control_port_classes[i])
          return (struct trivfs_control *) pi;
-      for (i = 0; i < trivfs_cntl_nportclasses; i++)
-       if (pi->class == trivfs_cntl_portclasses[i])
-         return (struct trivfs_control *) pi;
       ports_port_deref (pi);
     }
 
@@ -112,9 +109,6 @@ trivfs_begin_using_control_payload (unsigned long payload)
       for (i = 0; i < trivfs_num_dynamic_control_port_classes; i++)
        if (pi->class == trivfs_dynamic_control_port_classes[i])
          return (struct trivfs_control *) pi;
-      for (i = 0; i < trivfs_cntl_nportclasses; i++)
-       if (pi->class == trivfs_cntl_portclasses[i])
-         return (struct trivfs_control *) pi;
       ports_port_deref (pi);
     }
 
diff --git a/libtrivfs/protid-classes.c b/libtrivfs/protid-classes.c
deleted file mode 100644
index 204548d..0000000
--- a/libtrivfs/protid-classes.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Defaults for TRIVFS_PROTID_[N]PORTCLASSES
-
-   Copyright (C) 1997 Free Software Foundation, Inc.
-
-   This program 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.
-
-   This program 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 "trivfs.h"
-
-struct port_class *trivfs_protid_portclasses[1];
-int trivfs_protid_nportclasses;
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index d620a7b..d81c4f9 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -74,19 +74,6 @@ extern int trivfs_support_exec;
    operations.)  */
 extern int trivfs_allow_open;
 
-/* If the user defines these, they should be vectors (and the associated
-   sizes) of port classes that will be translated into control & protid
-   pointers for passing to rpcs, in addition to those passed to or created by
-   trivfs_create_control (or trivfs_startup) will automatically be
-   recognized.  */
-/* Deprecation notice: The use of these vectors is deprecated.  Please
-   use the dynamic class support.  These vectors will be removed in
-   Hurd 0.8.  */
-extern struct port_class *trivfs_protid_portclasses[] __attribute__ 
((deprecated));
-extern int trivfs_protid_nportclasses __attribute__ ((deprecated));
-extern struct port_class *trivfs_cntl_portclasses[] __attribute__ 
((deprecated));
-extern int trivfs_cntl_nportclasses __attribute__ ((deprecated));
-
 /* The user must define this function.  This should modify a struct
    stat (as returned from the underlying node) for presentation to
    callers of io_stat.  It is permissible for this function to do
diff --git a/mach-defpager/Makefile b/mach-defpager/Makefile
index 4f987fa..036a49a 100644
--- a/mach-defpager/Makefile
+++ b/mach-defpager/Makefile
@@ -30,8 +30,8 @@ OBJS  := $(SRCS:.c=.o) \
           default_pager_replyUser.o
 
 HURDLIBS:= ihash
-OTHERLIBS:= -lpthread
-LDFLAGS += -static
+LDFLAGS += -static -z muldefs
+LDLIBS:= -lpthread
 
 include ../Makeconf
 
diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c
index ef844ac..35ddf9a 100644
--- a/mach-defpager/kalloc.c
+++ b/mach-defpager/kalloc.c
@@ -34,23 +34,9 @@
 
 #include <mach.h>
 #include <pthread.h>           /* for spin locks */
-#include <malloc.h>            /* for malloc_hook/free_hook */
 
 #include "wiring.h"
 
-static void init_hook (void);
-static void *malloc_hook (size_t size, const void *caller);
-static void free_hook (void *ptr, const void *caller);
-
-/* GNU libc 2.14 defines this macro to declare hook variables as volatile.
-   Define it as empty for older libc versions.  */
-#ifndef __MALLOC_HOOK_VOLATILE
-# define __MALLOC_HOOK_VOLATILE
-#endif
-
-void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void) = init_hook;
-
-
 /* #define     DEBUG */
 
 /*
@@ -264,21 +250,14 @@ kfree(    void *data,
        }
 }
 
-static void
-init_hook (void)
-{
-  __malloc_hook = malloc_hook;
-  __free_hook = free_hook;
-}
-
-static void *
-malloc_hook (size_t size, const void *caller)
+void *
+malloc (size_t size)
 {
   return (void *) kalloc ((vm_size_t) size);
 }
 
-static void
-free_hook (void *ptr, const void *caller)
+void
+free (void *ptr)
 {
   /* Just ignore harmless attempts at cleanliness.  */
   /*   panic("free not implemented"); */
diff --git a/nfs/Makefile b/nfs/Makefile
index d814f67..265d027 100644
--- a/nfs/Makefile
+++ b/nfs/Makefile
@@ -27,6 +27,6 @@ SRCS = ops.c rpc.c mount.c nfs.c cache.c consts.c main.c 
name-cache.c \
        storage-info.c
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = netfs fshelp iohelp ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/nfs/ops.c b/nfs/ops.c
index a4d6ac7..79cd3a6 100644
--- a/nfs/ops.c
+++ b/nfs/ops.c
@@ -1819,7 +1819,7 @@ netfs_get_dirents (struct iouser *cred, struct node *np,
                   mach_msg_type_number_t *datacnt,
                   vm_size_t bufsiz, int *amt)
 {
-  void *buf;
+  void *buf = NULL;
   size_t our_bufsiz, allocsize;
   void *bp;
   char *userdp;
diff --git a/nfsd/Makefile b/nfsd/Makefile
index 6ac6dd4..5dc9a4d 100644
--- a/nfsd/Makefile
+++ b/nfsd/Makefile
@@ -25,7 +25,7 @@ OBJS = $(subst .c,.o,$(SRCS))
 target = nfsd
 installationdir = $(sbindir)
 HURDLIBS = shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
 
diff --git a/nfsd/cache.c b/nfsd/cache.c
index 778f557..1b2b6ee 100644
--- a/nfsd/cache.c
+++ b/nfsd/cache.c
@@ -279,7 +279,7 @@ lookup_cache_handle (int *p, struct cache_handle **cp, 
struct idspec *i)
   hash = fh_hash ((char *)p, i);
   pthread_mutex_lock (&fhhashlock);
   for (c = fhhashtable[hash]; c; c = c->next)
-    if (c->ids == i && ! bcmp (c->handle, p, NFS2_FHSIZE))
+    if (c->ids == i && ! bcmp (c->handle.array, p, NFS2_FHSIZE))
       {
        if (c->references == 0)
          nfreefh--;
@@ -303,7 +303,7 @@ lookup_cache_handle (int *p, struct cache_handle **cp, 
struct idspec *i)
     }
 
   c = malloc (sizeof (struct cache_handle));
-  memcpy (c->handle, p, NFS2_FHSIZE);
+  memcpy (c->handle.array, p, NFS2_FHSIZE);
   cred_ref (i);
   c->ids = i;
   c->port = port;
@@ -381,11 +381,11 @@ scan_fhs ()
 struct cache_handle *
 create_cached_handle (int fs, struct cache_handle *credc, file_t userport)
 {
-  char fhandle[NFS2_FHSIZE];
+  union cache_handle_array fhandle;
   error_t err;
   struct cache_handle *c;
   int hash;
-  char *bp = fhandle + sizeof (int);
+  char *bp = fhandle.array + sizeof (int);
   size_t handlelen = NFS2_FHSIZE - sizeof (int);
   mach_port_t newport, ref;
 
@@ -405,22 +405,23 @@ create_cached_handle (int fs, struct cache_handle *credc, 
file_t userport)
   mach_port_destroy (mach_task_self (), ref);
 
   /* Fetch the file handle.  */
-  *(int *)fhandle = fs;
+  fhandle.fs = fs;
   err = file_getfh (newport, &bp, &handlelen);
   mach_port_deallocate (mach_task_self (), newport);
   if (err || handlelen != NFS2_FHSIZE - sizeof (int))
     return 0;
-  if (bp != fhandle + sizeof (int))
+  if (bp != fhandle.array + sizeof (int))
     {
-      memcpy (fhandle + sizeof (int), bp, NFS2_FHSIZE - sizeof (int));
+      memcpy (fhandle.array + sizeof (int), bp, NFS2_FHSIZE - sizeof (int));
       munmap (bp, handlelen);
     }
 
   /* Cache it.  */
-  hash = fh_hash (fhandle, credc->ids);
+  hash = fh_hash (fhandle.array, credc->ids);
   pthread_mutex_lock (&fhhashlock);
   for (c = fhhashtable[hash]; c; c = c->next)
-    if (c->ids == credc->ids && ! bcmp (fhandle, c->handle, NFS2_FHSIZE))
+    if (c->ids == credc->ids &&
+        ! bcmp (fhandle.array, c->handle.array, NFS2_FHSIZE))
       {
        /* Return this one.  */
        if (c->references == 0)
@@ -436,7 +437,7 @@ create_cached_handle (int fs, struct cache_handle *credc, 
file_t userport)
   err = fsys_getfile (lookup_filesystem (fs),
                      credc->ids->uids, credc->ids->nuids,
                      credc->ids->gids, credc->ids->ngids,
-                     fhandle + sizeof (int), NFS2_FHSIZE - sizeof (int),
+                     fhandle.array + sizeof (int), NFS2_FHSIZE - sizeof (int),
                      &newport);
   if (err)
     {
@@ -446,7 +447,7 @@ create_cached_handle (int fs, struct cache_handle *credc, 
file_t userport)
 
   /* Create it anew.  */
   c = malloc (sizeof (struct cache_handle));
-  memcpy (c->handle, fhandle, NFS2_FHSIZE);
+  memcpy (c->handle.array, fhandle.array, NFS2_FHSIZE);
   cred_ref (credc->ids);
   c->ids = credc->ids;
   c->port = newport;
diff --git a/nfsd/fsys.c b/nfsd/fsys.c
index 7b15d15..f746716 100644
--- a/nfsd/fsys.c
+++ b/nfsd/fsys.c
@@ -72,7 +72,7 @@ init_filesystems (void)
 
   for (line = 1; ; line++)
     {
-      nitems = fscanf (index_file, "%d %as\n", &index, &name);
+      nitems = fscanf (index_file, "%d %ms\n", &index, &name);
       if (nitems == EOF)
        {
          fclose (index_file);
diff --git a/nfsd/nfsd.h b/nfsd/nfsd.h
index 4afff06..4ab558c 100644
--- a/nfsd/nfsd.h
+++ b/nfsd/nfsd.h
@@ -42,10 +42,15 @@ struct idspec
   int references;
 };
 
+union cache_handle_array {
+  char array[NFS2_FHSIZE];
+  int fs;
+};
+
 struct cache_handle
 {
   struct cache_handle *next, **prevp;
-  char handle[NFS2_FHSIZE];
+  union cache_handle_array handle;
   struct idspec *ids;
   file_t port;
   time_t lastuse;
diff --git a/nfsd/ops.c b/nfsd/ops.c
index 6e2cbb1..aa37c4a 100644
--- a/nfsd/ops.c
+++ b/nfsd/ops.c
@@ -181,10 +181,10 @@ op_lookup (struct cache_handle *c,
   if (err)
     return err;
 
-  newc = create_cached_handle (*(int *)c->handle, c, newport);
+  newc = create_cached_handle (c->handle.fs, c, newport);
   if (!newc)
     return ESTALE;
-  *reply = encode_fhandle (*reply, newc->handle);
+  *reply = encode_fhandle (*reply, newc->handle.array);
   *reply = encode_fattr (*reply, &st, version);
   return 0;
 }
@@ -375,11 +375,11 @@ op_create (struct cache_handle *c,
     }
   free (name);
 
-  newc = create_cached_handle (*(int *)c->handle, c, newport);
+  newc = create_cached_handle (c->handle.fs, c, newport);
   if (!newc)
     return ESTALE;
 
-  *reply = encode_fhandle (*reply, newc->handle);
+  *reply = encode_fhandle (*reply, newc->handle.array);
   *reply = encode_fattr (*reply, &st, version);
   return 0;
 }
@@ -533,10 +533,10 @@ op_mkdir (struct cache_handle *c,
   if (err)
     return err;
 
-  newc = create_cached_handle (*(int *)c->handle, c, newport);
+  newc = create_cached_handle (c->handle.fs, c, newport);
   if (!newc)
     return ESTALE;
-  *reply = encode_fhandle (*reply, newc->handle);
+  *reply = encode_fhandle (*reply, newc->handle.array);
   *reply = encode_fattr (*reply, &st, version);
   return 0;
 }
@@ -666,7 +666,7 @@ op_mnt (struct cache_handle *c,
   free (name);
   if (!newc)
     return ESTALE;
-  *reply = encode_fhandle (*reply, newc->handle);
+  *reply = encode_fhandle (*reply, newc->handle.array);
   return 0;
 }
 
diff --git a/pfinet/Makefile b/pfinet/Makefile
index 10b90eb..74cedcf 100644
--- a/pfinet/Makefile
+++ b/pfinet/Makefile
@@ -115,7 +115,7 @@ ASMHEADERS = atomic.h bitops.h byteorder.h delay.h errno.h 
hardirq.h init.h \
        segment.h spinlock.h system.h types.h uaccess.h
 
 HURDLIBS=trivfs fshelp ports ihash shouldbeinlibc iohelp
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 target = pfinet
 
diff --git a/pfinet/glue-include/linux/kernel.h 
b/pfinet/glue-include/linux/kernel.h
index a0e101b..de5852f 100644
--- a/pfinet/glue-include/linux/kernel.h
+++ b/pfinet/glue-include/linux/kernel.h
@@ -42,7 +42,7 @@
 
 #define printk printf
 
-extern inline int
+static inline int
 getname (const char *name, char **newp)
 {
   *newp = malloc (strlen (name) + 1);
@@ -50,7 +50,7 @@ getname (const char *name, char **newp)
   return 0;
 }
 
-extern inline void
+static inline void
 putname (char *p)
 {
   free (p);
@@ -60,14 +60,14 @@ putname (char *p)
    find any SIGIO code at all.  So we'll just punt on that; clearly
    Linux is missing the point.  SIGURG should only be sent for
    sockets that have explicitly requested it. */
-extern inline int
+static inline int
 kill_proc (int pid, int signo, int priv)
 {
   assert (signo == SIGURG);
   return 0;
 }
 
-extern inline int
+static inline int
 kill_pg (int pgrp, int signo, int priv)
 {
   assert (signo == SIGURG);
diff --git a/pfinet/glue-include/linux/sched.h 
b/pfinet/glue-include/linux/sched.h
index 26ab10a..e39263e 100644
--- a/pfinet/glue-include/linux/sched.h
+++ b/pfinet/glue-include/linux/sched.h
@@ -78,13 +78,13 @@ prepare_current (int isroot)
 struct semaphore { };
 
 
-extern inline int
+static inline int
 suser ()
 {
   return current->isroot;
 };
 
-extern inline int
+static inline int
 capable(int cap)
 {
   return current->isroot;
@@ -185,6 +185,9 @@ schedule_timeout (long timeout)
       else
        return 0;
     }
+  /* It may happen that we get woken without a signal. Noticed notably during
+     rsyslog testsuite.  Make sure we don't leave our timer in.  */
+  del_timer(&timer);
   return 0;
 }
 
@@ -195,7 +198,7 @@ schedule_timeout (long timeout)
    Hurd, servers are not responsible for SIGPIPE; the library
    does that itself upon receiving EPIPE.  So we can just
    NOP such calls.  */
-extern inline int
+static inline int
 send_sig (u_long signo, struct task_struct *task, int priv)
 {
   assert (signo == SIGPIPE);
diff --git a/pfinet/linux-src/include/asm-i386/checksum.h 
b/pfinet/linux-src/include/asm-i386/checksum.h
index add8959..266033a 100644
--- a/pfinet/linux-src/include/asm-i386/checksum.h
+++ b/pfinet/linux-src/include/asm-i386/checksum.h
@@ -34,14 +34,14 @@ asmlinkage unsigned int csum_partial_copy_generic( const 
char *src, char *dst, i
  *     If you use these functions directly please don't forget the 
  *     verify_area().
  */
-extern __inline__
+static __inline__
 unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
                                        int len, int sum)
 {
        return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL);
 }
 
-extern __inline__
+static __inline__
 unsigned int csum_partial_copy_from_user ( const char *src, char *dst,
                                                int len, int sum, int *err_ptr)
 {
@@ -58,7 +58,7 @@ unsigned int csum_partial_copy_from_user ( const char *src, 
char *dst,
  * This combination is currently not used, but possible:
  */
 
-extern __inline__
+static __inline__
 unsigned int csum_partial_copy_to_user ( const char *src, char *dst,
                                        int len, int sum, int *err_ptr)
 {
diff --git a/pfinet/linux-src/include/linux/atalk.h 
b/pfinet/linux-src/include/linux/atalk.h
index e9d2097..491585a 100644
--- a/pfinet/linux-src/include/linux/atalk.h
+++ b/pfinet/linux-src/include/linux/atalk.h
@@ -161,7 +161,7 @@ extern void aarp_proto_init(void);
  *     Give a device find its atif control structure
  */
 
-extern __inline__ struct atalk_iface *atalk_find_dev(struct device *dev)
+static __inline__ struct atalk_iface *atalk_find_dev(struct device *dev)
 {
        return dev->atalk_ptr;
 }
diff --git a/pfinet/linux-src/include/linux/bitops.h 
b/pfinet/linux-src/include/linux/bitops.h
index ddb84dd..646edc4 100644
--- a/pfinet/linux-src/include/linux/bitops.h
+++ b/pfinet/linux-src/include/linux/bitops.h
@@ -8,7 +8,7 @@
  * differs in spirit from the above ffz (man ffs).
  */
 
-extern __inline__ int generic_ffs(int x)
+static __inline__ int generic_ffs(int x)
 {
        int r = 1;
 
@@ -42,7 +42,7 @@ extern __inline__ int generic_ffs(int x)
  * of bits set) of a N-bit word
  */
 
-extern __inline__ unsigned int generic_hweight32(unsigned int w)
+static __inline__ unsigned int generic_hweight32(unsigned int w)
 {
         unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
         res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
@@ -51,7 +51,7 @@ extern __inline__ unsigned int generic_hweight32(unsigned int 
w)
         return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
 }
 
-extern __inline__ unsigned int generic_hweight16(unsigned int w)
+static __inline__ unsigned int generic_hweight16(unsigned int w)
 {
         unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555);
         res = (res & 0x3333) + ((res >> 2) & 0x3333);
@@ -59,7 +59,7 @@ extern __inline__ unsigned int generic_hweight16(unsigned int 
w)
         return (res & 0x00FF) + ((res >> 8) & 0x00FF);
 }
 
-extern __inline__ unsigned int generic_hweight8(unsigned int w)
+static __inline__ unsigned int generic_hweight8(unsigned int w)
 {
         unsigned int res = (w & 0x55) + ((w >> 1) & 0x55);
         res = (res & 0x33) + ((res >> 2) & 0x33);
diff --git a/pfinet/linux-src/include/linux/filter.h 
b/pfinet/linux-src/include/linux/filter.h
index 58ad8b1..4978919 100644
--- a/pfinet/linux-src/include/linux/filter.h
+++ b/pfinet/linux-src/include/linux/filter.h
@@ -38,7 +38,7 @@ struct sk_filter
         struct sock_filter             insns[0];
 };
 
-extern __inline__ unsigned int sk_filter_len(struct sk_filter *fp)
+static __inline__ unsigned int sk_filter_len(struct sk_filter *fp)
 {
        return fp->len*sizeof(struct sock_filter) + sizeof(*fp);
 }
diff --git a/pfinet/linux-src/include/linux/firewall.h 
b/pfinet/linux-src/include/linux/firewall.h
index 1747f38..460fa81 100644
--- a/pfinet/linux-src/include/linux/firewall.h
+++ b/pfinet/linux-src/include/linux/firewall.h
@@ -41,17 +41,17 @@ extern int call_fw_firewall(int pf, struct device *dev, 
void *phdr, void *arg, s
 extern int call_in_firewall(int pf, struct device *dev, void *phdr, void *arg, 
struct sk_buff **pskb);
 extern int call_out_firewall(int pf, struct device *dev, void *phdr, void 
*arg, struct sk_buff **pskb);
 #else
-extern __inline__ int call_fw_firewall(int pf, struct device *dev, void *phdr, 
void *arg, struct sk_buff **skb)
+static __inline__ int call_fw_firewall(int pf, struct device *dev, void *phdr, 
void *arg, struct sk_buff **skb)
 {
        return FW_ACCEPT;
 }
 
-extern __inline__ int call_in_firewall(int pf, struct device *dev, void *phdr, 
void *arg, struct sk_buff **skb)
+static __inline__ int call_in_firewall(int pf, struct device *dev, void *phdr, 
void *arg, struct sk_buff **skb)
 {
        return FW_ACCEPT;
 }
 
-extern __inline__ int call_out_firewall(int pf, struct device *dev, void 
*phdr, void *arg, struct sk_buff **skb)
+static __inline__ int call_out_firewall(int pf, struct device *dev, void 
*phdr, void *arg, struct sk_buff **skb)
 {
        return FW_ACCEPT;
 }
diff --git a/pfinet/linux-src/include/linux/hfs_fs.h 
b/pfinet/linux-src/include/linux/hfs_fs.h
index 851bcb0..04241f7 100644
--- a/pfinet/linux-src/include/linux/hfs_fs.h
+++ b/pfinet/linux-src/include/linux/hfs_fs.h
@@ -319,12 +319,12 @@ extern void hfs_tolower(unsigned char *, int);
 #define        HFS_I(X)        (&((X)->u.hfs_i))
 #define        HFS_SB(X)       (&((X)->u.hfs_sb))
 
-extern __inline__ void hfs_nameout(struct inode *dir, struct hfs_name *out,
+static __inline__ void hfs_nameout(struct inode *dir, struct hfs_name *out,
                                   const char *in, int len) {
        HFS_SB(dir->i_sb)->s_nameout(out, in, len);
 }
 
-extern __inline__ int hfs_namein(struct inode *dir, char *out,
+static __inline__ int hfs_namein(struct inode *dir, char *out,
                                 const struct hfs_name *in) {
        int len = HFS_SB(dir->i_sb)->s_namein(out, in);
        if (HFS_SB(dir->i_sb)->s_lowercase) {
diff --git a/pfinet/linux-src/include/linux/igmp.h 
b/pfinet/linux-src/include/linux/igmp.h
index c13afde..578ab98 100644
--- a/pfinet/linux-src/include/linux/igmp.h
+++ b/pfinet/linux-src/include/linux/igmp.h
@@ -101,7 +101,7 @@ struct ip_mc_list
        char                    loaded;
 };
 
-extern __inline__ int ip_check_mc(struct device *dev, u32 mc_addr)
+static __inline__ int ip_check_mc(struct device *dev, u32 mc_addr)
 {
        struct in_device *in_dev = dev->ip_ptr;
        struct ip_mc_list *im;
diff --git a/pfinet/linux-src/include/linux/inetdevice.h 
b/pfinet/linux-src/include/linux/inetdevice.h
index 323a305..c957045 100644
--- a/pfinet/linux-src/include/linux/inetdevice.h
+++ b/pfinet/linux-src/include/linux/inetdevice.h
@@ -80,7 +80,7 @@ extern u32            inet_select_addr(struct device *dev, 
u32 dst, int scope);
 extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 
prefix, u32 mask);
 extern void            inet_forward_change(void);
 
-extern __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa)
+static __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa)
 {
        return !((addr^ifa->ifa_address)&ifa->ifa_mask);
 }
@@ -89,7 +89,7 @@ extern __inline__ int inet_ifa_match(u32 addr, struct 
in_ifaddr *ifa)
  *     Check if a mask is acceptable.
  */
  
-extern __inline__ int bad_mask(u32 mask, u32 addr)
+static __inline__ int bad_mask(u32 mask, u32 addr)
 {
        if (addr & (mask = ~mask))
                return 1;
@@ -110,14 +110,14 @@ extern __inline__ int bad_mask(u32 mask, u32 addr)
 
 #endif /* __KERNEL__ */
 
-extern __inline__ __u32 inet_make_mask(int logmask)
+static __inline__ __u32 inet_make_mask(int logmask)
 {
        if (logmask)
                return htonl(~((1<<(32-logmask))-1));
        return 0;
 }
 
-extern __inline__ int inet_mask_len(__u32 mask)
+static __inline__ int inet_mask_len(__u32 mask)
 {
        if (!(mask = ntohl(mask)))
                return 0;
diff --git a/pfinet/linux-src/include/linux/ipsec.h 
b/pfinet/linux-src/include/linux/ipsec.h
index b9d7bcc..2ccf61d 100644
--- a/pfinet/linux-src/include/linux/ipsec.h
+++ b/pfinet/linux-src/include/linux/ipsec.h
@@ -49,7 +49,7 @@
  */
  
 #ifdef CONFIG_NET_SECURITY
-extern __inline__ int ipsec_sk_policy(struct sock *sk, struct sk_buff *skb)
+static __inline__ int ipsec_sk_policy(struct sock *sk, struct sk_buff *skb)
 {
        return ((sk->authentication < IPSEC_LEVEL_REQUIRE) ||
                (skb->security & RCV_AUTH)) &&
@@ -59,7 +59,7 @@ extern __inline__ int ipsec_sk_policy(struct sock *sk, struct 
sk_buff *skb)
 
 #else
 
-extern __inline__ int ipsec_sk_policy(struct sock *sk, struct sk_buff *skb)
+static __inline__ int ipsec_sk_policy(struct sock *sk, struct sk_buff *skb)
 {
        return 1;
 }
diff --git a/pfinet/linux-src/include/linux/netdevice.h 
b/pfinet/linux-src/include/linux/netdevice.h
index 0b6af20..6ca7312 100644
--- a/pfinet/linux-src/include/linux/netdevice.h
+++ b/pfinet/linux-src/include/linux/netdevice.h
@@ -362,7 +362,7 @@ extern int          dev_restart(struct device *dev);
 
 typedef int gifconf_func_t(struct device * dev, char * bufptr, int len);
 extern int             register_gifconf(unsigned int family, gifconf_func_t * 
gifconf);
-extern __inline__ int unregister_gifconf(unsigned int family)
+static __inline__ int unregister_gifconf(unsigned int family)
 {
        return register_gifconf(family, 0);
 }
@@ -388,12 +388,12 @@ extern atomic_t           dev_lockct;
  *     but they may do soon. Do it properly anyway.
  */
 
-extern __inline__ void  dev_lock_list(void)
+static __inline__ void  dev_lock_list(void)
 {
        atomic_inc(&dev_lockct);
 }
 
-extern __inline__ void  dev_unlock_list(void)
+static __inline__ void  dev_unlock_list(void)
 {
        atomic_dec(&dev_lockct);
 }
@@ -409,7 +409,7 @@ extern __inline__ void  dev_unlock_list(void)
  *             is not atomic.
  */
 
-extern __inline__ void dev_lock_wait(void)
+static __inline__ void dev_lock_wait(void)
 {
        while (atomic_read(&dev_lockct)) {
                current->policy |= SCHED_YIELD;
@@ -417,7 +417,7 @@ extern __inline__ void dev_lock_wait(void)
        }
 }
 
-extern __inline__ void dev_init_buffers(struct device *dev)
+static __inline__ void dev_init_buffers(struct device *dev)
 {
        /* DO NOTHING */
 }
diff --git a/pfinet/linux-src/include/linux/netlink.h 
b/pfinet/linux-src/include/linux/netlink.h
index 59075b0..e2525ce 100644
--- a/pfinet/linux-src/include/linux/netlink.h
+++ b/pfinet/linux-src/include/linux/netlink.h
@@ -126,7 +126,7 @@ struct netlink_callback
        long            args[4];
 };
 
-extern __inline__ struct nlmsghdr *
+static __inline__ struct nlmsghdr *
 __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len)
 {
        struct nlmsghdr *nlh;
diff --git a/pfinet/linux-src/include/linux/notifier.h 
b/pfinet/linux-src/include/linux/notifier.h
index 1e8bf70..633f61a 100644
--- a/pfinet/linux-src/include/linux/notifier.h
+++ b/pfinet/linux-src/include/linux/notifier.h
@@ -26,7 +26,7 @@ struct notifier_block
 #define NOTIFY_STOP_MASK       0x8000          /* Don't call further */
 #define NOTIFY_BAD             (NOTIFY_STOP_MASK|0x0002)       /* Bad/Veto 
action      */
 
-extern __inline__ int notifier_chain_register(struct notifier_block **list, 
struct notifier_block *n)
+static __inline__ int notifier_chain_register(struct notifier_block **list, 
struct notifier_block *n)
 {
        while(*list)
        {
@@ -44,7 +44,7 @@ extern __inline__ int notifier_chain_register(struct 
notifier_block **list, stru
  *     GPL'd
  */
  
-extern __inline__ int notifier_chain_unregister(struct notifier_block **nl, 
struct notifier_block *n)
+static __inline__ int notifier_chain_unregister(struct notifier_block **nl, 
struct notifier_block *n)
 {
        while((*nl)!=NULL)
        {
@@ -62,7 +62,7 @@ extern __inline__ int notifier_chain_unregister(struct 
notifier_block **nl, stru
  *     This is one of these things that is generally shorter inline
  */
  
-extern __inline__ int notifier_call_chain(struct notifier_block **n, unsigned 
long val, void *v)
+static __inline__ int notifier_call_chain(struct notifier_block **n, unsigned 
long val, void *v)
 {
        int ret=NOTIFY_DONE;
        struct notifier_block *nb = *n;
diff --git a/pfinet/linux-src/include/linux/parport.h 
b/pfinet/linux-src/include/linux/parport.h
index 856fc01..3712ce1 100644
--- a/pfinet/linux-src/include/linux/parport.h
+++ b/pfinet/linux-src/include/linux/parport.h
@@ -277,7 +277,7 @@ extern void parport_release(struct pardevice *dev);
 /* parport_yield relinquishes the port if it would be helpful to other
  * drivers.  The return value is the same as for parport_claim.
  */
-extern __inline__ int parport_yield(struct pardevice *dev)
+static __inline__ int parport_yield(struct pardevice *dev)
 {
        unsigned long int timeslip = (jiffies - dev->time);
        if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice))
@@ -289,7 +289,7 @@ extern __inline__ int parport_yield(struct pardevice *dev)
 /* parport_yield_blocking is the same but uses parport_claim_or_block
  * instead of parport_claim.
  */
-extern __inline__ int parport_yield_blocking(struct pardevice *dev)
+static __inline__ int parport_yield_blocking(struct pardevice *dev)
 {
        unsigned long int timeslip = (jiffies - dev->time);
        if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice))
@@ -301,7 +301,7 @@ extern __inline__ int parport_yield_blocking(struct 
pardevice *dev)
 /*
  * Lowlevel drivers _can_ call this support function to handle irqs.
  */
-extern __inline__ void parport_generic_irq(int irq, struct parport *port,
+static __inline__ void parport_generic_irq(int irq, struct parport *port,
                                           struct pt_regs *regs)
 {
        read_lock(&port->cad_lock);
diff --git a/pfinet/linux-src/include/linux/parport_pc.h 
b/pfinet/linux-src/include/linux/parport_pc.h
index f7ef340..c040693 100644
--- a/pfinet/linux-src/include/linux/parport_pc.h
+++ b/pfinet/linux-src/include/linux/parport_pc.h
@@ -25,27 +25,27 @@ extern int parport_pc_epp_clear_timeout(struct parport *pb);
 
 extern volatile unsigned char parport_pc_ctr;
 
-extern __inline__ void parport_pc_write_epp(struct parport *p, unsigned char d)
+static __inline__ void parport_pc_write_epp(struct parport *p, unsigned char d)
 {
        outb(d, EPPDATA(p));
 }
 
-extern __inline__ unsigned char parport_pc_read_epp(struct parport *p)
+static __inline__ unsigned char parport_pc_read_epp(struct parport *p)
 {
        return inb(EPPDATA(p));
 }
 
-extern __inline__ void parport_pc_write_epp_addr(struct parport *p, unsigned 
char d)
+static __inline__ void parport_pc_write_epp_addr(struct parport *p, unsigned 
char d)
 {
        outb(d, EPPADDR(p));
 }
 
-extern __inline__ unsigned char parport_pc_read_epp_addr(struct parport *p)
+static __inline__ unsigned char parport_pc_read_epp_addr(struct parport *p)
 {
        return inb(EPPADDR(p));
 }
 
-extern __inline__ int parport_pc_check_epp_timeout(struct parport *p)
+static __inline__ int parport_pc_check_epp_timeout(struct parport *p)
 {
        if (!(inb(STATUS(p)) & 1))
                return 0;
@@ -53,35 +53,35 @@ extern __inline__ int parport_pc_check_epp_timeout(struct 
parport *p)
        return 1;
 }
 
-extern __inline__ unsigned char parport_pc_read_configb(struct parport *p)
+static __inline__ unsigned char parport_pc_read_configb(struct parport *p)
 {
        return inb(CONFIGB(p));
 }
 
-extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char 
d)
+static __inline__ void parport_pc_write_data(struct parport *p, unsigned char 
d)
 {
        outb(d, DATA(p));
 }
 
-extern __inline__ unsigned char parport_pc_read_data(struct parport *p)
+static __inline__ unsigned char parport_pc_read_data(struct parport *p)
 {
        return inb(DATA(p));
 }
 
-extern __inline__ void parport_pc_write_control(struct parport *p, unsigned 
char d)
+static __inline__ void parport_pc_write_control(struct parport *p, unsigned 
char d)
 {
        struct parport_pc_private *priv = p->private_data;
        priv->ctr = d;/* update soft copy */
        outb(d, CONTROL(p));
 }
 
-extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
+static __inline__ unsigned char parport_pc_read_control(struct parport *p)
 {
        struct parport_pc_private *priv = p->private_data;
        return priv->ctr;
 }
 
-extern __inline__ unsigned char parport_pc_frob_control(struct parport *p, 
unsigned char mask,  unsigned char val)
+static __inline__ unsigned char parport_pc_frob_control(struct parport *p, 
unsigned char mask,  unsigned char val)
 {
        struct parport_pc_private *priv = p->private_data;
        unsigned char ctr = priv->ctr;
@@ -90,27 +90,27 @@ extern __inline__ unsigned char 
parport_pc_frob_control(struct parport *p, unsig
        return priv->ctr = ctr; /* update soft copy */
 }
 
-extern __inline__ void parport_pc_write_status(struct parport *p, unsigned 
char d)
+static __inline__ void parport_pc_write_status(struct parport *p, unsigned 
char d)
 {
        outb(d, STATUS(p));
 }
 
-extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
+static __inline__ unsigned char parport_pc_read_status(struct parport *p)
 {
        return inb(STATUS(p));
 }
 
-extern __inline__ void parport_pc_write_econtrol(struct parport *p, unsigned 
char d)
+static __inline__ void parport_pc_write_econtrol(struct parport *p, unsigned 
char d)
 {
        outb(d, ECONTROL(p));
 }
 
-extern __inline__ unsigned char parport_pc_read_econtrol(struct parport *p)
+static __inline__ unsigned char parport_pc_read_econtrol(struct parport *p)
 {
        return inb(ECONTROL(p));
 }
 
-extern __inline__ unsigned char parport_pc_frob_econtrol(struct parport *p, 
unsigned char mask,  unsigned char val)
+static __inline__ unsigned char parport_pc_frob_econtrol(struct parport *p, 
unsigned char mask,  unsigned char val)
 {
        unsigned char old = inb(ECONTROL(p));
        outb(((old & ~mask) ^ val), ECONTROL(p));
diff --git a/pfinet/linux-src/include/linux/quotaops.h 
b/pfinet/linux-src/include/linux/quotaops.h
index bb76e71..ffa500c 100644
--- a/pfinet/linux-src/include/linux/quotaops.h
+++ b/pfinet/linux-src/include/linux/quotaops.h
@@ -37,13 +37,13 @@ extern int  dquot_transfer(struct dentry *dentry, struct 
iattr *iattr,
 /*
  * Operations supported for diskquotas.
  */
-extern __inline__ void DQUOT_INIT(struct inode *inode)
+static __inline__ void DQUOT_INIT(struct inode *inode)
 {
        if (inode->i_sb && inode->i_sb->dq_op)
                inode->i_sb->dq_op->initialize(inode, -1);
 }
 
-extern __inline__ void DQUOT_DROP(struct inode *inode)
+static __inline__ void DQUOT_DROP(struct inode *inode)
 {
        if (IS_QUOTAINIT(inode)) {
                if (inode->i_sb && inode->i_sb->dq_op)
@@ -51,7 +51,7 @@ extern __inline__ void DQUOT_DROP(struct inode *inode)
        }
 }
 
-extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const 
struct inode *inode, int nr)
+static __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const 
struct inode *inode, int nr)
 {
        if (sb->dq_op) {
                if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, 
sb->s_blocksize),
@@ -61,7 +61,7 @@ extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block 
*sb, const struct
        return 0;
 }
 
-extern __inline__ int DQUOT_ALLOC_BLOCK(struct super_block *sb, const struct 
inode *inode, int nr)
+static __inline__ int DQUOT_ALLOC_BLOCK(struct super_block *sb, const struct 
inode *inode, int nr)
 {
        if (sb->dq_op) {
                if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, 
sb->s_blocksize),
@@ -71,7 +71,7 @@ extern __inline__ int DQUOT_ALLOC_BLOCK(struct super_block 
*sb, const struct ino
        return 0;
 }
 
-extern __inline__ int DQUOT_ALLOC_INODE(struct super_block *sb, struct inode 
*inode)
+static __inline__ int DQUOT_ALLOC_INODE(struct super_block *sb, struct inode 
*inode)
 {
        if (sb->dq_op) {
                sb->dq_op->initialize (inode, -1);
@@ -82,19 +82,19 @@ extern __inline__ int DQUOT_ALLOC_INODE(struct super_block 
*sb, struct inode *in
        return 0;
 }
 
-extern __inline__ void DQUOT_FREE_BLOCK(struct super_block *sb, const struct 
inode *inode, int nr)
+static __inline__ void DQUOT_FREE_BLOCK(struct super_block *sb, const struct 
inode *inode, int nr)
 {
        if (sb->dq_op)
                sb->dq_op->free_block(inode, fs_to_dq_blocks(nr, 
sb->s_blocksize));
 }
 
-extern __inline__ void DQUOT_FREE_INODE(struct super_block *sb, struct inode 
*inode)
+static __inline__ void DQUOT_FREE_INODE(struct super_block *sb, struct inode 
*inode)
 {
        if (sb->dq_op)
                sb->dq_op->free_inode(inode, 1);
 }
 
-extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr 
*iattr)
+static __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr 
*iattr)
 {
        int error = -EDQUOT;
 
diff --git a/pfinet/linux-src/include/linux/rtnetlink.h 
b/pfinet/linux-src/include/linux/rtnetlink.h
index 548a9b1..ae52903 100644
--- a/pfinet/linux-src/include/linux/rtnetlink.h
+++ b/pfinet/linux-src/include/linux/rtnetlink.h
@@ -515,7 +515,7 @@ enum
 extern atomic_t rtnl_rlockct;
 extern struct wait_queue *rtnl_wait;
 
-extern __inline__ int rtattr_strcmp(struct rtattr *rta, char *str)
+static __inline__ int rtattr_strcmp(struct rtattr *rta, char *str)
 {
        int len = strlen(str) + 1;
        return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
@@ -563,7 +563,7 @@ extern unsigned long rtnl_wlockct;
  * useful thing. --ANK
  */
 
-extern __inline__ int rtnl_shlock_nowait(void)
+static __inline__ int rtnl_shlock_nowait(void)
 {
        atomic_inc(&rtnl_rlockct);
        if (test_bit(0, &rtnl_wlockct)) {
@@ -573,7 +573,7 @@ extern __inline__ int rtnl_shlock_nowait(void)
        return 0;
 }
 
-extern __inline__ void rtnl_shlock(void)
+static __inline__ void rtnl_shlock(void)
 {
        while (rtnl_shlock_nowait())
                sleep_on(&rtnl_wait);
@@ -583,7 +583,7 @@ extern __inline__ void rtnl_shlock(void)
    Shared lock must be already grabbed with rtnl_shlock*().
  */
 
-extern __inline__ int rtnl_exlock_nowait(void)
+static __inline__ int rtnl_exlock_nowait(void)
 {
        if (atomic_read(&rtnl_rlockct) > 1)
                return -EAGAIN;
@@ -592,14 +592,14 @@ extern __inline__ int rtnl_exlock_nowait(void)
        return 0;
 }
 
-extern __inline__ void rtnl_exlock(void)
+static __inline__ void rtnl_exlock(void)
 {
        while (rtnl_exlock_nowait())
                sleep_on(&rtnl_wait);
 }
 
 #if 0
-extern __inline__ void rtnl_shunlock(void)
+static __inline__ void rtnl_shunlock(void)
 {
        atomic_dec(&rtnl_rlockct);
        if (atomic_read(&rtnl_rlockct) <= 1) {
@@ -628,7 +628,7 @@ extern __inline__ void rtnl_shunlock(void)
  * it will be done later after releasing shared lock.
  */
 
-extern __inline__ void rtnl_exunlock(void)
+static __inline__ void rtnl_exunlock(void)
 {
        clear_bit(0, &rtnl_wlockct);
        wake_up(&rtnl_wait);
@@ -636,7 +636,7 @@ extern __inline__ void rtnl_exunlock(void)
 
 #else
 
-extern __inline__ void rtnl_shlock(void)
+static __inline__ void rtnl_shlock(void)
 {
 #ifndef _HURD_
        while (atomic_read(&rtnl_rlockct))
@@ -645,7 +645,7 @@ extern __inline__ void rtnl_shlock(void)
 #endif
 }
 
-extern __inline__ void rtnl_shunlock(void)
+static __inline__ void rtnl_shunlock(void)
 {
 #ifndef _HURD_
        if (atomic_dec_and_test(&rtnl_rlockct))
@@ -653,11 +653,11 @@ extern __inline__ void rtnl_shunlock(void)
 #endif
 }
 
-extern __inline__ void rtnl_exlock(void)
+static __inline__ void rtnl_exlock(void)
 {
 }
 
-extern __inline__ void rtnl_exunlock(void)
+static __inline__ void rtnl_exunlock(void)
 {
 }
 
diff --git a/pfinet/linux-src/include/linux/sched.h 
b/pfinet/linux-src/include/linux/sched.h
index d983c17..c0e54d8 100644
--- a/pfinet/linux-src/include/linux/sched.h
+++ b/pfinet/linux-src/include/linux/sched.h
@@ -410,7 +410,7 @@ extern struct task_struct *task[NR_TASKS];
 extern struct task_struct **tarray_freelist;
 extern spinlock_t taskslot_lock;
 
-extern __inline__ void add_free_taskslot(struct task_struct **t)
+static __inline__ void add_free_taskslot(struct task_struct **t)
 {
        spin_lock(&taskslot_lock);
        *t = (struct task_struct *) tarray_freelist;
@@ -418,7 +418,7 @@ extern __inline__ void add_free_taskslot(struct task_struct 
**t)
        spin_unlock(&taskslot_lock);
 }
 
-extern __inline__ struct task_struct **get_free_taskslot(void)
+static __inline__ struct task_struct **get_free_taskslot(void)
 {
        struct task_struct **tslot;
 
@@ -436,7 +436,7 @@ extern struct task_struct *pidhash[PIDHASH_SZ];
 
 #define pid_hashfn(x)  ((((x) >> 8) ^ (x)) & (PIDHASH_SZ - 1))
 
-extern __inline__ void hash_pid(struct task_struct *p)
+static __inline__ void hash_pid(struct task_struct *p)
 {
        struct task_struct **htable = &pidhash[pid_hashfn(p->pid)];
 
@@ -446,14 +446,14 @@ extern __inline__ void hash_pid(struct task_struct *p)
        p->pidhash_pprev = htable;
 }
 
-extern __inline__ void unhash_pid(struct task_struct *p)
+static __inline__ void unhash_pid(struct task_struct *p)
 {
        if(p->pidhash_next)
                p->pidhash_next->pidhash_pprev = p->pidhash_pprev;
        *p->pidhash_pprev = p->pidhash_next;
 }
 
-extern __inline__ struct task_struct *find_task_by_pid(int pid)
+static __inline__ struct task_struct *find_task_by_pid(int pid)
 {
        struct task_struct *p, **htable = &pidhash[pid_hashfn(pid)];
 
diff --git a/pfinet/linux-src/include/linux/skbuff.h 
b/pfinet/linux-src/include/linux/skbuff.h
index 82d5da6..452cbda 100644
--- a/pfinet/linux-src/include/linux/skbuff.h
+++ b/pfinet/linux-src/include/linux/skbuff.h
@@ -134,62 +134,46 @@ struct sk_buff {
 #include <asm/system.h>
 
 extern void                    __kfree_skb(struct sk_buff *skb);
-extern void                    skb_queue_head_init(struct sk_buff_head *list);
-extern void                    skb_queue_head(struct sk_buff_head *list,struct 
sk_buff *buf);
-extern void                    skb_queue_tail(struct sk_buff_head *list,struct 
sk_buff *buf);
-extern struct sk_buff *                skb_dequeue(struct sk_buff_head *list);
-extern void                    skb_insert(struct sk_buff *old,struct sk_buff 
*newsk);
-extern void                    skb_append(struct sk_buff *old,struct sk_buff 
*newsk);
-extern void                    skb_unlink(struct sk_buff *buf);
-extern __u32                   skb_queue_len(struct sk_buff_head *list);
 extern struct sk_buff *                skb_peek_copy(struct sk_buff_head 
*list);
 extern struct sk_buff *                alloc_skb(unsigned int size, int 
priority);
-extern struct sk_buff *                dev_alloc_skb(unsigned int size);
 extern void                    kfree_skbmem(struct sk_buff *skb);
 extern struct sk_buff *                skb_clone(struct sk_buff *skb, int 
priority);
 extern struct sk_buff *                skb_copy(struct sk_buff *skb, int 
priority);
 extern struct sk_buff *                skb_realloc_headroom(struct sk_buff 
*skb, int newheadroom);
 #define dev_kfree_skb(a)       kfree_skb(a)
-extern unsigned char *         skb_put(struct sk_buff *skb, unsigned int len);
-extern unsigned char *         skb_push(struct sk_buff *skb, unsigned int len);
-extern unsigned char *         skb_pull(struct sk_buff *skb, unsigned int len);
-extern int                     skb_headroom(struct sk_buff *skb);
-extern int                     skb_tailroom(struct sk_buff *skb);
-extern void                    skb_reserve(struct sk_buff *skb, unsigned int 
len);
-extern void                    skb_trim(struct sk_buff *skb, unsigned int len);
 extern void    skb_over_panic(struct sk_buff *skb, int len, void *here);
 extern void    skb_under_panic(struct sk_buff *skb, int len, void *here);
 
 /* Internal */
-extern __inline__ atomic_t *skb_datarefp(struct sk_buff *skb)
+static __inline__ atomic_t *skb_datarefp(struct sk_buff *skb)
 {
        return (atomic_t *)(skb->end);
 }
 
-extern __inline__ int skb_queue_empty(struct sk_buff_head *list)
+static __inline__ int skb_queue_empty(struct sk_buff_head *list)
 {
        return (list->next == (struct sk_buff *) list);
 }
 
-extern __inline__ void kfree_skb(struct sk_buff *skb)
+static __inline__ void kfree_skb(struct sk_buff *skb)
 {
        if (atomic_dec_and_test(&skb->users))
                __kfree_skb(skb);
 }
 
 /* Use this if you didn't touch the skb state [for fast switching] */
-extern __inline__ void kfree_skb_fast(struct sk_buff *skb)
+static __inline__ void kfree_skb_fast(struct sk_buff *skb)
 {
        if (atomic_dec_and_test(&skb->users))
                kfree_skbmem(skb);      
 }
 
-extern __inline__ int skb_cloned(struct sk_buff *skb)
+static __inline__ int skb_cloned(struct sk_buff *skb)
 {
        return skb->cloned && atomic_read(skb_datarefp(skb)) != 1;
 }
 
-extern __inline__ int skb_shared(struct sk_buff *skb)
+static __inline__ int skb_shared(struct sk_buff *skb)
 {
        return (atomic_read(&skb->users) != 1);
 }
@@ -201,7 +185,7 @@ extern __inline__ int skb_shared(struct sk_buff *skb)
  *     a packet thats being forwarded.
  */
  
-extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri)
+static __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri)
 {
        struct sk_buff *nskb;
        if(!skb_cloned(skb))
@@ -218,7 +202,7 @@ extern __inline__ struct sk_buff *skb_unshare(struct 
sk_buff *skb, int pri)
  *     type system cli() peek the buffer copy the data and sti();
  */
  
-extern __inline__ struct sk_buff *skb_peek(struct sk_buff_head *list_)
+static __inline__ struct sk_buff *skb_peek(struct sk_buff_head *list_)
 {
        struct sk_buff *list = ((struct sk_buff *)list_)->next;
        if (list == (struct sk_buff *)list_)
@@ -226,7 +210,7 @@ extern __inline__ struct sk_buff *skb_peek(struct 
sk_buff_head *list_)
        return list;
 }
 
-extern __inline__ struct sk_buff *skb_peek_tail(struct sk_buff_head *list_)
+static __inline__ struct sk_buff *skb_peek_tail(struct sk_buff_head *list_)
 {
        struct sk_buff *list = ((struct sk_buff *)list_)->prev;
        if (list == (struct sk_buff *)list_)
@@ -238,12 +222,12 @@ extern __inline__ struct sk_buff *skb_peek_tail(struct 
sk_buff_head *list_)
  *     Return the length of an sk_buff queue
  */
  
-extern __inline__ __u32 skb_queue_len(struct sk_buff_head *list_)
+static __inline__ __u32 skb_queue_len(struct sk_buff_head *list_)
 {
        return(list_->qlen);
 }
 
-extern __inline__ void skb_queue_head_init(struct sk_buff_head *list)
+static __inline__ void skb_queue_head_init(struct sk_buff_head *list)
 {
        list->prev = (struct sk_buff *)list;
        list->next = (struct sk_buff *)list;
@@ -257,7 +241,7 @@ extern __inline__ void skb_queue_head_init(struct 
sk_buff_head *list)
  *     can only be called with interrupts disabled.
  */
 
-extern __inline__ void __skb_queue_head(struct sk_buff_head *list, struct 
sk_buff *newsk)
+static __inline__ void __skb_queue_head(struct sk_buff_head *list, struct 
sk_buff *newsk)
 {
        struct sk_buff *prev, *next;
 
@@ -273,7 +257,7 @@ extern __inline__ void __skb_queue_head(struct sk_buff_head 
*list, struct sk_buf
 
 extern spinlock_t skb_queue_lock;
 
-extern __inline__ void skb_queue_head(struct sk_buff_head *list, struct 
sk_buff *newsk)
+static __inline__ void skb_queue_head(struct sk_buff_head *list, struct 
sk_buff *newsk)
 {
        unsigned long flags;
 
@@ -286,7 +270,7 @@ extern __inline__ void skb_queue_head(struct sk_buff_head 
*list, struct sk_buff
  *     Insert an sk_buff at the end of a list.
  */
 
-extern __inline__ void __skb_queue_tail(struct sk_buff_head *list, struct 
sk_buff *newsk)
+static __inline__ void __skb_queue_tail(struct sk_buff_head *list, struct 
sk_buff *newsk)
 {
        struct sk_buff *prev, *next;
 
@@ -300,7 +284,7 @@ extern __inline__ void __skb_queue_tail(struct sk_buff_head 
*list, struct sk_buf
        prev->next = newsk;
 }
 
-extern __inline__ void skb_queue_tail(struct sk_buff_head *list, struct 
sk_buff *newsk)
+static __inline__ void skb_queue_tail(struct sk_buff_head *list, struct 
sk_buff *newsk)
 {
        unsigned long flags;
 
@@ -313,7 +297,7 @@ extern __inline__ void skb_queue_tail(struct sk_buff_head 
*list, struct sk_buff
  *     Remove an sk_buff from a list.
  */
 
-extern __inline__ struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
+static __inline__ struct sk_buff *__skb_dequeue(struct sk_buff_head *list)
 {
        struct sk_buff *next, *prev, *result;
 
@@ -333,7 +317,7 @@ extern __inline__ struct sk_buff *__skb_dequeue(struct 
sk_buff_head *list)
        return result;
 }
 
-extern __inline__ struct sk_buff *skb_dequeue(struct sk_buff_head *list)
+static __inline__ struct sk_buff *skb_dequeue(struct sk_buff_head *list)
 {
        long flags;
        struct sk_buff *result;
@@ -348,7 +332,7 @@ extern __inline__ struct sk_buff *skb_dequeue(struct 
sk_buff_head *list)
  *     Insert a packet on a list.
  */
 
-extern __inline__ void __skb_insert(struct sk_buff *newsk,
+static __inline__ void __skb_insert(struct sk_buff *newsk,
        struct sk_buff * prev, struct sk_buff *next,
        struct sk_buff_head * list)
 {
@@ -363,7 +347,7 @@ extern __inline__ void __skb_insert(struct sk_buff *newsk,
 /*
  *     Place a packet before a given packet in a list
  */
-extern __inline__ void skb_insert(struct sk_buff *old, struct sk_buff *newsk)
+static __inline__ void skb_insert(struct sk_buff *old, struct sk_buff *newsk)
 {
        unsigned long flags;
 
@@ -376,12 +360,12 @@ extern __inline__ void skb_insert(struct sk_buff *old, 
struct sk_buff *newsk)
  *     Place a packet after a given packet in a list.
  */
 
-extern __inline__ void __skb_append(struct sk_buff *old, struct sk_buff *newsk)
+static __inline__ void __skb_append(struct sk_buff *old, struct sk_buff *newsk)
 {
        __skb_insert(newsk, old, old->next, old->list);
 }
 
-extern __inline__ void skb_append(struct sk_buff *old, struct sk_buff *newsk)
+static __inline__ void skb_append(struct sk_buff *old, struct sk_buff *newsk)
 {
        unsigned long flags;
 
@@ -394,7 +378,7 @@ extern __inline__ void skb_append(struct sk_buff *old, 
struct sk_buff *newsk)
  * remove sk_buff from list. _Must_ be called atomically, and with
  * the list known..
  */
-extern __inline__ void __skb_unlink(struct sk_buff *skb, struct sk_buff_head 
*list)
+static __inline__ void __skb_unlink(struct sk_buff *skb, struct sk_buff_head 
*list)
 {
        struct sk_buff * next, * prev;
 
@@ -415,7 +399,7 @@ extern __inline__ void __skb_unlink(struct sk_buff *skb, 
struct sk_buff_head *li
  *     _FIRST_.
  */
 
-extern __inline__ void skb_unlink(struct sk_buff *skb)
+static __inline__ void skb_unlink(struct sk_buff *skb)
 {
        unsigned long flags;
 
@@ -426,7 +410,7 @@ extern __inline__ void skb_unlink(struct sk_buff *skb)
 }
 
 /* XXX: more streamlined implementation */
-extern __inline__ struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list)
+static __inline__ struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list)
 {
        struct sk_buff *skb = skb_peek_tail(list); 
        if (skb)
@@ -434,7 +418,7 @@ extern __inline__ struct sk_buff *__skb_dequeue_tail(struct 
sk_buff_head *list)
        return skb;
 }
 
-extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list)
+static __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list)
 {
        long flags;
        struct sk_buff *result;
@@ -449,7 +433,7 @@ extern __inline__ struct sk_buff *skb_dequeue_tail(struct 
sk_buff_head *list)
  *     Add data to an sk_buff
  */
  
-extern __inline__ unsigned char *__skb_put(struct sk_buff *skb, unsigned int 
len)
+static __inline__ unsigned char *__skb_put(struct sk_buff *skb, unsigned int 
len)
 {
        unsigned char *tmp=skb->tail;
        skb->tail+=len;
@@ -457,7 +441,7 @@ extern __inline__ unsigned char *__skb_put(struct sk_buff 
*skb, unsigned int len
        return tmp;
 }
 
-extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
+static __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
 {
        unsigned char *tmp=skb->tail;
        skb->tail+=len;
@@ -471,14 +455,14 @@ here:             ;
        return tmp;
 }
 
-extern __inline__ unsigned char *__skb_push(struct sk_buff *skb, unsigned int 
len)
+static __inline__ unsigned char *__skb_push(struct sk_buff *skb, unsigned int 
len)
 {
        skb->data-=len;
        skb->len+=len;
        return skb->data;
 }
 
-extern __inline__ unsigned char *skb_push(struct sk_buff *skb, unsigned int 
len)
+static __inline__ unsigned char *skb_push(struct sk_buff *skb, unsigned int 
len)
 {
        skb->data-=len;
        skb->len+=len;
@@ -491,49 +475,49 @@ here:             ;
        return skb->data;
 }
 
-extern __inline__ char *__skb_pull(struct sk_buff *skb, unsigned int len)
+static __inline__ char *__skb_pull(struct sk_buff *skb, unsigned int len)
 {
        skb->len-=len;
        return  skb->data+=len;
 }
 
-extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int 
len)
+static __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int 
len)
 {      
        if (len > skb->len)
                return NULL;
        return __skb_pull(skb,len);
 }
 
-extern __inline__ int skb_headroom(struct sk_buff *skb)
+static __inline__ int skb_headroom(struct sk_buff *skb)
 {
        return skb->data-skb->head;
 }
 
-extern __inline__ int skb_tailroom(struct sk_buff *skb)
+static __inline__ int skb_tailroom(struct sk_buff *skb)
 {
        return skb->end-skb->tail;
 }
 
-extern __inline__ void skb_reserve(struct sk_buff *skb, unsigned int len)
+static __inline__ void skb_reserve(struct sk_buff *skb, unsigned int len)
 {
        skb->data+=len;
        skb->tail+=len;
 }
 
-extern __inline__ void __skb_trim(struct sk_buff *skb, unsigned int len)
+static __inline__ void __skb_trim(struct sk_buff *skb, unsigned int len)
 {
        skb->len = len;
        skb->tail = skb->data+len;
 }
 
-extern __inline__ void skb_trim(struct sk_buff *skb, unsigned int len)
+static __inline__ void skb_trim(struct sk_buff *skb, unsigned int len)
 {
        if (skb->len > len) {
                __skb_trim(skb, len);
        }
 }
 
-extern __inline__ void skb_orphan(struct sk_buff *skb)
+static __inline__ void skb_orphan(struct sk_buff *skb)
 {
        if (skb->destructor)
                skb->destructor(skb);
@@ -541,14 +525,14 @@ extern __inline__ void skb_orphan(struct sk_buff *skb)
        skb->sk = NULL;
 }
 
-extern __inline__ void skb_queue_purge(struct sk_buff_head *list)
+static __inline__ void skb_queue_purge(struct sk_buff_head *list)
 {
        struct sk_buff *skb;
        while ((skb=skb_dequeue(list))!=NULL)
                kfree_skb(skb);
 }
 
-extern __inline__ struct sk_buff *dev_alloc_skb(unsigned int length)
+static __inline__ struct sk_buff *dev_alloc_skb(unsigned int length)
 {
        struct sk_buff *skb;
 
@@ -558,7 +542,7 @@ extern __inline__ struct sk_buff *dev_alloc_skb(unsigned 
int length)
        return skb;
 }
 
-extern __inline__ struct sk_buff *
+static __inline__ struct sk_buff *
 skb_cow(struct sk_buff *skb, unsigned int headroom)
 {
        headroom = (headroom+15)&~15;
diff --git a/pfinet/linux-src/include/linux/tqueue.h 
b/pfinet/linux-src/include/linux/tqueue.h
index d886f75..b75892b 100644
--- a/pfinet/linux-src/include/linux/tqueue.h
+++ b/pfinet/linux-src/include/linux/tqueue.h
@@ -80,7 +80,7 @@ extern spinlock_t tqueue_lock;
 /*
  * queue_task
  */
-extern __inline__ void queue_task(struct tq_struct *bh_pointer,
+static __inline__ void queue_task(struct tq_struct *bh_pointer,
                           task_queue *bh_list)
 {
        if (!test_and_set_bit(0,&bh_pointer->sync)) {
@@ -95,7 +95,7 @@ extern __inline__ void queue_task(struct tq_struct 
*bh_pointer,
 /*
  * Call all "bottom halfs" on a given list.
  */
-extern __inline__ void run_task_queue(task_queue *list)
+static __inline__ void run_task_queue(task_queue *list)
 {
        if (*list) {
                unsigned long flags;
diff --git a/pfinet/linux-src/include/net/addrconf.h 
b/pfinet/linux-src/include/net/addrconf.h
index 4b27077..d54f5e7 100644
--- a/pfinet/linux-src/include/net/addrconf.h
+++ b/pfinet/linux-src/include/net/addrconf.h
@@ -119,7 +119,7 @@ static __inline__ int ipv6_devindex_hash(int ifindex)
  *     compute link-local solicited-node multicast address
  */
 
-extern __inline__ void addrconf_addr_solict_mult_old(struct in6_addr *addr,
+static __inline__ void addrconf_addr_solict_mult_old(struct in6_addr *addr,
                                                     struct in6_addr *solicited)
 {
        ipv6_addr_set(solicited,
@@ -127,7 +127,7 @@ extern __inline__ void addrconf_addr_solict_mult_old(struct 
in6_addr *addr,
                      __constant_htonl(0x1), addr->s6_addr32[3]);
 }
 
-extern __inline__ void addrconf_addr_solict_mult_new(struct in6_addr *addr,
+static __inline__ void addrconf_addr_solict_mult_new(struct in6_addr *addr,
                                                     struct in6_addr *solicited)
 {
        ipv6_addr_set(solicited,
@@ -137,21 +137,21 @@ extern __inline__ void 
addrconf_addr_solict_mult_new(struct in6_addr *addr,
 }
 
 
-extern __inline__ void ipv6_addr_all_nodes(struct in6_addr *addr)
+static __inline__ void ipv6_addr_all_nodes(struct in6_addr *addr)
 {
        ipv6_addr_set(addr,
                      __constant_htonl(0xFF020000), 0, 0,
                      __constant_htonl(0x1));
 }
 
-extern __inline__ void ipv6_addr_all_routers(struct in6_addr *addr)
+static __inline__ void ipv6_addr_all_routers(struct in6_addr *addr)
 {
        ipv6_addr_set(addr,
                      __constant_htonl(0xFF020000), 0, 0,
                      __constant_htonl(0x2));
 }
 
-extern __inline__ int ipv6_addr_is_multicast(struct in6_addr *addr)
+static __inline__ int ipv6_addr_is_multicast(struct in6_addr *addr)
 {
        return (addr->s6_addr32[0] & __constant_htonl(0xFF000000)) == 
__constant_htonl(0xFF000000);
 }
diff --git a/pfinet/linux-src/include/net/checksum.h 
b/pfinet/linux-src/include/net/checksum.h
index 041d476..3b72321 100644
--- a/pfinet/linux-src/include/net/checksum.h
+++ b/pfinet/linux-src/include/net/checksum.h
@@ -93,7 +93,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct 
in6_addr *saddr,
 #endif
 
 #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
-extern __inline__
+static __inline__
 unsigned int csum_and_copy_from_user (const char *src, char *dst,
                                      int len, int sum, int *err_ptr)
 {
diff --git a/pfinet/linux-src/include/net/dst.h 
b/pfinet/linux-src/include/net/dst.h
index baf4f41..ceb4f40 100644
--- a/pfinet/linux-src/include/net/dst.h
+++ b/pfinet/linux-src/include/net/dst.h
@@ -80,7 +80,7 @@ struct dst_ops
 extern struct dst_entry * dst_garbage_list;
 extern atomic_t        dst_total;
 
-extern __inline__
+static __inline__
 struct dst_entry * dst_clone(struct dst_entry * dst)
 {
        if (dst)
@@ -88,7 +88,7 @@ struct dst_entry * dst_clone(struct dst_entry * dst)
        return dst;
 }
 
-extern __inline__
+static __inline__
 void dst_release(struct dst_entry * dst)
 {
        if (dst)
@@ -99,7 +99,7 @@ void dst_release(struct dst_entry * dst)
    destination entry has just been removed from a location
    accessed directly by hard irq.
  */
-extern __inline__
+static __inline__
 void dst_release_irqwait(struct dst_entry * dst)
 {
        if (dst) {
@@ -108,7 +108,7 @@ void dst_release_irqwait(struct dst_entry * dst)
        }
 }
 
-extern __inline__
+static __inline__
 struct dst_entry * dst_check(struct dst_entry ** dst_p, u32 cookie)
 {
        struct dst_entry * dst = *dst_p;
@@ -117,7 +117,7 @@ struct dst_entry * dst_check(struct dst_entry ** dst_p, u32 
cookie)
        return (*dst_p = dst);
 }
 
-extern __inline__
+static __inline__
 struct dst_entry * dst_reroute(struct dst_entry ** dst_p, struct sk_buff *skb)
 {
        struct dst_entry * dst = *dst_p;
@@ -127,11 +127,11 @@ struct dst_entry * dst_reroute(struct dst_entry ** dst_p, 
struct sk_buff *skb)
 }
 
 
-extern void * dst_alloc(int size, struct dst_ops * ops);
 extern void __dst_free(struct dst_entry * dst);
+extern void * dst_alloc(int size, struct dst_ops * ops);
 extern void dst_destroy(struct dst_entry * dst);
 
-extern __inline__
+static __inline__
 void dst_free(struct dst_entry * dst)
 {
        if (dst->obsolete > 1)
@@ -143,27 +143,27 @@ void dst_free(struct dst_entry * dst)
        __dst_free(dst);
 }
 
-extern __inline__ void dst_confirm(struct dst_entry *dst)
+static __inline__ void dst_confirm(struct dst_entry *dst)
 {
        if (dst)
                neigh_confirm(dst->neighbour);
 }
 
-extern __inline__ void dst_negative_advice(struct dst_entry **dst_p)
+static __inline__ void dst_negative_advice(struct dst_entry **dst_p)
 {
        struct dst_entry * dst = *dst_p;
        if (dst && dst->ops->negative_advice)
                *dst_p = dst->ops->negative_advice(dst);
 }
 
-extern __inline__ void dst_link_failure(struct sk_buff *skb)
+static __inline__ void dst_link_failure(struct sk_buff *skb)
 {
        struct dst_entry * dst = skb->dst;
        if (dst && dst->ops && dst->ops->link_failure)
                dst->ops->link_failure(skb);
 }
 
-extern __inline__ void dst_set_expires(struct dst_entry *dst, int timeout)
+static __inline__ void dst_set_expires(struct dst_entry *dst, int timeout)
 {
        unsigned long expires = jiffies + timeout;
 
diff --git a/pfinet/linux-src/include/net/if_inet6.h 
b/pfinet/linux-src/include/net/if_inet6.h
index 4e9ed97..515b8c7 100644
--- a/pfinet/linux-src/include/net/if_inet6.h
+++ b/pfinet/linux-src/include/net/if_inet6.h
@@ -117,7 +117,7 @@ struct inet6_dev
 
 extern struct ipv6_devconf ipv6_devconf;
 
-extern __inline__ void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
+static __inline__ void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
 {
        /*
         *      +-------+-------+-------+-------+-------+-------+
diff --git a/pfinet/linux-src/include/net/ip.h 
b/pfinet/linux-src/include/net/ip.h
index 1a6cb61..1519ea0 100644
--- a/pfinet/linux-src/include/net/ip.h
+++ b/pfinet/linux-src/include/net/ip.h
@@ -137,7 +137,7 @@ extern struct linux_mib     net_statistics;
 
 extern int sysctl_local_port_range[2];
 
-extern __inline__ int ip_finish_output(struct sk_buff *skb)
+static __inline__ int ip_finish_output(struct sk_buff *skb)
 {
        struct dst_entry *dst = skb->dst;
        struct device *dev = dst->dev;
@@ -159,7 +159,7 @@ extern __inline__ int ip_finish_output(struct sk_buff *skb)
        return -EINVAL;
 }
 
-extern __inline__ void ip_send(struct sk_buff *skb)
+static __inline__ void ip_send(struct sk_buff *skb)
 {
        if (skb->len > skb->dst->pmtu)
                ip_fragment(skb, __ip_finish_output);
@@ -167,7 +167,7 @@ extern __inline__ void ip_send(struct sk_buff *skb)
                ip_finish_output(skb);
 }
 
-extern __inline__
+static __inline__
 int ip_decrease_ttl(struct iphdr *iph)
 {
        u16 check = iph->check;
@@ -178,7 +178,7 @@ int ip_decrease_ttl(struct iphdr *iph)
        return --iph->ttl;
 }
 
-extern __inline__
+static __inline__
 int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
 {
        return (sk->ip_pmtudisc == IP_PMTUDISC_DO ||
@@ -190,7 +190,7 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
  *     Map a multicast IP onto multicast MAC for type ethernet.
  */
 
-extern __inline__ void ip_eth_mc_map(u32 addr, char *buf)
+static __inline__ void ip_eth_mc_map(u32 addr, char *buf)
 {
        addr=ntohl(addr);
        buf[0]=0x01;
@@ -210,7 +210,7 @@ extern __inline__ void ip_eth_mc_map(u32 addr, char *buf)
  *      multicast packets.
  */
 
-extern __inline__ void ip_tr_mc_map(u32 addr, char *buf)
+static __inline__ void ip_tr_mc_map(u32 addr, char *buf)
 {
        buf[0]=0xC0;
        buf[1]=0x00;
diff --git a/pfinet/linux-src/include/net/ip6_fib.h 
b/pfinet/linux-src/include/net/ip6_fib.h
index efd652f..64b0ef2 100644
--- a/pfinet/linux-src/include/net/ip6_fib.h
+++ b/pfinet/linux-src/include/net/ip6_fib.h
@@ -95,7 +95,7 @@ struct fib6_walker_t
 
 extern struct fib6_walker_t fib6_walker_list;
 
-extern __inline__ void fib6_walker_link(struct fib6_walker_t *w)
+static __inline__ void fib6_walker_link(struct fib6_walker_t *w)
 {
        w->next = fib6_walker_list.next;
        w->prev = &fib6_walker_list;
@@ -103,7 +103,7 @@ extern __inline__ void fib6_walker_link(struct 
fib6_walker_t *w)
        w->prev->next = w;
 }
 
-extern __inline__ void fib6_walker_unlink(struct fib6_walker_t *w)
+static __inline__ void fib6_walker_unlink(struct fib6_walker_t *w)
 {
        w->next->prev = w->prev;
        w->prev->next = w->next;
diff --git a/pfinet/linux-src/include/net/ip6_route.h 
b/pfinet/linux-src/include/net/ip6_route.h
index 9311cc3..369f422 100644
--- a/pfinet/linux-src/include/net/ip6_route.h
+++ b/pfinet/linux-src/include/net/ip6_route.h
@@ -92,7 +92,7 @@ extern void rt6_mtu_change(struct device *dev, unsigned mtu);
  *     For UDP/RAW sockets this is done on udp_connect.
  */
 
-extern __inline__ void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
+static __inline__ void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
                                     struct in6_addr *daddr)
 {
        struct ipv6_pinfo *np;
diff --git a/pfinet/linux-src/include/net/ip_fib.h 
b/pfinet/linux-src/include/net/ip_fib.h
index 76a2fbc..6033894 100644
--- a/pfinet/linux-src/include/net/ip_fib.h
+++ b/pfinet/linux-src/include/net/ip_fib.h
@@ -138,19 +138,19 @@ struct fib_table
 extern struct fib_table *local_table;
 extern struct fib_table *main_table;
 
-extern __inline__ struct fib_table *fib_get_table(int id)
+static __inline__ struct fib_table *fib_get_table(int id)
 {
        if (id != RT_TABLE_LOCAL)
                return main_table;
        return local_table;
 }
 
-extern __inline__ struct fib_table *fib_new_table(int id)
+static __inline__ struct fib_table *fib_new_table(int id)
 {
        return fib_get_table(id);
 }
 
-extern __inline__ int fib_lookup(const struct rt_key *key, struct fib_result 
*res)
+static __inline__ int fib_lookup(const struct rt_key *key, struct fib_result 
*res)
 {
        if (local_table->tb_lookup(local_table, key, res) &&
            main_table->tb_lookup(main_table, key, res))
@@ -158,7 +158,7 @@ extern __inline__ int fib_lookup(const struct rt_key *key, 
struct fib_result *re
        return 0;
 }
 
-extern __inline__ void fib_select_default(const struct rt_key *key, struct 
fib_result *res)
+static __inline__ void fib_select_default(const struct rt_key *key, struct 
fib_result *res)
 {
        if (FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK)
                main_table->tb_select_default(main_table, key, res);
@@ -172,7 +172,7 @@ extern struct fib_table * fib_tables[RT_TABLE_MAX+1];
 extern int fib_lookup(const struct rt_key *key, struct fib_result *res);
 extern struct fib_table *__fib_new_table(int id);
 
-extern __inline__ struct fib_table *fib_get_table(int id)
+static __inline__ struct fib_table *fib_get_table(int id)
 {
        if (id == 0)
                id = RT_TABLE_MAIN;
@@ -180,7 +180,7 @@ extern __inline__ struct fib_table *fib_get_table(int id)
        return fib_tables[id];
 }
 
-extern __inline__ struct fib_table *fib_new_table(int id)
+static __inline__ struct fib_table *fib_new_table(int id)
 {
        if (id == 0)
                id = RT_TABLE_MAIN;
@@ -238,7 +238,7 @@ extern u32 fib_rules_policy(u32 saddr, struct fib_result 
*res, unsigned *flags);
 extern void fib_rules_init(void);
 #endif
 
-extern __inline__ void fib_combine_itag(u32 *itag, struct fib_result *res)
+static __inline__ void fib_combine_itag(u32 *itag, struct fib_result *res)
 {
 #ifdef CONFIG_NET_CLS_ROUTE
 #ifdef CONFIG_IP_MULTIPLE_TABLES
diff --git a/pfinet/linux-src/include/net/ipv6.h 
b/pfinet/linux-src/include/net/ipv6.h
index 60ea053..1162509 100644
--- a/pfinet/linux-src/include/net/ipv6.h
+++ b/pfinet/linux-src/include/net/ipv6.h
@@ -159,7 +159,7 @@ extern int                  ipv6_flowlabel_opt(struct sock 
*sk, char *optval, int optlen);
 extern void                    ip6_flowlabel_init(void);
 extern void                    ip6_flowlabel_cleanup(void);
 
-extern __inline__ void fl6_sock_release(struct ip6_flowlabel *fl)
+static __inline__ void fl6_sock_release(struct ip6_flowlabel *fl)
 {
        if (fl)
                atomic_dec(&fl->users);
@@ -193,23 +193,23 @@ typedef int               (*inet_getfrag_t) (const void 
*data,
 
 extern int             ipv6_addr_type(struct in6_addr *addr);
 
-extern __inline__ int ipv6_addr_scope(struct in6_addr *addr)
+static __inline__ int ipv6_addr_scope(struct in6_addr *addr)
 {
        return ipv6_addr_type(addr) & IPV6_ADDR_SCOPE_MASK;
 }
 
-extern __inline__ int ipv6_addr_cmp(struct in6_addr *a1, struct in6_addr *a2)
+static __inline__ int ipv6_addr_cmp(struct in6_addr *a1, struct in6_addr *a2)
 {
        return memcmp((void *) a1, (void *) a2, sizeof(struct in6_addr));
 }
 
-extern __inline__ void ipv6_addr_copy(struct in6_addr *a1, struct in6_addr *a2)
+static __inline__ void ipv6_addr_copy(struct in6_addr *a1, struct in6_addr *a2)
 {
        memcpy((void *) a1, (void *) a2, sizeof(struct in6_addr));
 }
 
 #ifndef __HAVE_ARCH_ADDR_SET
-extern __inline__ void ipv6_addr_set(struct in6_addr *addr, 
+static __inline__ void ipv6_addr_set(struct in6_addr *addr, 
                                     __u32 w1, __u32 w2,
                                     __u32 w3, __u32 w4)
 {
@@ -220,7 +220,7 @@ extern __inline__ void ipv6_addr_set(struct in6_addr *addr,
 }
 #endif
 
-extern __inline__ int ipv6_addr_any(struct in6_addr *a)
+static __inline__ int ipv6_addr_any(struct in6_addr *a)
 {
        return ((a->s6_addr32[0] | a->s6_addr32[1] | 
                 a->s6_addr32[2] | a->s6_addr32[3] ) == 0); 
diff --git a/pfinet/linux-src/include/net/ndisc.h 
b/pfinet/linux-src/include/net/ndisc.h
index 7a51f36..9c60320 100644
--- a/pfinet/linux-src/include/net/ndisc.h
+++ b/pfinet/linux-src/include/net/ndisc.h
@@ -101,7 +101,7 @@ extern int                  igmp6_event_report(struct 
sk_buff *skb,
 
 extern void                    igmp6_cleanup(void);
 
-extern __inline__ struct neighbour * ndisc_get_neigh(struct device *dev, 
struct in6_addr *addr)
+static __inline__ struct neighbour * ndisc_get_neigh(struct device *dev, 
struct in6_addr *addr)
 {
 
        if (dev) {
diff --git a/pfinet/linux-src/include/net/neighbour.h 
b/pfinet/linux-src/include/net/neighbour.h
index ab79f17..67ba3e5 100644
--- a/pfinet/linux-src/include/net/neighbour.h
+++ b/pfinet/linux-src/include/net/neighbour.h
@@ -207,26 +207,26 @@ extern void                       
neigh_sysctl_unregister(struct neigh_parms *p);
  *     is only referenced by the corresponding table.
  */
 
-extern __inline__ void neigh_release(struct neighbour *neigh)
+static __inline__ void neigh_release(struct neighbour *neigh)
 {
        if (atomic_dec_and_test(&neigh->refcnt) && neigh->tbl == NULL)
                neigh_destroy(neigh);
 }
 
-extern __inline__ struct neighbour * neigh_clone(struct neighbour *neigh)
+static __inline__ struct neighbour * neigh_clone(struct neighbour *neigh)
 {
        if (neigh)
                atomic_inc(&neigh->refcnt);
        return neigh;
 }
 
-extern __inline__ void neigh_confirm(struct neighbour *neigh)
+static __inline__ void neigh_confirm(struct neighbour *neigh)
 {
        if (neigh)
                neigh->confirmed = jiffies;
 }
 
-extern __inline__ struct neighbour *
+static __inline__ struct neighbour *
 neigh_lookup(struct neigh_table *tbl, const void *pkey, struct device *dev)
 {
        struct neighbour *neigh;
@@ -236,17 +236,17 @@ neigh_lookup(struct neigh_table *tbl, const void *pkey, 
struct device *dev)
        return neigh;
 }
 
-extern __inline__ int neigh_is_connected(struct neighbour *neigh)
+static __inline__ int neigh_is_connected(struct neighbour *neigh)
 {
        return neigh->nud_state&NUD_CONNECTED;
 }
 
-extern __inline__ int neigh_is_valid(struct neighbour *neigh)
+static __inline__ int neigh_is_valid(struct neighbour *neigh)
 {
        return neigh->nud_state&NUD_VALID;
 }
 
-extern __inline__ int neigh_event_send(struct neighbour *neigh, struct sk_buff 
*skb)
+static __inline__ int neigh_event_send(struct neighbour *neigh, struct sk_buff 
*skb)
 {
        neigh->used = jiffies;
        if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE)))
@@ -254,13 +254,13 @@ extern __inline__ int neigh_event_send(struct neighbour 
*neigh, struct sk_buff *
        return 0;
 }
 
-extern __inline__ void neigh_table_lock(struct neigh_table *tbl)
+static __inline__ void neigh_table_lock(struct neigh_table *tbl)
 {
        atomic_inc(&tbl->lock);
        synchronize_bh();
 }
 
-extern __inline__ void neigh_table_unlock(struct neigh_table *tbl)
+static __inline__ void neigh_table_unlock(struct neigh_table *tbl)
 {
        atomic_dec(&tbl->lock);
 }
diff --git a/pfinet/linux-src/include/net/pkt_cls.h 
b/pfinet/linux-src/include/net/pkt_cls.h
index b8547e6..13e24a9 100644
--- a/pfinet/linux-src/include/net/pkt_cls.h
+++ b/pfinet/linux-src/include/net/pkt_cls.h
@@ -63,7 +63,7 @@ struct tcf_proto_ops
    specific classifiers.
  */
 
-extern __inline__ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 
struct tcf_result *res)
+static __inline__ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 
struct tcf_result *res)
 {
        int err = 0;
        u32 protocol = skb->protocol;
@@ -77,7 +77,7 @@ extern __inline__ int tc_classify(struct sk_buff *skb, struct 
tcf_proto *tp, str
        return -1;
 }
 
-extern __inline__ unsigned long cls_set_class(unsigned long *clp, unsigned 
long cl)
+static __inline__ unsigned long cls_set_class(unsigned long *clp, unsigned 
long cl)
 {
        unsigned long old_cl; 
 
diff --git a/pfinet/linux-src/include/net/pkt_sched.h 
b/pfinet/linux-src/include/net/pkt_sched.h
index c2ef865..b441789 100644
--- a/pfinet/linux-src/include/net/pkt_sched.h
+++ b/pfinet/linux-src/include/net/pkt_sched.h
@@ -354,7 +354,7 @@ extern struct tcf_police * tcf_police_locate(struct rtattr 
*rta, struct rtattr *
 extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p);
 extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
 
-extern __inline__ void tcf_police_release(struct tcf_police *p)
+static __inline__ void tcf_police_release(struct tcf_police *p)
 {
        if (p && --p->refcnt == 0)
                tcf_police_destroy(p);
@@ -387,7 +387,7 @@ int pktsched_init(void);
 void qdisc_run_queues(void);
 int qdisc_restart(struct device *dev);
 
-extern __inline__ void qdisc_wakeup(struct device *dev)
+static __inline__ void qdisc_wakeup(struct device *dev)
 {
        if (!dev->tbusy) {
                struct Qdisc *q = dev->qdisc;
@@ -398,7 +398,7 @@ extern __inline__ void qdisc_wakeup(struct device *dev)
        }
 }
 
-extern __inline__ unsigned psched_mtu(struct device *dev)
+static __inline__ unsigned psched_mtu(struct device *dev)
 {
        unsigned mtu = dev->mtu;
        return dev->hard_header ? mtu + dev->hard_header_len : mtu;
diff --git a/pfinet/linux-src/include/net/profile.h 
b/pfinet/linux-src/include/net/profile.h
index 82fad0a..e4b24e9 100644
--- a/pfinet/linux-src/include/net/profile.h
+++ b/pfinet/linux-src/include/net/profile.h
@@ -28,14 +28,14 @@ extern void net_profile_irq_adjust(struct timeval *entered, 
struct timeval* leav
 #if CPU == 586 || CPU == 686
 
 
-extern __inline__ void  net_profile_stamp(struct timeval *pstamp)
+static __inline__ void  net_profile_stamp(struct timeval *pstamp)
 {
        __asm__ __volatile__ (".byte 0x0f,0x31"
                :"=a" (pstamp->tv_usec),
                "=d" (pstamp->tv_sec));
 }
 
-extern __inline__ void  net_profile_accumulate(struct timeval *entered,
+static __inline__ void  net_profile_accumulate(struct timeval *entered,
                                               struct timeval *leaved,
                                               struct timeval *acc)
 {
@@ -51,7 +51,7 @@ extern __inline__ void  net_profile_accumulate(struct timeval 
*entered,
                              "0" (acc->tv_usec), "1" (acc->tv_sec));
 }
 
-extern __inline__ void  net_profile_sub(struct timeval *sub,
+static __inline__ void  net_profile_sub(struct timeval *sub,
                                        struct timeval *acc)
 {
        __asm__ __volatile__ ("subl %2,%0\n\t" 
@@ -61,7 +61,7 @@ extern __inline__ void  net_profile_sub(struct timeval *sub,
                              "0" (acc->tv_usec), "1" (acc->tv_sec));
 }
 
-extern __inline__ void  net_profile_add(struct timeval *add,
+static __inline__ void  net_profile_add(struct timeval *add,
                                        struct timeval *acc)
 {
        __asm__ __volatile__ ("addl %2,%0\n\t" 
@@ -79,7 +79,7 @@ extern long alpha_hi;
 
 /* On alpha cycle counter has only 32 bits :-( :-( */
 
-extern __inline__ void  net_profile_stamp(struct timeval *pstamp)
+static __inline__ void  net_profile_stamp(struct timeval *pstamp)
 {
        __u32 result;
        __asm__ __volatile__ ("rpcc %0" : "r="(result));
@@ -90,7 +90,7 @@ extern __inline__ void  net_profile_stamp(struct timeval 
*pstamp)
        pstamp->tv_usec = alpha_lo;
 }
 
-extern __inline__ void  net_profile_accumulate(struct timeval *entered,
+static __inline__ void  net_profile_accumulate(struct timeval *entered,
                                               struct timeval *leaved,
                                               struct timeval *acc)
 {
@@ -112,7 +112,7 @@ extern __inline__ void  net_profile_accumulate(struct 
timeval *entered,
        acc->tv_usec = usecs;
 }
 
-extern __inline__ void  net_profile_sub(struct timeval *entered,
+static __inline__ void  net_profile_sub(struct timeval *entered,
                                        struct timeval *leaved)
 {
        time_t usecs = leaved->tv_usec - entered->tv_usec;
@@ -126,7 +126,7 @@ extern __inline__ void  net_profile_sub(struct timeval 
*entered,
        leaved->tv_usec = usecs;
 }
 
-extern __inline__ void  net_profile_add(struct timeval *entered, struct 
timeval *leaved)
+static __inline__ void  net_profile_add(struct timeval *entered, struct 
timeval *leaved)
 {
        time_t usecs = leaved->tv_usec + entered->tv_usec;
        time_t secs = leaved->tv_sec + entered->tv_sec;
@@ -142,7 +142,7 @@ extern __inline__ void  net_profile_add(struct timeval 
*entered, struct timeval
 
 #else
 
-extern __inline__ void  net_profile_stamp(struct timeval *pstamp)
+static __inline__ void  net_profile_stamp(struct timeval *pstamp)
 {
        /* Not "fast" counterpart! On architectures without
           cpu clock "fast" routine is absolutely useless in this
@@ -153,7 +153,7 @@ extern __inline__ void  net_profile_stamp(struct timeval 
*pstamp)
        do_gettimeofday(pstamp);
 }
 
-extern __inline__ void  net_profile_accumulate(struct timeval *entered,
+static __inline__ void  net_profile_accumulate(struct timeval *entered,
                                               struct timeval *leaved,
                                               struct timeval *acc)
 {
@@ -175,7 +175,7 @@ extern __inline__ void  net_profile_accumulate(struct 
timeval *entered,
        acc->tv_usec = usecs;
 }
 
-extern __inline__ void  net_profile_sub(struct timeval *entered,
+static __inline__ void  net_profile_sub(struct timeval *entered,
                                        struct timeval *leaved)
 {
        time_t usecs = leaved->tv_usec - entered->tv_usec;
@@ -189,7 +189,7 @@ extern __inline__ void  net_profile_sub(struct timeval 
*entered,
        leaved->tv_usec = usecs;
 }
 
-extern __inline__ void  net_profile_add(struct timeval *entered, struct 
timeval *leaved)
+static __inline__ void  net_profile_add(struct timeval *entered, struct 
timeval *leaved)
 {
        time_t usecs = leaved->tv_usec + entered->tv_usec;
        time_t secs = leaved->tv_sec + entered->tv_sec;
@@ -206,7 +206,7 @@ extern __inline__ void  net_profile_add(struct timeval 
*entered, struct timeval
 
 #endif
 
-extern __inline__ void net_profile_enter(struct net_profile_slot *s)
+static __inline__ void net_profile_enter(struct net_profile_slot *s)
 {
        unsigned long flags;
 
@@ -219,7 +219,7 @@ extern __inline__ void net_profile_enter(struct 
net_profile_slot *s)
        restore_flags(flags);
 }
 
-extern __inline__ void net_profile_leave_irq(struct net_profile_slot *s)
+static __inline__ void net_profile_leave_irq(struct net_profile_slot *s)
 {
        unsigned long flags;
 
@@ -240,7 +240,7 @@ extern __inline__ void net_profile_leave_irq(struct 
net_profile_slot *s)
        restore_flags(flags);
 }
 
-extern __inline__ void net_profile_leave(struct net_profile_slot *s)
+static __inline__ void net_profile_leave(struct net_profile_slot *s)
 {
        unsigned long flags;
        save_flags(flags);
diff --git a/pfinet/linux-src/include/net/route.h 
b/pfinet/linux-src/include/net/route.h
index 66df471..40aabdf 100644
--- a/pfinet/linux-src/include/net/route.h
+++ b/pfinet/linux-src/include/net/route.h
@@ -124,7 +124,7 @@ extern void         ip_rt_get_source(u8 *src, struct rtable 
*rt);
 extern int             ip_rt_dump(struct sk_buff *skb,  struct 
netlink_callback *cb);
 
 
-extern __inline__ void ip_rt_put(struct rtable * rt)
+static __inline__ void ip_rt_put(struct rtable * rt)
 {
        if (rt)
                dst_release(&rt->u.dst);
@@ -132,12 +132,12 @@ extern __inline__ void ip_rt_put(struct rtable * rt)
 
 extern __u8 ip_tos2prio[16];
 
-extern __inline__ char rt_tos2priority(u8 tos)
+static __inline__ char rt_tos2priority(u8 tos)
 {
        return ip_tos2prio[IPTOS_TOS(tos)>>1];
 }
 
-extern __inline__ int ip_route_connect(struct rtable **rp, u32 dst, u32 src, 
u32 tos, int oif)
+static __inline__ int ip_route_connect(struct rtable **rp, u32 dst, u32 src, 
u32 tos, int oif)
 {
        int err;
        err = ip_route_output(rp, dst, src, tos, oif);
diff --git a/pfinet/linux-src/include/net/sock.h 
b/pfinet/linux-src/include/net/sock.h
index 96fdfe8..b149224 100644
--- a/pfinet/linux-src/include/net/sock.h
+++ b/pfinet/linux-src/include/net/sock.h
@@ -724,7 +724,6 @@ extern struct sk_buff               *sock_rmalloc(struct 
sock *sk,
 extern void                    sock_wfree(struct sk_buff *skb);
 extern void                    sock_rfree(struct sk_buff *skb);
 extern unsigned long           sock_rspace(struct sock *sk);
-extern unsigned long           sock_wspace(struct sock *sk);
 
 extern int                     sock_setsockopt(struct socket *sock, int level,
                                                int op, char *optval,
@@ -800,7 +799,7 @@ extern void sklist_destroy_socket(struct sock **list, 
struct sock *sk);
  * sk_run_filter. If pkt_len is 0 we toss packet. If skb->len is smaller
  * than pkt_len we keep whole skb->data.
  */
-extern __inline__ int sk_filter(struct sk_buff *skb, struct sk_filter *filter)
+static __inline__ int sk_filter(struct sk_buff *skb, struct sk_filter *filter)
 {
        int pkt_len;
 
@@ -813,7 +812,7 @@ extern __inline__ int sk_filter(struct sk_buff *skb, struct 
sk_filter *filter)
        return 0;
 }
 
-extern __inline__ void sk_filter_release(struct sock *sk, struct sk_filter *fp)
+static __inline__ void sk_filter_release(struct sock *sk, struct sk_filter *fp)
 {
        unsigned int size = sk_filter_len(fp);
 
@@ -823,7 +822,7 @@ extern __inline__ void sk_filter_release(struct sock *sk, 
struct sk_filter *fp)
                kfree_s(fp, size);
 }
 
-extern __inline__ void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
+static __inline__ void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
 {
        atomic_inc(&fp->refcnt);
        atomic_add(sk_filter_len(fp), &sk->omem_alloc);
@@ -840,14 +839,14 @@ extern __inline__ void sk_filter_charge(struct sock *sk, 
struct sk_filter *fp)
  *     packet ever received.
  */
 
-extern __inline__ void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
+static __inline__ void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
 {
        skb->sk = sk;
        skb->destructor = sock_wfree;
        atomic_add(skb->truesize, &sk->wmem_alloc);
 }
 
-extern __inline__ void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
+static __inline__ void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
 {
        skb->sk = sk;
        skb->destructor = sock_rfree;
@@ -855,7 +854,7 @@ extern __inline__ void skb_set_owner_r(struct sk_buff *skb, 
struct sock *sk)
 }
 
 
-extern __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+static __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 {
 #ifdef CONFIG_FILTER
        struct sk_filter *filter;
@@ -878,7 +877,7 @@ extern __inline__ int sock_queue_rcv_skb(struct sock *sk, 
struct sk_buff *skb)
        return 0;
 }
 
-extern __inline__ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
+static __inline__ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
 {
        /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
           number of warnings when compiling with -W --ANK
@@ -896,13 +895,13 @@ extern __inline__ int sock_queue_err_skb(struct sock *sk, 
struct sk_buff *skb)
  *     Recover an error report and clear atomically
  */
  
-extern __inline__ int sock_error(struct sock *sk)
+static __inline__ int sock_error(struct sock *sk)
 {
        int err=xchg(&sk->err,0);
        return -err;
 }
 
-extern __inline__ unsigned long sock_wspace(struct sock *sk)
+static __inline__ unsigned long sock_wspace(struct sock *sk)
 {
        int amt = 0;
 
@@ -918,7 +917,7 @@ extern __inline__ unsigned long sock_wspace(struct sock *sk)
  *     Default write policy as shown to user space via poll/select/SIGIO
  *     Kernel internally doesn't use the MIN_WRITE_SPACE threshold.
  */
-extern __inline__ int sock_writeable(struct sock *sk) 
+static __inline__ int sock_writeable(struct sock *sk) 
 {
        return sock_wspace(sk) >= MIN_WRITE_SPACE;
 }
@@ -933,7 +932,7 @@ extern void net_delete_timer (struct sock *);
 extern void net_reset_timer (struct sock *, int, unsigned long);
 extern void net_timer (unsigned long);
 
-extern __inline__ int gfp_any(void)
+static __inline__ int gfp_any(void)
 {
        return in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
 }
diff --git a/pfinet/linux-src/include/net/tcp.h 
b/pfinet/linux-src/include/net/tcp.h
index abb4b21..96b8071 100644
--- a/pfinet/linux-src/include/net/tcp.h
+++ b/pfinet/linux-src/include/net/tcp.h
@@ -428,19 +428,19 @@ struct tcp_func {
  * and worry about wraparound (automatic with unsigned arithmetic).
  */
 
-extern __inline int before(__u32 seq1, __u32 seq2)
+static __inline int before(__u32 seq1, __u32 seq2)
 {
         return (__s32)(seq1-seq2) < 0;
 }
 
-extern __inline int after(__u32 seq1, __u32 seq2)
+static __inline int after(__u32 seq1, __u32 seq2)
 {
        return (__s32)(seq2-seq1) < 0;
 }
 
 
 /* is s2<=s1<=s3 ? */
-extern __inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
+static __inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
 {
        return seq3 - seq2 >= seq1 - seq2;
 }
@@ -659,7 +659,7 @@ extern u32  __tcp_select_window(struct sock *sk);
  * value can be stuffed directly into th->window for an outgoing
  * frame.
  */
-extern __inline__ u16 tcp_select_window(struct sock *sk)
+static __inline__ u16 tcp_select_window(struct sock *sk)
 {
        struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
        u32 cur_win = tcp_receive_window(tp);
@@ -686,7 +686,7 @@ extern __inline__ u16 tcp_select_window(struct sock *sk)
  * can increase our advertisement.  If it becomes more than
  * twice what we are talking about right now, return true.
  */
-extern __inline__ int tcp_raise_window(struct sock *sk)
+static __inline__ int tcp_raise_window(struct sock *sk)
 {
        struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
        u32 cur_win = tcp_receive_window(tp);
@@ -704,7 +704,7 @@ extern __inline__ int tcp_raise_window(struct sock *sk)
  * as well, however we keep track of that using different
  * units so a conversion is necessary.  -DaveM
  */
-extern __inline__ __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
+static __inline__ __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
 {
        __u32 snd_wnd_packets = tp->snd_wnd / max(tp->mss_cache, 1);
 
@@ -847,7 +847,7 @@ static __inline__ void tcp_push_pending_frames(struct sock 
*sk, struct tcp_opt *
  * problem. Thanks to Stephen A. Wood <address@hidden>  -FvK
  */
 
-extern __inline const int tcp_connected(const int state)
+static __inline const int tcp_connected(const int state)
 {
        return ((1 << state) &
                (TCPF_ESTABLISHED|TCPF_CLOSE_WAIT|TCPF_FIN_WAIT1|
@@ -934,7 +934,7 @@ static __inline__ void tcp_build_and_update_options(__u32 
*ptr, struct tcp_opt *
  * MAX_SYN_SIZE to match the new maximum number of options that you
  * can generate.
  */
-extern __inline__ void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int 
sack,
+static __inline__ void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int 
sack,
                                             int offer_wscale, int wscale, 
__u32 tstamp, __u32 ts_recent)
 {
        /* We always get an MSS option.
@@ -974,7 +974,7 @@ extern __inline__ void tcp_syn_build_options(__u32 *ptr, 
int mss, int ts, int sa
  * be a multiple of mss if possible. We assume here that mss >= 1.
  * This MUST be enforced by all callers.
  */
-extern __inline__ void tcp_select_initial_window(__u32 space, __u16 mss,
+static __inline__ void tcp_select_initial_window(__u32 space, __u16 mss,
        __u32 *rcv_wnd,
        __u32 *window_clamp,
        int wscale_ok,
@@ -1008,28 +1008,28 @@ extern __inline__ void tcp_select_initial_window(__u32 
space, __u16 mss,
        (*window_clamp) = min(65535<<(*rcv_wscale),*window_clamp);
 }
 
-extern __inline__ void tcp_synq_unlink(struct tcp_opt *tp, struct open_request 
*req, struct open_request *prev)
+static __inline__ void tcp_synq_unlink(struct tcp_opt *tp, struct open_request 
*req, struct open_request *prev)
 {
        if(!req->dl_next)
                tp->syn_wait_last = (struct open_request **)prev;
        prev->dl_next = req->dl_next;
 }
 
-extern __inline__ void tcp_synq_queue(struct tcp_opt *tp, struct open_request 
*req)
+static __inline__ void tcp_synq_queue(struct tcp_opt *tp, struct open_request 
*req)
 { 
        req->dl_next = NULL;
        *tp->syn_wait_last = req; 
        tp->syn_wait_last = &req->dl_next;
 }
 
-extern __inline__ void tcp_synq_init(struct tcp_opt *tp)
+static __inline__ void tcp_synq_init(struct tcp_opt *tp)
 {
        tp->syn_wait_queue = NULL;
        tp->syn_wait_last = &tp->syn_wait_queue;
 }
 
 extern void __tcp_inc_slow_timer(struct tcp_sl_timer *slt);
-extern __inline__ void tcp_inc_slow_timer(int timer)
+static __inline__ void tcp_inc_slow_timer(int timer)
 {
        struct tcp_sl_timer *slt = &tcp_slt_array[timer];
        
@@ -1041,7 +1041,7 @@ extern __inline__ void tcp_inc_slow_timer(int timer)
        atomic_inc(&slt->count);
 }
 
-extern __inline__ void tcp_dec_slow_timer(int timer)
+static __inline__ void tcp_dec_slow_timer(int timer)
 {
        struct tcp_sl_timer *slt = &tcp_slt_array[timer];
 
diff --git a/pfinet/linux-src/net/ipv4/fib_hash.c 
b/pfinet/linux-src/net/ipv4/fib_hash.c
index e3987ea..074a368 100644
--- a/pfinet/linux-src/net/ipv4/fib_hash.c
+++ b/pfinet/linux-src/net/ipv4/fib_hash.c
@@ -135,12 +135,12 @@ static __inline__ struct fib_node * fz_chain(fn_key_t 
key, struct fn_zone *fz)
        return fz->fz_hash[fn_hash(key, fz).datum];
 }
 
-extern __inline__ int fn_key_eq(fn_key_t a, fn_key_t b)
+static __inline__ int fn_key_eq(fn_key_t a, fn_key_t b)
 {
        return a.datum == b.datum;
 }
 
-extern __inline__ int fn_key_leq(fn_key_t a, fn_key_t b)
+static __inline__ int fn_key_leq(fn_key_t a, fn_key_t b)
 {
        return a.datum <= b.datum;
 }
@@ -677,7 +677,7 @@ FTprint("tb(%d)_delete: %d %08x/%d %d\n", tb->tb_id, 
r->rtm_type, rta->rta_dst ?
        return -ESRCH;
 }
 
-extern __inline__ int
+static __inline__ int
 fn_flush_list(struct fib_node ** fp, int z, struct fn_hash *table)
 {
        int found = 0;
@@ -763,7 +763,7 @@ static int fn_hash_get_info(struct fib_table *tb, char 
*buffer, int first, int c
 
 #ifdef CONFIG_RTNETLINK
 
-extern __inline__ int
+static __inline__ int
 fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb,
                     struct fib_table *tb,
                     struct fn_zone *fz,
@@ -788,7 +788,7 @@ fn_hash_dump_bucket(struct sk_buff *skb, struct 
netlink_callback *cb,
        return skb->len;
 }
 
-extern __inline__ int
+static __inline__ int
 fn_hash_dump_zone(struct sk_buff *skb, struct netlink_callback *cb,
                   struct fib_table *tb,
                   struct fn_zone *fz)
diff --git a/pfinet/linux-src/net/ipv4/fib_semantics.c 
b/pfinet/linux-src/net/ipv4/fib_semantics.c
index b7edb29..ac76331 100644
--- a/pfinet/linux-src/net/ipv4/fib_semantics.c
+++ b/pfinet/linux-src/net/ipv4/fib_semantics.c
@@ -113,7 +113,7 @@ void fib_release_info(struct fib_info *fi)
        }
 }
 
-extern __inline__ int nh_comp(const struct fib_info *fi, const struct fib_info 
*ofi)
+static __inline__ int nh_comp(const struct fib_info *fi, const struct fib_info 
*ofi)
 {
        const struct fib_nh *onh = ofi->fib_nh;
 
@@ -134,7 +134,7 @@ extern __inline__ int nh_comp(const struct fib_info *fi, 
const struct fib_info *
        return 0;
 }
 
-extern __inline__ struct fib_info * fib_find_info(const struct fib_info *nfi)
+static __inline__ struct fib_info * fib_find_info(const struct fib_info *nfi)
 {
        for_fib_info() {
                if (fi->fib_nhs != nfi->fib_nhs)
diff --git a/pfinet/linux-src/net/ipv4/ip_fragment.c 
b/pfinet/linux-src/net/ipv4/ip_fragment.c
index f066e60..f903538 100644
--- a/pfinet/linux-src/net/ipv4/ip_fragment.c
+++ b/pfinet/linux-src/net/ipv4/ip_fragment.c
@@ -79,19 +79,19 @@ struct ipq *ipq_hash[IPQ_HASHSZ];
 atomic_t ip_frag_mem = ATOMIC_INIT(0);         /* Memory used for fragments */
 
 /* Memory Tracking Functions. */
-extern __inline__ void frag_kfree_skb(struct sk_buff *skb)
+static __inline__ void frag_kfree_skb(struct sk_buff *skb)
 {
        atomic_sub(skb->truesize, &ip_frag_mem);
        kfree_skb(skb);
 }
 
-extern __inline__ void frag_kfree_s(void *ptr, int len)
+static __inline__ void frag_kfree_s(void *ptr, int len)
 {
        atomic_sub(len, &ip_frag_mem);
        kfree(ptr);
 }
  
-extern __inline__ void *frag_kmalloc(int size, int pri)
+static __inline__ void *frag_kmalloc(int size, int pri)
 {
        void *vp = kmalloc(size, pri);
 
diff --git a/pfinet/linux-src/net/ipv4/tcp_input.c 
b/pfinet/linux-src/net/ipv4/tcp_input.c
index e2dfc15..9fd25b8 100644
--- a/pfinet/linux-src/net/ipv4/tcp_input.c
+++ b/pfinet/linux-src/net/ipv4/tcp_input.c
@@ -210,7 +210,7 @@ static __inline__ void tcp_bound_rto(struct tcp_opt *tp)
 }
 
 /* WARNING: this must not be called if tp->saw_timestamp was false. */
-extern __inline__ void tcp_replace_ts_recent(struct sock *sk, struct tcp_opt 
*tp,
+static __inline__ void tcp_replace_ts_recent(struct sock *sk, struct tcp_opt 
*tp,
                                             __u32 start_seq, __u32 end_seq)
 {
        /* It is start_seq <= last_ack_seq combined
@@ -236,7 +236,7 @@ extern __inline__ void tcp_replace_ts_recent(struct sock 
*sk, struct tcp_opt *tp
 
 #define PAWS_24DAYS    (HZ * 60 * 60 * 24 * 24)
 
-extern __inline__ int tcp_paws_discard(struct tcp_opt *tp, struct tcphdr *th, 
unsigned len)
+static __inline__ int tcp_paws_discard(struct tcp_opt *tp, struct tcphdr *th, 
unsigned len)
 {
        return ((s32)(tp->rcv_tsval - tp->ts_recent) < 0 &&
                (s32)(tcp_time_stamp - tp->ts_recent_stamp) < PAWS_24DAYS &&
@@ -259,7 +259,7 @@ static int __tcp_sequence(struct tcp_opt *tp, u32 seq, u32 
end_seq)
 }
 
 /* This functions checks to see if the tcp header is actually acceptable. */
-extern __inline__ int tcp_sequence(struct tcp_opt *tp, u32 seq, u32 end_seq)
+static __inline__ int tcp_sequence(struct tcp_opt *tp, u32 seq, u32 end_seq)
 {
        if (seq == tp->rcv_nxt)
                return (tp->rcv_wnd || (end_seq == seq));
diff --git a/pfinet/linux-src/net/ipv6/reassembly.c 
b/pfinet/linux-src/net/ipv6/reassembly.c
index 3e1575d..b4b8fb9 100644
--- a/pfinet/linux-src/net/ipv6/reassembly.c
+++ b/pfinet/linux-src/net/ipv6/reassembly.c
@@ -88,19 +88,19 @@ static struct frag_queue ipv6_frag_queue = {
 };
 
 /* Memory Tracking Functions. */
-extern __inline__ void frag_kfree_skb(struct sk_buff *skb)
+static __inline__ void frag_kfree_skb(struct sk_buff *skb)
 {
        atomic_sub(skb->truesize, &ip6_frag_mem);
        kfree_skb(skb);
 }
 
-extern __inline__ void frag_kfree_s(void *ptr, int len)
+static __inline__ void frag_kfree_s(void *ptr, int len)
 {
        atomic_sub(len, &ip6_frag_mem);
        kfree(ptr);
 }
  
-extern __inline__ void *frag_kmalloc(int size, int pri)
+static __inline__ void *frag_kmalloc(int size, int pri)
 {
        void *vp = kmalloc(size, pri);
 
diff --git a/pfinet/main.c b/pfinet/main.c
index 46457a9..4bfa318 100644
--- a/pfinet/main.c
+++ b/pfinet/main.c
@@ -269,6 +269,8 @@ extern void sk_init (void), skb_init (void);
 extern int net_dev_init (void);
 extern void inet6_proto_init (struct net_proto *pro);
 
+#define ARRAY_SIZE(x)       (sizeof(x) / sizeof((x)[0]))
+
 int
 main (int argc,
       char **argv)
@@ -374,11 +376,11 @@ main (int argc,
     int i;
     /* Check that at least one portclass has been bound, 
        error out otherwise. */
-    for (i = 0; i < trivfs_protid_nportclasses; i ++)
+    for (i = 0; i < ARRAY_SIZE (pfinet_protid_portclasses); i++)
       if (pfinet_protid_portclasses[i] != MACH_PORT_NULL)
        break;
 
-    if (i == trivfs_protid_nportclasses)
+    if (i == ARRAY_SIZE (pfinet_protid_portclasses))
       error (1, 0, "should be started as a translator.\n");
   }
 
diff --git a/pfinet/mapped-time.h b/pfinet/mapped-time.h
index bcbfc6d..01f2dcc 100644
--- a/pfinet/mapped-time.h
+++ b/pfinet/mapped-time.h
@@ -8,13 +8,13 @@
 extern volatile struct mapped_time_value *mapped_time;
 extern long long root_jiffies;
 
-extern inline int
+static inline int
 read_mapped_secs ()
 {
   return mapped_time->seconds;
 }
 
-extern inline int
+static inline int
 fetch_jiffies ()
 {
   struct timeval tv;
diff --git a/pfinet/timer-emul.c b/pfinet/timer-emul.c
index 2053f80..e2ed3a2 100644
--- a/pfinet/timer-emul.c
+++ b/pfinet/timer-emul.c
@@ -31,8 +31,8 @@
 long long root_jiffies;
 volatile struct mapped_time_value *mapped_time;
 
-struct timer_list *timers;
-thread_t timer_thread = 0;
+static struct timer_list *timers;
+static thread_t timer_thread = 0;
 
 static void *
 timer_function (void *this_is_a_pointless_variable_with_a_rather_long_name)
diff --git a/pflocal/Makefile b/pflocal/Makefile
index bfc2f4e..0d9341f 100644
--- a/pflocal/Makefile
+++ b/pflocal/Makefile
@@ -26,7 +26,7 @@ SRCS = connq.c io.c pflocal.c socket.c pf.c sock.c sserver.c
 MIGSTUBS = ioServer.o socketServer.o
 OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
 HURDLIBS = pipe trivfs iohelp fshelp ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
 
diff --git a/pflocal/socket.c b/pflocal/socket.c
index 5844904..f2b75a7 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -441,10 +441,33 @@ S_socket_getopt (struct sock_user *user,
       switch (opt)
        {
        case SO_TYPE:
-         assert (*value_len >= sizeof (int));
+         if (*value_len < sizeof (int))
+           {
+             ret = EINVAL;
+             break;
+           }
          *(int *)*value = user->sock->pipe_class->sock_type;
          *value_len = sizeof (int);
          break;
+       case SO_ERROR:
+         /* We do not have asynchronous operations (such as connect), so no
+            error to report.  */
+         if (*value_len < sizeof (short))
+         {
+           *(char*)*value = 0;
+           *value_len = sizeof(char);
+         }
+         else if (*value_len < sizeof (int))
+         {
+           *(short*)*value = 0;
+           *value_len = sizeof(short);
+         }
+         else
+         {
+           *(int*)*value = 0;
+           *value_len = sizeof(int);
+         }
+         break;
        default:
          ret = ENOPROTOOPT;
          break;
diff --git a/proc/Makefile b/proc/Makefile
index 2275a66..8ca13c2 100644
--- a/proc/Makefile
+++ b/proc/Makefile
@@ -31,8 +31,7 @@ MIGSTUBS = processServer.o notifyServer.o \
        task_notifyServer.o
 OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
 HURDLIBS = ihash ports shouldbeinlibc
-
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
 
diff --git a/proc/mgt.c b/proc/mgt.c
index ff1ca48..dacce46 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -21,6 +21,7 @@
 /* Written by Michael I. Bushnell.  */
 
 #include <mach.h>
+#include <mach/task_notify.h>
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <errno.h>
diff --git a/procfs/Makefile b/procfs/Makefile
index 78f20c4..12fc9ee 100644
--- a/procfs/Makefile
+++ b/procfs/Makefile
@@ -26,6 +26,6 @@ LCLHDRS = dircat.h main.h process.h procfs.h procfs_dir.h 
proclist.h rootdir.h
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = netfs fshelp iohelp ps ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/procfs/process.c b/procfs/process.c
index 2255bcd..ece37b7 100644
--- a/procfs/process.c
+++ b/procfs/process.c
@@ -149,7 +149,7 @@ process_file_gc_maps (struct proc_stat *ps, char **contents)
       if (err)
        break;
 
-      fprintf (s, "%0*x-%0*x %c%c%c%c %0*x %s %d ",
+      fprintf (s, "%0*lx-%0*lx %c%c%c%c %0*lx %s %d ",
               /* Address range.  */
               2*sizeof s, addr,
               2*sizeof s, addr + size,
@@ -178,7 +178,7 @@ process_file_gc_maps (struct proc_stat *ps, char **contents)
          else
            mach_port_deallocate (mach_task_self (), obj);
 
-         fprintf (s, "[mem_obj=%d]\n", obj);
+         fprintf (s, "[mem_obj=%lu]\n", obj);
        }
       else
        fprintf (s, "\n");
diff --git a/procfs/rootdir.c b/procfs/rootdir.c
index d68645e..1e9ec8f 100644
--- a/procfs/rootdir.c
+++ b/procfs/rootdir.c
@@ -432,7 +432,7 @@ rootdir_gc_slabinfo (void *hook, char **contents, ssize_t 
*contents_len)
   if (err)
     return err;
 
-  m = open_memstream (contents, contents_len);
+  m = open_memstream (contents, (size_t *) contents_len);
   if (m == NULL)
     {
       err = ENOMEM;
@@ -467,8 +467,8 @@ rootdir_gc_slabinfo (void *hook, char **contents, ssize_t 
*contents_len)
   fclose (m);
 
  out:
-  vm_deallocate (mach_task_self (),
-                 cache_info, cache_info_count * sizeof *cache_info);
+  vm_deallocate (mach_task_self (), (vm_address_t) cache_info,
+                 cache_info_count * sizeof *cache_info);
   return err;
 }
 
@@ -481,7 +481,7 @@ rootdir_gc_filesystems (void *hook, char **contents, 
ssize_t *contents_len)
   glob_t matches;
   FILE *m;
 
-  m = open_memstream (contents, contents_len);
+  m = open_memstream (contents, (size_t *) contents_len);
   if (m == NULL)
     return errno;
 
@@ -574,7 +574,7 @@ rootdir_make_translated_node (void *dir_hook, const void 
*entry_hook)
       return np;
     }
 
-  np = procfs_make_node (entry_hook, entry_hook);
+  np = procfs_make_node (entry_hook, (void *) entry_hook);
   if (np == NULL)
     return NULL;
 
diff --git a/random/Makefile b/random/Makefile
index 0949b63..5f8a62c 100644
--- a/random/Makefile
+++ b/random/Makefile
@@ -24,7 +24,7 @@ target = random
 SRCS = random.c gnupg-random.c gnupg-rmd160.c
 OBJS = $(SRCS:.c=.o) startup_notifyServer.o
 LCLHDRS = gnupg-random.h gnupg-rmd.h gnupg-bithelp.h random.h
-HURDLIBS = trivfs ports fshelp ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+HURDLIBS = trivfs ports fshelp ihash iohelp shouldbeinlibc
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/random/gnupg-random.c b/random/gnupg-random.c
index 54ee3c5..3cf7812 100644
--- a/random/gnupg-random.c
+++ b/random/gnupg-random.c
@@ -98,8 +98,8 @@
 
 static int is_initialized;
 #define MASK_LEVEL(a) do {if( a > 2 ) a = 2; else if( a < 0 ) a = 0; } while(0)
-static char *rndpool;  /* allocated size is POOLSIZE+BLOCKLEN */
-static char *keypool;  /* allocated size is POOLSIZE+BLOCKLEN */
+static byte *rndpool;  /* allocated size is POOLSIZE+BLOCKLEN */
+static byte *keypool;  /* allocated size is POOLSIZE+BLOCKLEN */
 static size_t pool_readpos;
 static size_t pool_writepos;
 static int pool_filled;
@@ -209,7 +209,7 @@ quick_random_gen( int onoff )
 void
 randomize_buffer( byte *buffer, size_t length, int level )
 {
-    char *p = get_random_bits( length*8, level, 1 );
+    byte *p = get_random_bits( length*8, level, 1 );
     memcpy( buffer, p, length );
     m_free(p);
 }
@@ -267,8 +267,8 @@ get_random_bits( size_t nbits, int level, int secure )
 static void
 mix_pool(byte *pool)
 {
-    char *hashbuf = pool + POOLSIZE;
-    char *p, *pend;
+    byte *hashbuf = pool + POOLSIZE;
+    byte *p, *pend;
     int i, n;
     RMD160_CONTEXT md;
 
@@ -291,7 +291,7 @@ mix_pool(byte *pool)
        if( p+DIGESTLEN+BLOCKLEN < pend )
            memcpy(hashbuf+DIGESTLEN, p+DIGESTLEN, BLOCKLEN-DIGESTLEN);
        else {
-           char *pp = p+DIGESTLEN;
+           byte *pp = p+DIGESTLEN;
            for(i=DIGESTLEN; i < BLOCKLEN; i++ ) {
                if( pp >= pend )
                    pp = pool;
@@ -323,7 +323,7 @@ read_seed_file()
 {
     int fd;
     struct stat sb;
-    unsigned char buffer[POOLSIZE];
+    byte buffer[POOLSIZE];
     int n;
 
     if( !seed_file_name )
diff --git a/random/gnupg-rmd.h b/random/gnupg-rmd.h
index 2446fc7..102624a 100644
--- a/random/gnupg-rmd.h
+++ b/random/gnupg-rmd.h
@@ -33,6 +33,6 @@ typedef struct {
 } RMD160_CONTEXT;
 
 void rmd160_init( RMD160_CONTEXT *hd );
-void rmd160_mixblock( RMD160_CONTEXT *hd, char *buffer );
+void rmd160_mixblock( RMD160_CONTEXT *hd, byte *buffer );
 
 #endif /*G10_RMD_H*/
diff --git a/random/gnupg-rmd160.c b/random/gnupg-rmd160.c
index 6610768..8f4207b 100644
--- a/random/gnupg-rmd160.c
+++ b/random/gnupg-rmd160.c
@@ -458,9 +458,9 @@ rmd160_write( RMD160_CONTEXT *hd, byte *inbuf, size_t inlen)
  * Returns: 16 bytes in buffer with the mixed contentes of buffer.
  */
 void
-rmd160_mixblock( RMD160_CONTEXT *hd, char *buffer )
+rmd160_mixblock( RMD160_CONTEXT *hd, byte *buffer )
 {
-    char *p = buffer;
+    byte *p = buffer;
     transform( hd, buffer );
   #define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0)
     X(0);
@@ -536,12 +536,6 @@ rmd160_final( RMD160_CONTEXT *hd )
   #undef X
 }
 
-static byte *
-rmd160_read( RMD160_CONTEXT *hd )
-{
-    return hd->buf;
-}
-
 
 
 /****************
@@ -560,6 +554,14 @@ rmd160_hash_buffer( char *outbuf, const char *buffer, 
size_t length )
 }
 
 
+#ifndef __HURD__
+
+static byte *
+rmd160_read( RMD160_CONTEXT *hd )
+{
+    return hd->buf;
+}
+
 /****************
  * Return some information about the algorithm.  We need algo here to
  * distinguish different flavors of the algorithm.
@@ -643,9 +645,6 @@ gnupgext_enum_func( int what, int *sequence, int *class, 
int *vers )
     return ret;
 }
 
-
-
-#ifndef __HURD__
 #ifndef IS_MODULE
 void
 rmd160_constructor(void)
diff --git a/random/random.c b/random/random.c
index 15be383..8f76c5b 100644
--- a/random/random.c
+++ b/random/random.c
@@ -17,6 +17,7 @@
 
 #define _GNU_SOURCE 1
 
+#include <hurd/paths.h>
 #include <hurd/trivfs.h>
 #include <hurd/startup.h>
 #include <stdio.h>
@@ -142,6 +143,11 @@ trivfs_S_io_read (struct trivfs_protid *cred,
                  data_t *data, mach_msg_type_number_t *data_len,
                  loff_t offs, mach_msg_type_number_t amount)
 {
+  error_t err;
+  mach_msg_type_number_t read_amount = 0;
+  void *buf = NULL;
+  size_t length;
+
   /* Deny access if they have bad credentials. */
   if (! cred)
     return EOPNOTSUPP;
@@ -150,21 +156,27 @@ trivfs_S_io_read (struct trivfs_protid *cred,
 
   pthread_mutex_lock (&global_lock);
 
-  if (amount > 0)
+  while (amount > 0)
     {
       mach_msg_type_number_t new_amount;
+      /* XXX: It would be nice to fix readable_pool to work for sizes
+        greater than the POOLSIZE.  Otherwise we risk detecting too
+        late that we run out of entropy and all that entropy is
+        wasted.  */
       while (readable_pool (amount, level) == 0)
        {
          if (cred->po->openmodes & O_NONBLOCK)
            {
              pthread_mutex_unlock (&global_lock);
-             return EWOULDBLOCK;
+             err = EWOULDBLOCK;
+             goto errout;
            }
          read_blocked = 1;
          if (pthread_hurd_cond_wait_np (&wait, &global_lock))
            {
              pthread_mutex_unlock (&global_lock);
-             return EINTR;
+             err = EINTR;
+             goto errout;
            }
          /* See term/users.c for possible race?  */
        }
@@ -174,27 +186,35 @@ trivfs_S_io_read (struct trivfs_protid *cred,
        {
          *data = mmap (0, amount, PROT_READ|PROT_WRITE,
                                       MAP_ANON, 0, 0);
+
          if (*data == MAP_FAILED)
            {
              pthread_mutex_unlock (&global_lock);
              return errno;
            }
-       }
 
-      new_amount = read_pool ((byte *) *data, amount, level);
+         /* Keep track of our map in case of errors.  */
+         buf = *data, length = amount;
 
-      if (new_amount < amount)
-       munmap (*data + round_page (new_amount),
-               round_page(amount) - round_page (new_amount));
-      amount = new_amount;
+         /* Update DATA_LEN to reflect the new buffers size.  */
+         *data_len = amount;
+       }
+
+      new_amount = read_pool (((byte *) *data) + read_amount, amount, level);
+      read_amount += new_amount;
+      amount -= new_amount;
     }
-  *data_len = amount;
 
   /* Set atime, see term/users.c */
 
   pthread_mutex_unlock (&global_lock);
-
+  *data_len = read_amount;
   return 0;
+
+ errout:
+  if (buf)
+    munmap (buf, length);
+  return err;
 }
 
 /* Write data to an IO object.  If offset is -1, write at the object
@@ -486,25 +506,20 @@ trivfs_append_args (struct trivfs_control *fsys,
 {
   error_t err = 0;
   char *opt;
-  
+
   pthread_mutex_lock (&global_lock);
   switch (level)
     {
     case 0:
-      {
        opt = "--weak";
        break;
-      }
+
     case 1:
-      {
        opt = "--fast";
        break;
-      }
+
     default:
-      {
        opt = "--secure";
-       break;
-      }
     }
   if (level != DEFAULT_LEVEL)
     err = argz_add (argz, argz_len, opt);
@@ -557,12 +572,11 @@ sigterm_handler (int signo)
   raise (SIGTERM);
 }
 
-void
+static error_t
 arrange_shutdown_notification ()
 {
   error_t err;
   mach_port_t initport, notify;
-  process_t procserver;
   struct port_info *pi;
 
   shutdown_notify_class = ports_create_class (0, 0);
@@ -575,24 +589,21 @@ arrange_shutdown_notification ()
   err = ports_create_port (shutdown_notify_class, fsys->pi.bucket,
                           sizeof (struct port_info), &pi);
   if (err)
-    return;
-
-  procserver = getproc ();
-  if (!procserver)
-    return;
+    return err;
 
-  err = proc_getmsgport (procserver, 1, &initport);
-  mach_port_deallocate (mach_task_self (), procserver);
-  if (err)
-    return;
+  initport = file_name_lookup (_SERVERS_STARTUP, 0, 0);
+  if (! MACH_PORT_VALID (initport))
+    return errno;
 
   notify = ports_get_send_right (pi);
   ports_port_deref (pi);
-  startup_request_notification (initport, notify,
-                               MACH_MSG_TYPE_MAKE_SEND,
-                               program_invocation_short_name);
+  err = startup_request_notification (initport, notify,
+                                     MACH_MSG_TYPE_MAKE_SEND,
+                                     program_invocation_short_name);
+
   mach_port_deallocate (mach_task_self (), notify);
   mach_port_deallocate (mach_task_self (), initport);
+  return err;
 }
 
 
@@ -626,7 +637,9 @@ main (int argc, char **argv)
   if (err)
     error (3, err, "trivfs_startup");
 
-  arrange_shutdown_notification ();
+  err = arrange_shutdown_notification ();
+  if (err)
+    error (0, err, "Cannot request shutdown notification");
 
   /* Launch. */
   ports_manage_port_operations_multithread (fsys->pi.bucket, random_demuxer,
diff --git a/startup/startup.c b/startup/startup.c
index e916768..9c45f4b 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -1329,7 +1329,7 @@ do_mach_notify_dead_name (mach_port_t notify,
                   boots[i].name);
            crash_mach ();
          }
-      error (0, 0, "BUG!  Unexpected dead-name notification (name %#zx)",
+      error (0, 0, "BUG!  Unexpected dead-name notification (name %#lx)",
             name);
       crash_mach ();
     }
diff --git a/storeio/Makefile b/storeio/Makefile
index c131758..83b7684 100644
--- a/storeio/Makefile
+++ b/storeio/Makefile
@@ -24,6 +24,6 @@ SRCS = dev.c storeio.c open.c pager.c io.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = trivfs pager fshelp iohelp store ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/storeio/pager.c b/storeio/pager.c
index f8f59cd..54b1714 100644
--- a/storeio/pager.c
+++ b/storeio/pager.c
@@ -155,7 +155,6 @@ init_dev_paging ()
       pthread_mutex_lock (&pager_global_lock);
       if (pager_port_bucket == NULL)
        {
-         pthread_t thread;
          error_t err;
 
          pager_port_bucket = ports_create_bucket ();
diff --git a/term/Makefile b/term/Makefile
index 1419d2a..df91c21 100644
--- a/term/Makefile
+++ b/term/Makefile
@@ -26,13 +26,15 @@ target = term
 SRCS = devio.c munge.c users.c main.c ptyio.c hurdio.c xinl.c
 
 HURDLIBS = trivfs fshelp iohelp ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 OBJS = $(subst .c,.o,$(SRCS)) termServer.o device_replyServer.o tioctlServer.o 
ourmsgUser.o
 
 include ../Makeconf
 
 device_replyServer-CPPFLAGS = -DTypeCheck=0 -Wno-unused # XXX
 
-device_reply-MIGSFLAGS = -DMACH_PAYLOAD_TO_PORT=ports_payload_get_name
+device_reply-MIGSFLAGS=\
+    "-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name" \
+    "-DDEVICE_IMPORTS=import \"$(srcdir)/../libports/ports.h\";"
 tioctl-MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
 term-MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
diff --git a/term/mig-mutate.h b/term/mig-mutate.h
index af8877e..9fcdbbc 100644
--- a/term/mig-mutate.h
+++ b/term/mig-mutate.h
@@ -22,6 +22,7 @@
 #define IO_INTRAN trivfs_protid_t trivfs_begin_using_protid (io_t)
 #define IO_INTRAN_PAYLOAD trivfs_protid_t trivfs_begin_using_protid_payload
 #define IO_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
+#define IO_OUTTRAN io_t trivfs_convert_to_port (trivfs_protid_t)
 
 #define CTTY_INTRAN                                    \
   port_info_t begin_using_ctty_port (mach_port_t)
diff --git a/tmpfs/Makefile b/tmpfs/Makefile
index fdcae34..bcb76e9 100644
--- a/tmpfs/Makefile
+++ b/tmpfs/Makefile
@@ -24,6 +24,6 @@ SRCS = tmpfs.c node.c dir.c pager-stubs.c
 OBJS = $(SRCS:.c=.o) default_pagerUser.o
 # XXX The shared libdiskfs requires libstore even though we don't use it here.
 HURDLIBS = diskfs pager iohelp fshelp store ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/trans/Makefile b/trans/Makefile
index ce1eae7..65b51d1 100644
--- a/trans/Makefile
+++ b/trans/Makefile
@@ -45,7 +45,9 @@ ifsock-MIGSFLAGS=\
     "-DIFSOCK_IMPORTS=import \"../libtrivfs/mig-decls.h\";"
 
 # device_replyServer is used by the streamio translator.
-device_reply-MIGSFLAGS="-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name"
+device_reply-MIGSFLAGS=\
+    "-DMACH_PAYLOAD_TO_PORT=ports_payload_get_name" \
+    "-DDEVICE_IMPORTS=import \"$(srcdir)/../libports/ports.h\";"
 
 # fsysServer is only used by the symlink translator which does not use
 # libports.  Disable the default payload to port conversion.
@@ -55,22 +57,21 @@ include ../Makeconf
 
 vpath elfcore.c $(top_srcdir)/exec
 
-symlink: fsysServer.o
-ifsock: ifsockServer.o
 crash: crashServer.o crash_replyUser.o msgServer.o elfcore.o
+ifsock: ifsockServer.o
+mtab: fsUser.o
 password: passwordServer.o
-streamio: device_replyServer.o
 proxy-defpager: default_pagerServer.o default_pagerUser.o
+streamio: device_replyServer.o
+symlink: fsysServer.o
 
-proxy-defpager crash password streamio: ../libports/libports.a 
../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a
+fakeroot: ../libnetfs/libnetfs.a
 fifo new-fifo: ../libpipe/libpipe.a
-fwd: ../libfshelp/libfshelp.a ../libports/libports.a
-hello-mt magic null ifsock fifo new-fifo firmlink: ../libtrivfs/libtrivfs.a 
../libfshelp/libfshelp.a ../libports/libports.a ../libihash/libihash.a
-magic: ../libiohelp/libiohelp.a
-hello: ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a 
../libports/libports.a ../libihash/libihash.a
-fakeroot: ../libnetfs/libnetfs.a ../libfshelp/libfshelp.a 
../libiohelp/libiohelp.a ../libports/libports.a ../libihash/libihash.a
-remap: ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a 
../libports/libports.a ../libihash/libihash.a
-mtab: ../libtrivfs/libtrivfs.a ../libfshelp/libfshelp.a ../libports/libports.a 
../libihash/libihash.a fsUser.o
-$(targets): ../libshouldbeinlibc/libshouldbeinlibc.a
+crash fifo firmlink hello hello-mt ifsock magic mtab new-fifo null password 
proxy-defpager remap streamio: ../libtrivfs/libtrivfs.a
+$(targets): ../libfshelp/libfshelp.a \
+       ../libihash/libihash.a \
+       ../libiohelp/libiohelp.a \
+       ../libports/libports.a \
+       ../libshouldbeinlibc/libshouldbeinlibc.a
 
 $(targets): %: %.o
diff --git a/trans/mtab.c b/trans/mtab.c
index a9928b3..e855080 100644
--- a/trans/mtab.c
+++ b/trans/mtab.c
@@ -330,7 +330,7 @@ mtab_mark_as_seen (struct mtab *mtab, mach_port_t node)
       return TRUE;
     }
 
-  hurd_ihash_add (&mtab->ports_seen, idport, idport);
+  hurd_ihash_add (&mtab->ports_seen, idport, (hurd_ihash_value_t) idport);
   return FALSE;
 }
 
diff --git a/trans/streamio.c b/trans/streamio.c
index 507250b..a80975f 100644
--- a/trans/streamio.c
+++ b/trans/streamio.c
@@ -808,7 +808,7 @@ dev_open (const char *name, dev_mode_t mode)
                              phys_reply_writes, MACH_MSG_TYPE_MAKE_SEND);
     }
 
-  err = device_open_request (device_master, phys_reply, mode, name);
+  err = device_open_request (device_master, phys_reply, mode, (char *) name);
   if (err)
     {
       mach_port_deallocate (mach_task_self (), phys_reply);
diff --git a/usermux/Makefile b/usermux/Makefile
index c30b5ab..8df24d4 100644
--- a/usermux/Makefile
+++ b/usermux/Makefile
@@ -25,6 +25,6 @@ SRCS = usermux.c mux.c leaf.c node.c stubs.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = netfs fshelp iohelp ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread
+LDLIBS = -lpthread
 
 include ../Makeconf
diff --git a/utils/Makefile b/utils/Makefile
index 955789b..603b722 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -54,12 +54,13 @@ login addauth setauth: nonsugid.o
 addauth rmauth setauth unsu: frobauth.o
 rmauth setauth unsu: frobauth-mod.o
 ps w: psout.o ../libps/libps.a ../libihash/libihash.a
-portinfo: ../libps/libps.a
+portinfo: ../libihash/libihash.a ../libps/libps.a
 
 storeinfo storecat storeread: ../libstore/libstore.a
 ftpcp ftpdir: ../libftpconn/libftpconn.a
-
-settrans: ../libfshelp/libfshelp.a ../libports/libports.a
+mount umount: ../libihash/libihash.a
+settrans: ../libfshelp/libfshelp.a ../libihash/libihash.a \
+       ../libports/libports.a
 ps w ids settrans syncfs showtrans fsysopts storeinfo login vmstat portinfo \
   devprobe vminfo addauth rmauth setauth unsu ftpcp ftpdir storeread \
   storecat msgport mount umount nullauth rpctrace: \
diff --git a/utils/rpcscan.c b/utils/rpcscan.c
index 2270ea8..3ddf791 100644
--- a/utils/rpcscan.c
+++ b/utils/rpcscan.c
@@ -201,7 +201,6 @@ error_t
 setup_extract_target (void)
 {
   error_t err;
-  char *name = (char *) setup_argument;
   mach_port_t request;
   mach_msg_type_name_t requestType;
 
@@ -337,7 +336,7 @@ const struct argp_child children[] =
     { 0 }
   };
 
-const struct argp argp = { options, parse_opt, args_doc, doc, &children };
+const struct argp argp = { options, parse_opt, args_doc, doc, children };
 
 void
 format_msgid (char *buf, size_t len, mach_msg_id_t id)
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index d53b510..276377c 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -353,7 +353,7 @@ new_send_wrapper (struct receiver_info *receive, task_t 
task,
   assert_perror (err);
 
   TRACED_INFO (info)->name = 0;
-  asprintf (&TRACED_INFO (info)->name, "  %d<--%d(pid%d)", 
+  asprintf (&TRACED_INFO (info)->name, "  %lu<--%lu(pid%d)", 
            receive->forward, TRACED_INFO (info)->pi.port_right, task2pid 
(task));
   TRACED_INFO (info)->type = MACH_MSG_TYPE_MOVE_SEND;
   info->task = task;
@@ -979,7 +979,7 @@ wrap_all_threads (task_t task)
                                                  task, &new_thread_port);
          free (TRACED_INFO (thread_send_wrapper)->name);
          asprintf (&TRACED_INFO (thread_send_wrapper)->name,
-                   "thread%d(pid%d)", threads[i], task2pid (task));
+                   "thread%lu(pid%d)", threads[i], task2pid (task));
 
          err = mach_port_insert_right (mach_task_self (),
                                        new_thread_port, new_thread_port,
@@ -994,7 +994,8 @@ wrap_all_threads (task_t task)
          mach_port_deallocate (mach_task_self (), new_thread_port);
        }
     }
-  vm_deallocate (mach_task_self (), threads, nthreads * sizeof (thread_t));
+  vm_deallocate (mach_task_self (), (vm_address_t) threads,
+                 nthreads * sizeof (thread_t));
 }
 
 /* Wrap the new thread port that is in the message. */
@@ -1030,7 +1031,7 @@ wrap_new_thread (mach_msg_header_t *inp, struct req_info 
*req)
   mach_port_deallocate (mach_task_self (), reply->child_thread);
 
   free (TRACED_INFO (send_wrapper)->name);
-  asprintf (&TRACED_INFO (send_wrapper)->name, "thread%d(pid%d)",
+  asprintf (&TRACED_INFO (send_wrapper)->name, "thread%lu(pid%d)",
            thread_port, task2pid (req->from));
   ports_port_deref (send_wrapper);
 }
@@ -1077,10 +1078,10 @@ wrap_new_task (mach_msg_header_t *inp, struct req_info 
*req)
 
   pid = task2pid (task_port);
   free (TRACED_INFO (task_wrapper1)->name);
-  asprintf (&TRACED_INFO (task_wrapper1)->name, "task%d(pid%d)",
+  asprintf (&TRACED_INFO (task_wrapper1)->name, "task%lu(pid%d)",
            task_port, task2pid (req->from));
   free (TRACED_INFO (task_wrapper2)->name);
-  asprintf (&TRACED_INFO (task_wrapper2)->name, "task%d(pid%d)",
+  asprintf (&TRACED_INFO (task_wrapper2)->name, "task%lu(pid%d)",
            task_port, pid);
   ports_port_deref (task_wrapper1);
 }
@@ -1131,7 +1132,7 @@ trace_and_forward (mach_msg_header_t *inp, 
mach_msg_header_t *outp)
            MACH_MSGH_BITS_REMOTE (inp->msgh_bits),
            is_notification (inp)? MACH_MSG_TYPE_MOVE_SEND_ONCE: info->type)
            | MACH_MSGH_BITS_OTHER (inp->msgh_bits);
-         inp->msgh_local_port = ports_payload_get_name (info);
+         inp->msgh_local_port = ports_payload_get_name ((unsigned int) info);
        }
     }
   else
@@ -1276,8 +1277,8 @@ trace_and_forward (mach_msg_header_t *inp, 
mach_msg_header_t *outp)
          && inp->msgh_size >= sizeof (mig_reply_header_t)
          /* The notification message is considered as a request. */
          && (inp->msgh_id > 72 || inp->msgh_id < 64)
-         && (*(int *) &((mig_reply_header_t *) inp)->RetCodeType
-             == *(int *)&RetCodeType))
+          && !memcmp(&((mig_reply_header_t *) inp)->RetCodeType,
+                     &RetCodeType, sizeof (RetCodeType)))
        {
          struct req_info *req = remove_request (inp->msgh_id - 100,
                                                 inp->msgh_remote_port);
@@ -1645,7 +1646,7 @@ traced_spawn (char **argv, char **envp)
   ti = new_send_wrapper (receive_ti, traced_task, &task_wrapper);
   ti->task = traced_task;
   free (TRACED_INFO (ti)->name);
-  asprintf (&TRACED_INFO (ti)->name, "task%d(pid%d)", traced_task, pid);
+  asprintf (&TRACED_INFO (ti)->name, "task%lu(pid%d)", traced_task, pid);
 
   /* Replace the task's kernel port with the wrapper.  When this task calls
      `mach_task_self ()', it will get our wrapper send right instead of its
@@ -1741,7 +1742,7 @@ main (int argc, char **argv, char **envp)
       { .argp=&msgid_argp, },
       { 0 }
     };
-  const struct argp argp = { options, parse_opt, args_doc, doc, &children };
+  const struct argp argp = { options, parse_opt, args_doc, doc, children };
 
   /* Parse our arguments.  */
   argp_parse (&argp, argc, argv, ARGP_IN_ORDER, 0, 0);
diff --git a/utils/shd.c b/utils/shd.c
index a1a4b26..feff613 100644
--- a/utils/shd.c
+++ b/utils/shd.c
@@ -106,7 +106,8 @@ run (char **argv, int fd0, int fd1)
        }
       else
        {
-         int save0, save1;
+         int save0 = -1;
+         int save1;
 
          inline int movefd (int from, int to, int *save)
            {
diff --git a/utils/vminfo.c b/utils/vminfo.c
index 6ead677..2718591 100644
--- a/utils/vminfo.c
+++ b/utils/vminfo.c
@@ -182,29 +182,29 @@ main (int argc, char **argv)
          if ((what & (W_ADDRS|W_SIZES)) == (W_ADDRS|W_SIZES))
            {
              if (hex)
-               printf ("          [%#zx] (hole)\n", addr - hole_addr);
+               printf ("          [%#lx] (hole)\n", addr - hole_addr);
              else
-               printf ("          [%zd] (hole)\n", addr - hole_addr);
+               printf ("          [%lu] (hole)\n", addr - hole_addr);
            }
          else if ((what & (W_ADDRS|W_SIZES)) == W_SIZES)
            {
              if (hex)
-               printf ("%#10zx (hole)\n", addr - hole_addr);
+               printf ("%#10lx (hole)\n", addr - hole_addr);
              else
-               printf ("%10zu (hole)\n", addr - hole_addr);
+               printf ("%10lu (hole)\n", addr - hole_addr);
            }
        }
 
       if ((what & (W_ADDRS|W_SIZES)) == (W_ADDRS|W_SIZES))
        if (hex)
-         printf ("%#10zx[%#zx]", addr, size);
+         printf ("%#10lx[%#zx]", addr, size);
        else
-         printf ("%10zu[%zd]", addr, size);
+         printf ("%10lu[%zd]", addr, size);
       else if ((what & (W_ADDRS|W_SIZES)) == W_ADDRS)
        if (hex)
-         printf ("%#10zx", addr);
+         printf ("%#10lx", addr);
        else
-         printf ("%10zu", addr);
+         printf ("%10lu", addr);
       else if ((what & (W_ADDRS|W_SIZES)) == W_SIZES)
        {
          if (hex)
@@ -222,13 +222,13 @@ main (int argc, char **argv)
          if (shared)
            printf (", shared");
          if (obj != MACH_PORT_NULL)
-           printf (", mem_obj=%d", obj);
+           printf (", mem_obj=%lu", obj);
          if (offs != 0)
            {
              if (hex)
-               printf (", offs=%#zx", offs);
+               printf (", offs=%#lx", offs);
              else
-               printf (", offs=%zd", offs);
+               printf (", offs=%lu", offs);
            }
          putchar (')');
        }
diff --git a/utils/vmstat.c b/utils/vmstat.c
index 92a3672..bdd1d81 100644
--- a/utils/vmstat.c
+++ b/utils/vmstat.c
@@ -477,10 +477,6 @@ main (int argc, char **argv)
    ? size_units                                                                
      \
    : ((field)->type == PAGESZ ? 0 : state.vmstats.pagesize))
 
-    /* Prints SEP if the variable FIRST is 0, otherwise, prints START (if
-       it's non-zero), and sets first to 0.  */
-#define PSEP(sep, start) \
-    (first ? (first = 0, (start && fputs (start, stdout))) : fputs (sep, 
stdout))
 #define PVAL(val, field, width, sign) \
     print_val (val, (field)->type, SIZE_UNITS (field), width, sign)
     /* Intuit the likely maximum field width of FIELD.  */
@@ -539,7 +535,13 @@ main (int argc, char **argv)
                      const_fields &= ~(1 << (field - fields));
                    else
                      {
-                       PSEP (", ", "(");
+                        if (first)
+                          {
+                            first = 0;
+                            fputs("(", stdout);
+                          }
+                        else
+                          fputs(",", stdout);
                        printf ("%s: ", field->name);
                        PVAL (val, field, 0, 0);
                      }
@@ -570,7 +572,10 @@ main (int argc, char **argv)
              for (field = fields, num = 0, first = 1; field->name; field++, 
num++)
                if (output_fields & (1 << (field - fields)))
                  {
-                   PSEP (" ", 0);
+                    if (first)
+                      first = 0;
+                    else
+                      fputs (" ", stdout);
                    fprintf (stdout, "%*s", fwidths[num], field->hdr);
                  }
              putchar ('\n');
@@ -601,7 +606,10 @@ main (int argc, char **argv)
                            val -= vm_state_get_field (&prev_state, field);
                          }
 
-                       PSEP (" ", 0);
+                        if (first)
+                          first = 0;
+                        else
+                          fputs (" ", stdout);
                        PVAL (val, field, fwidths[num], sign);
                      }
                  }
diff --git a/utils/w.c b/utils/w.c
index 3755508..ac5e36f 100644
--- a/utils/w.c
+++ b/utils/w.c
@@ -258,7 +258,6 @@ add_utmp_procs (struct proc_stat_list *procs, struct utmp 
*u)
   io_t tty_node;
   error_t err;
   pid_t pid;
-  int pos;
   struct proc_stat *ps;
 
   switch (u->ut_type)
@@ -300,7 +299,7 @@ add_utmp_procs (struct proc_stat_list *procs, struct utmp 
*u)
     }
 
   /* The new process will get added at the end, so look for it there. */
-  pos = proc_stat_list_num_procs (procs);
+  (void) proc_stat_list_num_procs (procs);
   if (pid >= 0)
     err = proc_stat_list_add_pid (procs, pid, &ps);
   else

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

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