diff options
Diffstat (limited to 'debian/patches')
6 files changed, 1607 insertions, 0 deletions
diff --git a/debian/patches/0001-libpager-remove-the-seqno-parameters.patch b/debian/patches/0001-libpager-remove-the-seqno-parameters.patch new file mode 100644 index 00000000..dcff12e0 --- /dev/null +++ b/debian/patches/0001-libpager-remove-the-seqno-parameters.patch @@ -0,0 +1,330 @@ +From f878de5006045c849415afffaffc909458b5f6de Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Sun, 7 Dec 2014 17:22:31 +0100 +Subject: [PATCH hurd 1/5] libpager: remove the `seqno' parameters + +* libpager/Makefile (MIGSFLAGS): Drop `-DSEQNOS'. +* libpager/priv.h (struct pager): Drop fields `seqno' and `waitingforseqno'. +* libpager/chg-compl.c: Adopt accordingly. +* libpager/data-request.c: Likewise. +* libpager/data-return.c: Likewise. +* libpager/data-unlock.c: Likewise. +* libpager/demuxer.c: Likewise. +* libpager/lock-completed.c: Likewise. +* libpager/no-senders.c: Likewise. +* libpager/notify-stubs.c: Likewise. +* libpager/object-init.c: Likewise. +* libpager/object-terminate.c: Likewise. +* libpager/pager-create.c: Likewise. +* libpager/stubs.c: Likewise. +--- + libpager/Makefile | 2 +- + libpager/chg-compl.c | 3 +-- + libpager/data-request.c | 3 +-- + libpager/data-return.c | 13 ++++++------- + libpager/data-unlock.c | 3 +-- + libpager/demuxer.c | 4 ++-- + libpager/lock-completed.c | 3 +-- + libpager/no-senders.c | 3 +-- + libpager/notify-stubs.c | 15 +++++---------- + libpager/object-init.c | 3 +-- + libpager/object-terminate.c | 3 +-- + libpager/pager-create.c | 2 -- + libpager/priv.h | 3 --- + libpager/stubs.c | 9 +++------ + 14 files changed, 24 insertions(+), 45 deletions(-) + +diff --git a/libpager/Makefile b/libpager/Makefile +index a15a899..2bfd845 100644 +--- a/libpager/Makefile ++++ b/libpager/Makefile +@@ -31,7 +31,7 @@ HURDLIBS= ports + LDLIBS += -lpthread + OBJS = $(SRCS:.c=.o) memory_objectServer.o notifyServer.o + +-MIGSFLAGS = -DSEQNOS -imacros $(srcdir)/mig-mutate.h ++MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h + MIGCOMSFLAGS = -prefix _pager_ + + include ../Makeconf +diff --git a/libpager/chg-compl.c b/libpager/chg-compl.c +index 89ccfc8..3ffe60a 100644 +--- a/libpager/chg-compl.c ++++ b/libpager/chg-compl.c +@@ -22,8 +22,7 @@ + when a memory_object_change_attributes call has completed. Read this + in combination with pager-attr.c. */ + kern_return_t +-_pager_seqnos_memory_object_change_completed (struct pager *p, +- mach_port_seqno_t seq, ++_pager_S_memory_object_change_completed (struct pager *p, + boolean_t maycache, + memory_object_copy_strategy_t strat) + { +diff --git a/libpager/data-request.c b/libpager/data-request.c +index 18f3de6..7069fc8 100644 +--- a/libpager/data-request.c ++++ b/libpager/data-request.c +@@ -22,8 +22,7 @@ + + /* Implement pagein callback as described in <mach/memory_object.defs>. */ + kern_return_t +-_pager_seqnos_memory_object_data_request (struct pager *p, +- mach_port_seqno_t seqno, ++_pager_S_memory_object_data_request (struct pager *p, + mach_port_t control, + vm_offset_t offset, + vm_size_t length, +diff --git a/libpager/data-return.c b/libpager/data-return.c +index f16f323..01f3db2 100644 +--- a/libpager/data-return.c ++++ b/libpager/data-return.c +@@ -21,13 +21,12 @@ + #include <string.h> + #include <assert.h> + +-/* Worker function used by _pager_seqnos_memory_object_data_return +- and _pager_seqnos_memory_object_data_initialize. All args are +- as for _pager_seqnos_memory_object_data_return; the additional ++/* Worker function used by _pager_S_memory_object_data_return ++ and _pager_S_memory_object_data_initialize. All args are ++ as for _pager_S_memory_object_data_return; the additional + INITIALIZING arg identifies which function is calling us. */ + kern_return_t + _pager_do_write_request (struct pager *p, +- mach_port_seqno_t seqno, + mach_port_t control, + vm_offset_t offset, + pointer_t data, +@@ -113,6 +112,7 @@ _pager_do_write_request (struct pager *p, + than we really have to require (because *all* future writes on + this object are going to wait for seqno while we wait for the + previous write), but the case is relatively infrequent. */ ++ /* XXX: Is this still needed? */ + retry: + for (i = 0; i < npages; i++) + if (pm_entries[i] & PM_PAGINGOUT) +@@ -254,8 +254,7 @@ _pager_do_write_request (struct pager *p, + + /* Implement pageout call back as described by <mach/memory_object.defs>. */ + kern_return_t +-_pager_seqnos_memory_object_data_return (struct pager *p, +- mach_port_seqno_t seqno, ++_pager_S_memory_object_data_return (struct pager *p, + mach_port_t control, + vm_offset_t offset, + pointer_t data, +@@ -263,6 +262,6 @@ _pager_seqnos_memory_object_data_return (struct pager *p, + int dirty, + int kcopy) + { +- return _pager_do_write_request (p, seqno, control, offset, data, ++ return _pager_do_write_request (p, control, offset, data, + length, dirty, kcopy, 0); + } +diff --git a/libpager/data-unlock.c b/libpager/data-unlock.c +index 8c7c776..8c9680c 100644 +--- a/libpager/data-unlock.c ++++ b/libpager/data-unlock.c +@@ -22,8 +22,7 @@ + /* Implement kernel requests for access as described in + <mach/memory_object.defs>. */ + kern_return_t +-_pager_seqnos_memory_object_data_unlock (struct pager *p, +- mach_port_seqno_t seqno, ++_pager_S_memory_object_data_unlock (struct pager *p, + mach_port_t control, + vm_offset_t offset, + vm_size_t length, +diff --git a/libpager/demuxer.c b/libpager/demuxer.c +index a06c4bf..57a6ccb 100644 +--- a/libpager/demuxer.c ++++ b/libpager/demuxer.c +@@ -88,8 +88,8 @@ pager_demuxer (struct requests *requests, + error_t err = MIG_NO_REPLY; + + mig_routine_t routine; +- if (! ((routine = _pager_seqnos_memory_object_server_routine (inp)) || +- (routine = _pager_seqnos_notify_server_routine (inp)))) ++ if (! ((routine = _pager_memory_object_server_routine (inp)) || ++ (routine = _pager_notify_server_routine (inp)))) + return FALSE; + + #define MASK (8u - 1u) +diff --git a/libpager/lock-completed.c b/libpager/lock-completed.c +index 30b1dd3..4b0d87a 100644 +--- a/libpager/lock-completed.c ++++ b/libpager/lock-completed.c +@@ -23,8 +23,7 @@ + when a memory_object_lock_request call has completed. Read this + in combination with lock-object.c. */ + kern_return_t +-_pager_seqnos_memory_object_lock_completed (struct pager *p, +- mach_port_seqno_t seqno, ++_pager_S_memory_object_lock_completed (struct pager *p, + mach_port_t control, + vm_offset_t offset, + vm_size_t length) +diff --git a/libpager/no-senders.c b/libpager/no-senders.c +index d0bbe27..b750101 100644 +--- a/libpager/no-senders.c ++++ b/libpager/no-senders.c +@@ -21,8 +21,7 @@ + #include "notify_S.h" + + error_t +-_pager_do_seqnos_mach_notify_no_senders (struct port_info *pi, +- mach_port_seqno_t seqno, ++_pager_do_mach_notify_no_senders (struct port_info *pi, + mach_port_mscount_t mscount) + { + if (!pi || +diff --git a/libpager/notify-stubs.c b/libpager/notify-stubs.c +index a826420..6440815 100644 +--- a/libpager/notify-stubs.c ++++ b/libpager/notify-stubs.c +@@ -23,8 +23,7 @@ + #include <errno.h> + + error_t +-_pager_do_seqnos_mach_notify_port_deleted (struct port_info *pi, +- mach_port_seqno_t seqno, ++_pager_do_mach_notify_port_deleted (struct port_info *pi, + mach_port_t name + __attribute__ ((unused))) + { +@@ -32,8 +31,7 @@ _pager_do_seqnos_mach_notify_port_deleted (struct port_info *pi, + } + + error_t +-_pager_do_seqnos_mach_notify_msg_accepted (struct port_info *pi, +- mach_port_seqno_t seqno, ++_pager_do_mach_notify_msg_accepted (struct port_info *pi, + mach_port_t name + __attribute__ ((unused))) + { +@@ -41,8 +39,7 @@ _pager_do_seqnos_mach_notify_msg_accepted (struct port_info *pi, + } + + error_t +-_pager_do_seqnos_mach_notify_port_destroyed (struct port_info *pi, +- mach_port_seqno_t seqno, ++_pager_do_mach_notify_port_destroyed (struct port_info *pi, + mach_port_t name + __attribute__ ((unused))) + { +@@ -50,15 +47,13 @@ _pager_do_seqnos_mach_notify_port_destroyed (struct port_info *pi, + } + + error_t +-_pager_do_seqnos_mach_notify_send_once (struct port_info *pi, +- mach_port_seqno_t seqno) ++_pager_do_mach_notify_send_once (struct port_info *pi) + { + return 0; + } + + error_t +-_pager_do_seqnos_mach_notify_dead_name (struct port_info *pi, +- mach_port_seqno_t seqno, ++_pager_do_mach_notify_dead_name (struct port_info *pi, + mach_port_t name + __attribute__ ((unused))) + { +diff --git a/libpager/object-init.c b/libpager/object-init.c +index eb62c44..619d28f 100644 +--- a/libpager/object-init.c ++++ b/libpager/object-init.c +@@ -22,8 +22,7 @@ + /* Implement the object initialiation call as described in + <mach/memory_object.defs>. */ + kern_return_t +-_pager_seqnos_memory_object_init (struct pager *p, +- mach_port_seqno_t seqno, ++_pager_S_memory_object_init (struct pager *p, + mach_port_t control, + mach_port_t name, + vm_size_t pagesize) +diff --git a/libpager/object-terminate.c b/libpager/object-terminate.c +index e8c6f38..9529821 100644 +--- a/libpager/object-terminate.c ++++ b/libpager/object-terminate.c +@@ -22,8 +22,7 @@ + /* Implement the object termination call from the kernel as described + in <mach/memory_object.defs>. */ + kern_return_t +-_pager_seqnos_memory_object_terminate (struct pager *p, +- mach_port_seqno_t seqno, ++_pager_S_memory_object_terminate (struct pager *p, + mach_port_t control, + mach_port_t name) + { +diff --git a/libpager/pager-create.c b/libpager/pager-create.c +index 1fc15b8..b583f02 100644 +--- a/libpager/pager-create.c ++++ b/libpager/pager-create.c +@@ -42,10 +42,8 @@ pager_create (struct user_pager_info *upi, + p->notify_on_evict = notify_on_evict; + p->memobjcntl = MACH_PORT_NULL; + p->memobjname = MACH_PORT_NULL; +- p->seqno = -1; + p->noterm = 0; + p->termwaiting = 0; +- p->waitingforseqno = 0; + p->pagemap = 0; + p->pagemapsize = 0; + +diff --git a/libpager/priv.h b/libpager/priv.h +index 4576e12..a45ae3f 100644 +--- a/libpager/priv.h ++++ b/libpager/priv.h +@@ -55,12 +55,9 @@ struct pager + memory_object_control_t memobjcntl; + memory_object_name_t memobjname; + +- mach_port_seqno_t seqno; +- + int noterm; /* number of threads blocking termination */ + + int termwaiting:1; +- int waitingforseqno:1; + + #ifdef KERNEL_INIT_RACE + /* Out of sequence object_init calls waiting for +diff --git a/libpager/stubs.c b/libpager/stubs.c +index c7f1a5a..9a766ec 100644 +--- a/libpager/stubs.c ++++ b/libpager/stubs.c +@@ -21,8 +21,7 @@ + #include <stdio.h> + + kern_return_t +-_pager_seqnos_memory_object_copy (struct pager *p, +- mach_port_seqno_t seq, ++_pager_S_memory_object_copy (struct pager *p, + memory_object_control_t obj_ctl, + vm_offset_t off, + vm_size_t len, +@@ -33,8 +32,7 @@ _pager_seqnos_memory_object_copy (struct pager *p, + } + + kern_return_t +-_pager_seqnos_memory_object_data_write (struct pager *p, +- mach_port_seqno_t seq, ++_pager_S_memory_object_data_write (struct pager *p, + mach_port_t ctl, + vm_offset_t off, + pointer_t data, +@@ -45,8 +43,7 @@ _pager_seqnos_memory_object_data_write (struct pager *p, + } + + kern_return_t +-_pager_seqnos_memory_object_supply_completed (struct pager *p, +- mach_port_seqno_t seq, ++_pager_S_memory_object_supply_completed (struct pager *p, + mach_port_t ctl, + vm_offset_t off, + vm_size_t len, +-- +2.1.3 + diff --git a/debian/patches/0002-libpager-use-libports-notification-functions.patch b/debian/patches/0002-libpager-use-libports-notification-functions.patch new file mode 100644 index 00000000..233530a2 --- /dev/null +++ b/debian/patches/0002-libpager-use-libports-notification-functions.patch @@ -0,0 +1,197 @@ +From 6a2dec41b11492b3d6295e9546934f3cf10e6e74 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Sun, 7 Dec 2014 17:57:14 +0100 +Subject: [PATCH hurd 2/5] libpager: use libports notification functions + +Now that we do not use sequence numbers anymore, we can simply use +libports notification server functions. + +* libpager/Makefile (SRCS): Drop `no-senders.c', and `notify-stubs.c'. +(OBJS): Drop `notifyServer.o'. +* libpager/demuxer.c (pager_demuxer): Use libports server functions. +* libpager/mig-mutate.h: Drop all notification mutators. +* libpager/no-senders.c: Remove file. +* libpager/notify-stubs.c: Likewise. +--- + libpager/Makefile | 6 ++--- + libpager/demuxer.c | 4 ++-- + libpager/mig-mutate.h | 9 -------- + libpager/no-senders.c | 34 --------------------------- + libpager/notify-stubs.c | 61 ------------------------------------------------- + 5 files changed, 5 insertions(+), 109 deletions(-) + delete mode 100644 libpager/no-senders.c + delete mode 100644 libpager/notify-stubs.c + +diff --git a/libpager/Makefile b/libpager/Makefile +index 2bfd845..72b4bfd 100644 +--- a/libpager/Makefile ++++ b/libpager/Makefile +@@ -20,16 +20,16 @@ makemode := library + libname = libpager + SRCS = data-request.c data-return.c data-unlock.c pager-port.c \ + inhibit-term.c lock-completed.c lock-object.c mark-error.c \ +- no-senders.c object-init.c object-terminate.c pagemap.c \ ++ object-init.c object-terminate.c pagemap.c \ + pager-create.c pager-flush.c pager-shutdown.c pager-sync.c \ + stubs.c demuxer.c chg-compl.c pager-attr.c clean.c \ +- dropweak.c notify-stubs.c get-upi.c pager-memcpy.c pager-return.c \ ++ dropweak.c get-upi.c pager-memcpy.c pager-return.c \ + offer-page.c + installhdrs = pager.h + + HURDLIBS= ports + LDLIBS += -lpthread +-OBJS = $(SRCS:.c=.o) memory_objectServer.o notifyServer.o ++OBJS = $(SRCS:.c=.o) memory_objectServer.o + + MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h + MIGCOMSFLAGS = -prefix _pager_ +diff --git a/libpager/demuxer.c b/libpager/demuxer.c +index 57a6ccb..4dd3cd8 100644 +--- a/libpager/demuxer.c ++++ b/libpager/demuxer.c +@@ -22,7 +22,7 @@ + + #include "priv.h" + #include "memory_object_S.h" +-#include "notify_S.h" ++#include "libports/notify_S.h" + #include "queue.h" + + /* +@@ -89,7 +89,7 @@ pager_demuxer (struct requests *requests, + + mig_routine_t routine; + if (! ((routine = _pager_memory_object_server_routine (inp)) || +- (routine = _pager_notify_server_routine (inp)))) ++ (routine = ports_notify_server_routine (inp)))) + return FALSE; + + #define MASK (8u - 1u) +diff --git a/libpager/mig-mutate.h b/libpager/mig-mutate.h +index c4f30ce..66d37cd 100644 +--- a/libpager/mig-mutate.h ++++ b/libpager/mig-mutate.h +@@ -21,12 +21,3 @@ + #define MEMORY_OBJECT_INTRAN_PAYLOAD pager_t begin_using_pager_payload + #define MEMORY_OBJECT_DESTRUCTOR end_using_pager (pager_t) + #define MEMORY_OBJECT_IMPORTS import "mig-decls.h"; +- +-#define NOTIFY_INTRAN \ +- port_info_t begin_using_port_info_port (mach_port_t) +-#define NOTIFY_INTRAN_PAYLOAD \ +- port_info_t begin_using_port_info_payload +-#define NOTIFY_DESTRUCTOR \ +- end_using_port_info (port_info_t) +-#define NOTIFY_IMPORTS \ +- import "libports/mig-decls.h"; +diff --git a/libpager/no-senders.c b/libpager/no-senders.c +deleted file mode 100644 +index b750101..0000000 +--- a/libpager/no-senders.c ++++ /dev/null +@@ -1,34 +0,0 @@ +-/* Called when a nosenders notification happens +- Copyright (C) 1994, 1995 Free Software Foundation +- +- 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 "priv.h" +-#include <mach/notify.h> +-#include "notify_S.h" +- +-error_t +-_pager_do_mach_notify_no_senders (struct port_info *pi, +- mach_port_mscount_t mscount) +-{ +- if (!pi || +- pi->class != _pager_class) +- return EOPNOTSUPP; +- +- ports_no_senders (pi, mscount); +- +- return 0; +-} +diff --git a/libpager/notify-stubs.c b/libpager/notify-stubs.c +deleted file mode 100644 +index 6440815..0000000 +--- a/libpager/notify-stubs.c ++++ /dev/null +@@ -1,61 +0,0 @@ +-/* +- Copyright (C) 1995, 2011 Free Software Foundation, Inc. +- Written by Michael I. Bushnell. +- +- This file is part of the GNU Hurd. +- +- The GNU Hurd is free software; you can redistribute it and/or +- modify it under the terms of the GNU General Public License as +- published by the Free Software Foundation; either version 2, or (at +- your option) any later version. +- +- The GNU Hurd is distributed in the hope that it will be useful, but +- WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- General Public License for more details. +- +- You should have received a copy of the GNU General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ +- +-#include "priv.h" +-#include "notify_S.h" +-#include <errno.h> +- +-error_t +-_pager_do_mach_notify_port_deleted (struct port_info *pi, +- mach_port_t name +- __attribute__ ((unused))) +-{ +- return 0; +-} +- +-error_t +-_pager_do_mach_notify_msg_accepted (struct port_info *pi, +- mach_port_t name +- __attribute__ ((unused))) +-{ +- return 0; +-} +- +-error_t +-_pager_do_mach_notify_port_destroyed (struct port_info *pi, +- mach_port_t name +- __attribute__ ((unused))) +-{ +- return 0; +-} +- +-error_t +-_pager_do_mach_notify_send_once (struct port_info *pi) +-{ +- return 0; +-} +- +-error_t +-_pager_do_mach_notify_dead_name (struct port_info *pi, +- mach_port_t name +- __attribute__ ((unused))) +-{ +- return 0; +-} +-- +2.1.3 + diff --git a/debian/patches/0003-ext2fs-tune-the-size-of-the-inode-cache.patch b/debian/patches/0003-ext2fs-tune-the-size-of-the-inode-cache.patch new file mode 100644 index 00000000..6603a4c9 --- /dev/null +++ b/debian/patches/0003-ext2fs-tune-the-size-of-the-inode-cache.patch @@ -0,0 +1,30 @@ +From 51c2bd7408b0a4ee73ecd1928d4c17d4fafb1ec2 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Mon, 8 Dec 2014 12:53:06 +0100 +Subject: [PATCH hurd 3/5] ext2fs: tune the size of the inode cache + +The node cache uses a fixed number of buckets giving it a linear +access complexity, although with a small constant factor. Paper over +this issue by increasing the number of buckets. + +* ext2fs/inode.c (INOHSZ): Increase from 512 to 8192 entries. +--- + ext2fs/inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ext2fs/inode.c b/ext2fs/inode.c +index ed78265..27530fb 100644 +--- a/ext2fs/inode.c ++++ b/ext2fs/inode.c +@@ -39,7 +39,7 @@ + #define UF_IMMUTABLE 0 + #endif + +-#define INOHSZ 512 ++#define INOHSZ 8192 + #if ((INOHSZ&(INOHSZ-1)) == 0) + #define INOHASH(ino) ((ino)&(INOHSZ-1)) + #else +-- +2.1.3 + diff --git a/debian/patches/0004-Replace-bzero-with-memset.patch b/debian/patches/0004-Replace-bzero-with-memset.patch new file mode 100644 index 00000000..ec9ed2a0 --- /dev/null +++ b/debian/patches/0004-Replace-bzero-with-memset.patch @@ -0,0 +1,910 @@ +From 0a4ada8d40fb687a659161ff7e0d1d0994264402 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Mon, 1 Dec 2014 23:55:25 +0100 +Subject: [PATCH hurd 4/5] Replace `bzero' with `memset' + +For reference, this patch was created using the following semantic +patch, and then manually applying the change in all functions +containing nested functions, as those are not supported by Coccinelle. + +@@ +expression A, B; +@@ + +- bzero (A, B) ++ memset (A, 0, B) + +* auth/auth.c: Replace `bzero' with `memset'. +* boot/boot.c: Likewise. +* defpager/defpager.c: Likewise. +* exec/exec.c: Likewise. Also, drop `safe_bzero' and just use +`hurd_safe_memset' directly. +* ext2fs/ext2fs.c: Likewise. +* ext2fs/getblk.c: Likewise. +* ext2fs/pager.c: Likewise. +* fatfs/pager.c: Likewise. +* ftpfs/dir.c: Likewise. +* ftpfs/netfs.c: Likewise. +* isofs/inode.c: Likewise. +* isofs/pager.c: Likewise. +* libdiskfs/file-getfh.c: Likewise. +* libdiskfs/file-statfs.c: Likewise. +* libfshelp/fetch-root.c: Likewise. +* libfshelp/start-translator.c: Likewise. +* libftpconn/create.c: Likewise. +* libftpconn/open.c: Likewise. +* libftpconn/unix.c: Likewise. +* libpipe/pipe.c: Likewise. +* libps/procstat.c: Likewise. +* libps/spec.c: Likewise. +* libshouldbeinlibc/cacheq.c: Likewise. +* libshouldbeinlibc/idvec.c: Likewise. +* libshouldbeinlibc/ugids.c: Likewise. +* libstore/argp.c: Likewise. +* libstore/enc.c: Likewise. +* libstore/kids.c: Likewise. +* libthreads/alpha/thread.c: Likewise. +* libtreefs/fsys.c: Likewise. +* libtrivfs/file-statfs.c: Likewise. +* mach-defpager/default_pager.c: Likewise. +* pfinet/glue-include/asm/uaccess.h: Likewise. +* pfinet/io-ops.c: Likewise. +* pfinet/options.c: Likewise. +* pfinet/socket.c: Likewise. +* pfinet/timer-emul.c: Likewise. +* pflocal/io.c: Likewise. +* startup/startup.c: Likewise. +* storeio/storeio.c: Likewise. +* sutils/fstab.c: Likewise. +* usermux/usermux.c: Likewise. +* utils/fakeauth.c: Likewise. +* utils/frobauth.c: Likewise. +* utils/login.c: Likewise. +* utils/x.c: Likewise. +--- + auth/auth.c | 2 +- + boot/boot.c | 4 ++-- + defpager/defpager.c | 3 +-- + exec/exec.c | 18 +++++++----------- + ext2fs/ext2fs.c | 2 +- + ext2fs/getblk.c | 2 +- + ext2fs/pager.c | 4 ++-- + fatfs/pager.c | 2 +- + ftpfs/dir.c | 4 ++-- + ftpfs/netfs.c | 2 +- + isofs/inode.c | 2 +- + isofs/pager.c | 2 +- + libdiskfs/file-getfh.c | 2 +- + libdiskfs/file-statfs.c | 2 +- + libfshelp/fetch-root.c | 6 +++--- + libfshelp/start-translator.c | 2 +- + libftpconn/create.c | 2 +- + libftpconn/open.c | 2 +- + libftpconn/unix.c | 4 ++-- + libpipe/pipe.c | 6 +++--- + libps/procstat.c | 4 ++-- + libps/spec.c | 2 +- + libshouldbeinlibc/cacheq.c | 2 +- + libshouldbeinlibc/idvec.c | 2 +- + libshouldbeinlibc/ugids.c | 2 +- + libstore/argp.c | 2 +- + libstore/enc.c | 4 ++-- + libstore/kids.c | 2 +- + libthreads/alpha/thread.c | 2 +- + libtreefs/fsys.c | 4 ++-- + libtrivfs/file-statfs.c | 2 +- + mach-defpager/default_pager.c | 8 ++++---- + pfinet/glue-include/asm/uaccess.h | 2 +- + pfinet/io-ops.c | 2 +- + pfinet/options.c | 4 ++-- + pfinet/socket.c | 2 +- + pfinet/timer-emul.c | 2 +- + pflocal/io.c | 4 ++-- + startup/startup.c | 4 ++-- + storeio/storeio.c | 4 ++-- + sutils/fstab.c | 4 ++-- + usermux/usermux.c | 5 +++-- + utils/fakeauth.c | 2 +- + utils/frobauth.c | 2 +- + utils/login.c | 4 ++-- + utils/x.c | 4 ++-- + 46 files changed, 75 insertions(+), 79 deletions(-) + +diff --git a/auth/auth.c b/auth/auth.c +index 7d35bd3..c36bcb2 100644 +--- a/auth/auth.c ++++ b/auth/auth.c +@@ -59,7 +59,7 @@ create_authhandle (struct authhandle **new) + error_t err = ports_create_port (authhandle_portclass, auth_bucket, + sizeof **new, new); + if (! err) +- bzero (&(*new)->euids, (void *) &(*new)[1] - (void *) &(*new)->euids); ++ memset (&(*new)->euids, 0, (void *)&(*new)[1] - (void *)&(*new)->euids); + return err; + } + +diff --git a/boot/boot.c b/boot/boot.c +index e2cb907..4bdeb52 100644 +--- a/boot/boot.c ++++ b/boot/boot.c +@@ -359,7 +359,7 @@ boot_script_exec_cmd (void *hook, + *(char **) p = 0; + p = (void *) p + sizeof (char *); + memcpy (p, strings, stringlen); +- bzero (args, (vm_offset_t) arg_pos & (vm_page_size - 1)); ++ memset (args, 0, (vm_offset_t)arg_pos & (vm_page_size - 1)); + vm_write (task, trunc_page ((vm_offset_t) arg_pos), (vm_address_t) args, + stack_end - trunc_page ((vm_offset_t) arg_pos)); + munmap ((caddr_t) args, +@@ -1579,7 +1579,7 @@ S_io_stat (mach_port_t object, + if (object != pseudo_console) + return EOPNOTSUPP; + +- bzero (st, sizeof (struct stat)); ++ memset (st, 0, sizeof(struct stat)); + st->st_blksize = 1024; + return 0; + } +diff --git a/defpager/defpager.c b/defpager/defpager.c +index 3a824cf..f97b489 100644 +--- a/defpager/defpager.c ++++ b/defpager/defpager.c +@@ -45,8 +45,7 @@ expand_map (struct user_pager_info *p, vm_offset_t addr) + newsize = page + vm_page_size; + newmap = realloc (pager->map, size / vm_page_size * sizeof (off_t)); + +- bzero (pager->map + pager->size / vm_page_size * sizeof (off_t), +- (newsize - pager->size) / vm_page_size * sizeof (off_t)); ++ memset (pager->map + pager->size / vm_page_size * sizeof(off_t), 0, (newsize - pager->size) / vm_page_size * sizeof(off_t)); + pager->size = newsize; + pager->map = newmap; + } +diff --git a/exec/exec.c b/exec/exec.c +index 0ecf2d3..bbe0244 100644 +--- a/exec/exec.c ++++ b/exec/exec.c +@@ -47,13 +47,6 @@ pthread_rwlock_t std_lock = PTHREAD_RWLOCK_INITIALIZER; + + #include <hurd/sigpreempt.h> + +-static error_t +-safe_bzero (void *ptr, size_t size) +-{ +- return hurd_safe_memset (ptr, 0, size); +-} +- +- + /* Load or allocate a section. */ + static void + load_section (void *section, struct execdata *u) +@@ -328,7 +321,9 @@ load_section (void *section, struct execdata *u) + vm_deallocate (u->task, mapstart, memsz); + return; + } +- u->error = safe_bzero ((void *) (ourpage + (addr - overlap_page)), ++ u->error = hurd_safe_memset ( ++ (void *) (ourpage + (addr - overlap_page)), ++ 0, + size - (addr - overlap_page)); + if (! u->error && !(vm_prot & VM_PROT_WRITE)) + u->error = vm_protect (u->task, overlap_page, size, +@@ -887,7 +882,7 @@ do_exec (file_t file, + pthread_rwlock_unlock (&std_lock); + goto out; + } +- bzero (&boot->pi + 1, (char *) &boot[1] - (char *) (&boot->pi + 1)); ++ memset (&boot->pi + 1, 0, (char *) &boot[1] - (char *) (&boot->pi + 1)); + + /* These flags say the information we pass through to the new program + may need to be modified. */ +@@ -960,7 +955,7 @@ do_exec (file_t file, + /* Keep track of which ports in BOOT->portarray come from the original + PORTARRAY, and which we replace. */ + ports_replaced = alloca (boot->nports * sizeof *ports_replaced); +- bzero (ports_replaced, boot->nports * sizeof *ports_replaced); ++ memset (ports_replaced, 0, boot->nports * sizeof *ports_replaced); + + if (portarray[INIT_PORT_BOOTSTRAP] == MACH_PORT_NULL && + oldtask != MACH_PORT_NULL) +@@ -1326,7 +1321,8 @@ do_exec (file_t file, + /* Kill the pointers to the argument information so the cleanup + of BOOT doesn't deallocate it. It will be deallocated my MiG + when we return the error. */ +- bzero (&boot->pi + 1, (char *) &boot[1] - (char *) (&boot->pi + 1)); ++ memset (&boot->pi + 1, 0, ++ (char *) &boot[1] - (char *) (&boot->pi + 1)); + else + /* Do this before we release the last reference. */ + if (boot->nports > INIT_PORT_PROC) +diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c +index 128b6ed..beb7cad 100644 +--- a/ext2fs/ext2fs.c ++++ b/ext2fs/ext2fs.c +@@ -106,7 +106,7 @@ parse_opt (int key, char *arg, struct argp_state *state) + if (values == 0) + return ENOMEM; + state->hook = values; +- bzero (values, sizeof *values); ++ memset (values, 0, sizeof *values); + values->sb_block = SBLOCK_BLOCK; + break; + +diff --git a/ext2fs/getblk.c b/ext2fs/getblk.c +index bde66e1..d7ddb6a 100644 +--- a/ext2fs/getblk.c ++++ b/ext2fs/getblk.c +@@ -105,7 +105,7 @@ ext2_alloc_block (struct node *node, block_t goal, int zero) + if (result && zero) + { + char *bh = disk_cache_block_ref (result); +- bzero (bh, block_size); ++ memset (bh, 0, block_size); + record_indir_poke (node, bh); + } + +diff --git a/ext2fs/pager.c b/ext2fs/pager.c +index 298dae7..ae51530 100644 +--- a/ext2fs/pager.c ++++ b/ext2fs/pager.c +@@ -265,7 +265,7 @@ file_pager_read_page (struct node *node, vm_offset_t page, + break; + STAT_INC (file_pagein_alloced_bufs); + } +- bzero (*buf + offs, block_size); ++ memset (*buf + offs, 0, block_size); + offs += block_size; + } + else +@@ -446,7 +446,7 @@ disk_pager_read_page (vm_offset_t page, void **buf, int *writelock) + if (read != length) + return EIO; + if (!err && length != vm_page_size) +- bzero ((void *)(*buf + length), vm_page_size - length); ++ memset ((void *)(*buf + length), 0, vm_page_size - length); + + *writelock = 0; + +diff --git a/fatfs/pager.c b/fatfs/pager.c +index 0c59084..10d1fc9 100644 +--- a/fatfs/pager.c ++++ b/fatfs/pager.c +@@ -152,7 +152,7 @@ root_dir_pager_read_page (vm_offset_t page, void **buf, int *writelock) + pthread_rwlock_unlock (&diskfs_root_node->dn->alloc_lock); + + if (overrun) +- bzero ((void *) *buf + vm_page_size - overrun, overrun); ++ memset ((void *)*buf + vm_page_size - overrun, 0, overrun); + + return err; + } +diff --git a/ftpfs/dir.c b/ftpfs/dir.c +index a9fea22..be20b3d 100644 +--- a/ftpfs/dir.c ++++ b/ftpfs/dir.c +@@ -64,7 +64,7 @@ rehash (struct ftpfs_dir *dir, size_t new_len) + if (! new_htable) + return ENOMEM; + +- bzero (new_htable, new_len * sizeof (struct ftpfs_dir_entry *)); ++ memset (new_htable, 0, new_len * sizeof(struct ftpfs_dir_entry *)); + + for (i = 0; i < old_len; i++) + while (old_htable[i]) +@@ -124,7 +124,7 @@ lookup (struct ftpfs_dir *dir, const char *name, int add) + e->node = 0; + e->dir = dir; + e->stat_timestamp = 0; +- bzero (&e->stat, sizeof e->stat); ++ memset (&e->stat, 0, sizeof e->stat); + e->symlink_target = 0; + e->noent = 0; + e->valid = 0; +diff --git a/ftpfs/netfs.c b/ftpfs/netfs.c +index 5359acb..cf5d907 100644 +--- a/ftpfs/netfs.c ++++ b/ftpfs/netfs.c +@@ -385,7 +385,7 @@ error_t + netfs_attempt_statfs (struct iouser *cred, struct node *node, + struct statfs *st) + { +- bzero (st, sizeof *st); ++ memset (st, 0, sizeof *st); + st->f_type = FSTYPE_FTP; + st->f_fsid = getpid (); + return 0; +diff --git a/isofs/inode.c b/isofs/inode.c +index cdc05ae..247d8ac 100644 +--- a/isofs/inode.c ++++ b/isofs/inode.c +@@ -599,7 +599,7 @@ diskfs_set_statfs (struct statfs *st) + { + /* There is no easy way to determine the number of files on an + ISO 9660 filesystem. */ +- bzero (st, sizeof *st); ++ memset (st, 0, sizeof *st); + st->f_type = FSTYPE_ISO9660; + st->f_bsize = logical_block_size; + st->f_blocks = isonum_733 (sblock->vol_sp_size); +diff --git a/isofs/pager.c b/isofs/pager.c +index d72a514..35de37e 100644 +--- a/isofs/pager.c ++++ b/isofs/pager.c +@@ -75,7 +75,7 @@ pager_read_page (struct user_pager_info *upi, + return EIO; + + if (overrun) +- bzero ((void *) *buf + vm_page_size - overrun, overrun); ++ memset ((void *)*buf + vm_page_size - overrun, 0, overrun); + + return 0; + } +diff --git a/libdiskfs/file-getfh.c b/libdiskfs/file-getfh.c +index 035705b..e4bc892 100644 +--- a/libdiskfs/file-getfh.c ++++ b/libdiskfs/file-getfh.c +@@ -50,7 +50,7 @@ diskfs_S_file_getfh (struct protid *cred, char **fh, size_t *fh_len) + + f = (union diskfs_fhandle *) *fh; + +- bzero (f, sizeof *f); ++ memset (f, 0, sizeof *f); + f->data.cache_id = node->cache_id; + f->data.gen = node->dn_stat.st_gen; + +diff --git a/libdiskfs/file-statfs.c b/libdiskfs/file-statfs.c +index 9d97ce6..c9fd6f1 100644 +--- a/libdiskfs/file-statfs.c ++++ b/libdiskfs/file-statfs.c +@@ -31,7 +31,7 @@ diskfs_S_file_statfs (struct protid *file, + + /* Start will all zeros, so the fs can skip fields for which + it has no information to contribute. */ +- bzero (statbuf, sizeof *statbuf); ++ memset (statbuf, 0, sizeof *statbuf); + + if (diskfs_readonly) + statbuf->f_flag |= ST_RDONLY; +diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c +index 45c7dd0..712c11f 100644 +--- a/libfshelp/fetch-root.c ++++ b/libfshelp/fetch-root.c +@@ -121,9 +121,9 @@ fshelp_fetch_root (struct transbox *box, void *cookie, + goto return_error; + } + +- bzero (ports, INIT_PORT_MAX * sizeof (mach_port_t)); +- bzero (fds, (STDERR_FILENO + 1) * sizeof (mach_port_t)); +- bzero (ints, INIT_INT_MAX * sizeof (int)); ++ memset (ports, 0, INIT_PORT_MAX * sizeof (mach_port_t)); ++ memset (fds, 0, (STDERR_FILENO + 1) * sizeof (mach_port_t)); ++ memset (ints, 0, INIT_INT_MAX * sizeof (int)); + + ports[INIT_PORT_CWDIR] = dotdot; + ports[INIT_PORT_CRDIR] = reauth (getcrdir ()); +diff --git a/libfshelp/start-translator.c b/libfshelp/start-translator.c +index ba5418e..7f0ae70 100644 +--- a/libfshelp/start-translator.c ++++ b/libfshelp/start-translator.c +@@ -38,7 +38,7 @@ fshelp_start_translator (fshelp_open_fn_t underlying_open_fn, + ports[i] = MACH_PORT_NULL; + for (i = 0; i < STDERR_FILENO + 1; i++) + fds[i] = MACH_PORT_NULL; +- bzero (ints, INIT_INT_MAX * sizeof (int)); ++ memset (ints, 0, INIT_INT_MAX * sizeof(int)); + + ports[INIT_PORT_CWDIR] = getcwdir (); + ports[INIT_PORT_CRDIR] = getcrdir (); +diff --git a/libftpconn/create.c b/libftpconn/create.c +index 20a6456..0ffdb49 100644 +--- a/libftpconn/create.c ++++ b/libftpconn/create.c +@@ -54,7 +54,7 @@ ftp_conn_create (const struct ftp_conn_params *params, + new->actv_data_addr = 0; + new->cwd = 0; + new->type = 0; +- bzero (&new->syshooks, sizeof new->syshooks); ++ memset (&new->syshooks, 0, sizeof new->syshooks); + + if (new->hooks && new->hooks->init) + err = (*new->hooks->init) (new); +diff --git a/libftpconn/open.c b/libftpconn/open.c +index f52bf4d..f1a1b85 100644 +--- a/libftpconn/open.c ++++ b/libftpconn/open.c +@@ -189,7 +189,7 @@ ftp_conn_open (struct ftp_conn *conn) + close (conn->control); + conn->control = -1; + } +- bzero (&conn->syshooks, sizeof conn->syshooks); ++ memset (&conn->syshooks, 0, sizeof conn->syshooks); + + csock = socket (PF_INET, SOCK_STREAM, 0); + if (csock < 0) +diff --git a/libftpconn/unix.c b/libftpconn/unix.c +index 28efefd..882fee8 100644 +--- a/libftpconn/unix.c ++++ b/libftpconn/unix.c +@@ -305,7 +305,7 @@ drwxrwxrwt 7 34 archive 512 May 1 14:28 /tmp + if (strncasecmp (p, "total ", 6) == 0) + return EAGAIN; + +- bzero (stat, sizeof *stat); ++ memset (stat, 0, sizeof *stat); + + #ifdef FSTYPE_FTP + stat->st_fstype = FSTYPE_FTP; +@@ -471,7 +471,7 @@ drwxrwxrwt 7 34 archive 512 May 1 14:28 /tmp + /* Date. Ick. */ + /* Formats: MONTH DAY HH:MM and MONTH DAY YEAR */ + +- bzero (&tm, sizeof tm); ++ memset (&tm, 0, sizeof tm); + + SKIP_WS (); + e = p + strcspn (p, " \t\n"); +diff --git a/libpipe/pipe.c b/libpipe/pipe.c +index b7ee851..9580eb7 100644 +--- a/libpipe/pipe.c ++++ b/libpipe/pipe.c +@@ -18,7 +18,7 @@ + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +-#include <string.h> /* For bzero() */ ++#include <string.h> /* For memset() */ + #include <assert.h> + #include <stdlib.h> + +@@ -58,8 +58,8 @@ pipe_create (struct pipe_class *class, struct pipe **pipe) + new->write_limit = 16*1024; + new->write_atomic = 16*1024; + +- bzero (&new->read_time, sizeof (new->read_time)); +- bzero (&new->write_time, sizeof (new->write_time)); ++ memset (&new->read_time, 0, sizeof(new->read_time)); ++ memset (&new->write_time, 0, sizeof(new->write_time)); + + pthread_cond_init (&new->pending_reads, NULL); + pthread_cond_init (&new->pending_read_selects, NULL); +diff --git a/libps/procstat.c b/libps/procstat.c +index 0d4a565..9f488cd 100644 +--- a/libps/procstat.c ++++ b/libps/procstat.c +@@ -361,7 +361,7 @@ summarize_thread_basic_info (struct procinfo *pi, ps_flags_t have) + if (!tbi) + return 0; + +- bzero (tbi, sizeof *tbi); ++ memset (tbi, 0, sizeof *tbi); + + for (i = 0; i < pi->nthreads; i++) + if (! pi->threadinfos[i].died +@@ -458,7 +458,7 @@ summarize_thread_sched_info (struct procinfo *pi) + if (!tsi) + return 0; + +- bzero (tsi, sizeof *tsi); ++ memset (tsi, 0, sizeof *tsi); + + for (i = 0; i < pi->nthreads; i++) + if (! pi->threadinfos[i].died +diff --git a/libps/spec.c b/libps/spec.c +index d645b82..d8188d6 100644 +--- a/libps/spec.c ++++ b/libps/spec.c +@@ -1036,7 +1036,7 @@ specs_add_alias (struct ps_fmt_specs *specs, + exp->nominal_fn = alias->nominal_fn ?: src->nominal_fn; + + /* Now add the list-end marker. */ +- bzero (exp + 1, sizeof (*exp)); ++ memset (exp + 1, 0, sizeof(*exp)); + + return exp; + } +diff --git a/libshouldbeinlibc/cacheq.c b/libshouldbeinlibc/cacheq.c +index c1be59c..5912f84 100644 +--- a/libshouldbeinlibc/cacheq.c ++++ b/libshouldbeinlibc/cacheq.c +@@ -97,7 +97,7 @@ cacheq_set_length (struct cacheq *cq, int length) + if (fh && th) + bcopy (fh, th, esz); /* Copy the bits in a moved entry. */ + else if (th) +- bzero (th, esz); /* Zero the bits in a new entry. */ ++ memset (th, 0, esz); /* Zero the bits in a new entry. */ + + if (th) + /* Fixup headers. */ +diff --git a/libshouldbeinlibc/idvec.c b/libshouldbeinlibc/idvec.c +index 7fdee10..c60fc9f 100644 +--- a/libshouldbeinlibc/idvec.c ++++ b/libshouldbeinlibc/idvec.c +@@ -115,7 +115,7 @@ idvec_insert (struct idvec *idvec, unsigned pos, uid_t id) + if (pos < num) + bcopy (ids + pos, ids + pos + 1, (num - pos) * sizeof (uid_t)); + else if (pos > num) +- bzero (ids + num, (pos - num) * sizeof (uid_t)); ++ memset (ids + num, 0, (pos - num) * sizeof(uid_t)); + ids[pos] = id; + idvec->num = new_num; + } +diff --git a/libshouldbeinlibc/ugids.c b/libshouldbeinlibc/ugids.c +index db1ce3c..07a11fe 100644 +--- a/libshouldbeinlibc/ugids.c ++++ b/libshouldbeinlibc/ugids.c +@@ -30,7 +30,7 @@ make_ugids () + { + struct ugids *u = malloc (sizeof (struct ugids)); + if (u) +- bzero (u, sizeof *u); ++ memset (u, 0, sizeof *u); + return u; + } + +diff --git a/libstore/argp.c b/libstore/argp.c +index 6ed7996..73146a8 100644 +--- a/libstore/argp.c ++++ b/libstore/argp.c +@@ -350,7 +350,7 @@ parse_opt (int opt, char *arg, struct argp_state *state) + parsed = state->hook = malloc (sizeof (struct store_parsed)); + if (! parsed) + return ENOMEM; +- bzero (parsed, sizeof (struct store_parsed)); ++ memset (parsed, 0, sizeof(struct store_parsed)); + parsed->classes = params->classes; + parsed->default_type = + find_class (params->default_type ?: DEFAULT_STORE_CLASS.name, +diff --git a/libstore/enc.c b/libstore/enc.c +index d5002a0..5838c17 100644 +--- a/libstore/enc.c ++++ b/libstore/enc.c +@@ -33,7 +33,7 @@ store_enc_init (struct store_enc *enc, + off_t *offsets, mach_msg_type_number_t num_offsets, + char *data, mach_msg_type_number_t data_len) + { +- bzero (enc, sizeof (*enc)); ++ memset (enc, 0, sizeof(*enc)); + + enc->ports = enc->init_ports = ports; + enc->num_ports = num_ports; +@@ -75,7 +75,7 @@ store_enc_dealloc (struct store_enc *enc) + munmap (enc->data, enc->data_len); + + /* For good measure... */ +- bzero (enc, sizeof (*enc)); ++ memset (enc, 0, sizeof(*enc)); + } + + /* Copy out the parameters from ENC into the given variables suitably for +diff --git a/libstore/kids.c b/libstore/kids.c +index 901a7f8..5ad9454 100644 +--- a/libstore/kids.c ++++ b/libstore/kids.c +@@ -206,7 +206,7 @@ store_open_children (const char *name, int flags, + if (! *stores) + return ENOMEM; + +- bzero (*stores, count * sizeof (struct store *)); ++ memset (*stores, 0, count * sizeof(struct store *)); + + /* Open each child store. */ + for (p = name, k = 0; !err && p && p[1]; p = end, k++) +diff --git a/libthreads/alpha/thread.c b/libthreads/alpha/thread.c +index db2cb0c..350fd5f 100644 +--- a/libthreads/alpha/thread.c ++++ b/libthreads/alpha/thread.c +@@ -82,7 +82,7 @@ cproc_setup( + * Set up ALPHA call frame and registers. + */ + ts = &state; +- bzero((char *) ts, sizeof(struct alpha_thread_state)); ++ memset ((char *)ts, 0, sizeof(struct alpha_thread_state)); + + top = (integer_t *) (child->stack_base + child->stack_size); + +diff --git a/libtreefs/fsys.c b/libtreefs/fsys.c +index d6565bb..fe1b917 100644 +--- a/libtreefs/fsys.c ++++ b/libtreefs/fsys.c +@@ -81,7 +81,7 @@ treefs_create_fsys (struct port_bucket *port_bucket, + (*fsys)->root = NULL; + + (*fsys)->underlying_port = MACH_PORT_NULL; +- bzero (&(*fsys)->underlying_stat, sizeof (struct stat)); ++ memset (&(*fsys)->underlying_stat, 0, sizeof(struct stat)); + + (*fsys)->flags = treefs_default_flags; + (*fsys)->max_symlinks = treefs_default_max_symlinks; +@@ -109,7 +109,7 @@ void ACKACKACK() + goto barf; + + /* Remember stat info for the node we're mounted on. */ +- bzero (&(*fsys)->underlying_stat, sizeof (struct stat)); ++ memset (&(*fsys)->underlying_stat, 0, sizeof (struct stat)); + file_stat (realnode, &(*fsys)->underlying_stat); + + /* Note that it points to *FSYS, but *FSYS's root doesn't point to it... +diff --git a/libtrivfs/file-statfs.c b/libtrivfs/file-statfs.c +index 348126e..267ac50 100644 +--- a/libtrivfs/file-statfs.c ++++ b/libtrivfs/file-statfs.c +@@ -28,7 +28,7 @@ trivfs_S_file_statfs (struct trivfs_protid *cred, + if (!trivfs_fsid) + trivfs_fsid = getpid(); + +- bzero (stb, sizeof (struct statfs)); ++ memset (stb, 0, sizeof(struct statfs)); + stb->f_type = trivfs_fstype; + stb->f_fsid = trivfs_fsid; + +diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c +index 831ed96..9e4b0e7 100644 +--- a/mach-defpager/default_pager.c ++++ b/mach-defpager/default_pager.c +@@ -192,7 +192,7 @@ new_partition (const char *name, struct file_direct *fdp, + part->going_away= FALSE; + part->file = fdp; + +- bzero((char *)part->bitmap, bmsize); ++ memset ((char *)part->bitmap, 0, bmsize); + + if (check_linux_signature < 0) + { +@@ -428,7 +428,7 @@ create_paging_partition(const char *name, + new_list = (partition_t *) + kalloc( n * sizeof(partition_t) ); + if (new_list == 0) no_paging_space(TRUE); +- bzero(new_list, n*sizeof(partition_t)); ++ memset (new_list, 0, n * sizeof(partition_t)); + if (i) { + old_list = all_partitions.partition_list; + bcopy(old_list, new_list, i*sizeof(partition_t)); +@@ -1640,7 +1640,7 @@ default_read(ds, addr, size, offset, out_addr, deallocate, external) + * An external object is requesting unswapped data, + * zero fill the page and return. + */ +- bzero((char *) addr, vm_page_size); ++ memset ((char *)addr, 0, vm_page_size); + *out_addr = addr; + return (PAGER_SUCCESS); + } +@@ -2118,7 +2118,7 @@ default_pager_t pager_port_alloc(size) + ds = (default_pager_t) kalloc(sizeof *ds); + if (ds == DEFAULT_PAGER_NULL) + panic("%spager_port_alloc",my_name); +- bzero((char *) ds, sizeof *ds); ++ memset ((char *)ds, 0, sizeof *ds); + + dstruct_lock_init(ds); + +diff --git a/pfinet/glue-include/asm/uaccess.h b/pfinet/glue-include/asm/uaccess.h +index 6f6dc41..752c61c 100644 +--- a/pfinet/glue-include/asm/uaccess.h ++++ b/pfinet/glue-include/asm/uaccess.h +@@ -43,7 +43,7 @@ struct __large_struct { unsigned long buf[100]; }; + + #define copy_to_user(to,from,n) (memcpy ((to), (from), (n)), 0) + #define copy_from_user(to,from,n) (memcpy ((to), (from), (n)), 0) +-#define clear_user(mem, len) (bzero ((mem), (len)), 0) ++#define clear_user(mem, len) (memset ((mem), 0, (len)), 0) + + #define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; }) + +diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c +index 96dbec8..cc666cd 100644 +--- a/pfinet/io-ops.c ++++ b/pfinet/io-ops.c +@@ -339,7 +339,7 @@ S_io_stat (struct sock_user *user, + if (!user) + return EOPNOTSUPP; + +- bzero (st, sizeof (struct stat)); ++ memset (st, 0, sizeof(struct stat)); + + st->st_fstype = FSTYPE_SOCKET; + st->st_fsid = getpid (); +diff --git a/pfinet/options.c b/pfinet/options.c +index e9b81a9..4b14356 100644 +--- a/pfinet/options.c ++++ b/pfinet/options.c +@@ -418,8 +418,8 @@ parse_opt (int opt, char *arg, struct argp_state *state) + req.nlh.nlmsg_seq = 0; + req.nlh.nlmsg_len = NLMSG_LENGTH (sizeof req.rtm); + +- bzero (&req.rtm, sizeof req.rtm); +- bzero (&rta, sizeof rta); ++ memset (&req.rtm, 0, sizeof req.rtm); ++ memset (&rta, 0, sizeof rta); + req.rtm.rtm_scope = RT_SCOPE_UNIVERSE; + req.rtm.rtm_type = RTN_UNICAST; + req.rtm.rtm_protocol = RTPROT_STATIC; +diff --git a/pfinet/socket.c b/pfinet/socket.c +index 23a2dd9..06ce2c7 100644 +--- a/pfinet/socket.c ++++ b/pfinet/socket.c +@@ -50,7 +50,7 @@ sock_alloc (void) + return 0; + c = (void *) &sock[1]; + pthread_cond_init (c, NULL); +- bzero (sock, sizeof *sock); ++ memset (sock, 0, sizeof *sock); + sock->state = SS_UNCONNECTED; + sock->identity = MACH_PORT_NULL; + sock->refcnt = 1; +diff --git a/pfinet/timer-emul.c b/pfinet/timer-emul.c +index f6760d7..2053f80 100644 +--- a/pfinet/timer-emul.c ++++ b/pfinet/timer-emul.c +@@ -152,7 +152,7 @@ mod_timer (struct timer_list *timer, unsigned long expires) + void + init_timer (struct timer_list *timer) + { +- bzero (timer, sizeof (struct timer_list)); ++ memset (timer, 0, sizeof(struct timer_list)); + } + + void +diff --git a/pflocal/io.c b/pflocal/io.c +index 00e859a..ee6fb84 100644 +--- a/pflocal/io.c ++++ b/pflocal/io.c +@@ -19,7 +19,7 @@ + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +-#include <string.h> /* For bzero() */ ++#include <string.h> /* For memset() */ + #include <unistd.h> + #include <sys/types.h> + #include <sys/fcntl.h> +@@ -319,7 +319,7 @@ S_io_stat (struct sock_user *user, struct stat *st) + + sock = user->sock; + +- bzero (st, sizeof (struct stat)); ++ memset (st, 0, sizeof (struct stat)); + + st->st_fstype = FSTYPE_SOCKET; + st->st_mode = sock->mode; +diff --git a/startup/startup.c b/startup/startup.c +index e177075..601c894 100644 +--- a/startup/startup.c ++++ b/startup/startup.c +@@ -742,8 +742,8 @@ init_stdarrays () + std_port_array = alloca (sizeof (mach_port_t) * INIT_PORT_MAX); + std_int_array = alloca (sizeof (int) * INIT_INT_MAX); + +- bzero (std_port_array, sizeof (mach_port_t) * INIT_PORT_MAX); +- bzero (std_int_array, sizeof (int) * INIT_INT_MAX); ++ memset (std_port_array, 0, sizeof(mach_port_t) * INIT_PORT_MAX); ++ memset (std_int_array, 0, sizeof(int) * INIT_INT_MAX); + + __USEPORT (AUTH, auth_makeauth (port, 0, MACH_MSG_TYPE_COPY_SEND, 0, + 0, 0, 0, 0, 0, 0, 0, 0, &nullauth)); +diff --git a/storeio/storeio.c b/storeio/storeio.c +index eb38349..fcf2f30 100644 +--- a/storeio/storeio.c ++++ b/storeio/storeio.c +@@ -99,7 +99,7 @@ parse_opt (int key, char *arg, struct argp_state *state) + case ARGP_KEY_INIT: + /* Now store_argp's parser will get to initialize its state. + The default_type member is our input parameter to it. */ +- bzero (¶ms->store_params, sizeof params->store_params); ++ memset (¶ms->store_params, 0, sizeof params->store_params); + params->store_params.default_type = "device"; + params->store_params.store_optional = 1; + state->child_inputs[0] = ¶ms->store_params; +@@ -128,7 +128,7 @@ main (int argc, char *argv[]) + struct dev device; + struct storeio_argp_params params; + +- bzero (&device, sizeof device); ++ memset (&device, 0, sizeof device); + pthread_mutex_init (&device.lock, NULL); + + params.dev = &device; +diff --git a/sutils/fstab.c b/sutils/fstab.c +index e13f15b..24a1a0d 100644 +--- a/sutils/fstab.c ++++ b/sutils/fstab.c +@@ -600,7 +600,7 @@ fstab_add_mntent (struct fstab *const fstab, const struct mntent *mntent, + fs = malloc (sizeof (struct fs)); + if (fs) + { +- bzero (fs, sizeof (struct fs)); ++ memset (fs, 0, sizeof(struct fs)); + fs->mounted = fs->readonly = -1; + fs->fsys = MACH_PORT_NULL; + new = 1; +@@ -783,7 +783,7 @@ parse_opt (int key, char *arg, struct argp_state *state) + /* Initialize our parsing state. */ + if (! params) + return EINVAL; /* Need at least a way to return a result. */ +- bzero (params, sizeof *params); ++ memset (params, 0, sizeof *params); + break; + + case 'A': +diff --git a/usermux/usermux.c b/usermux/usermux.c +index fad923c..e89177b 100644 +--- a/usermux/usermux.c ++++ b/usermux/usermux.c +@@ -84,10 +84,11 @@ main (int argc, char **argv) + case OPT_USER_PAT: mux.user_pat = arg; break; + case OPT_HOME_PAT: mux.home_pat = arg; break; + case OPT_UID_PAT: mux.uid_pat = arg; break; +- case 'C': bzero (&mux, sizeof mux); break; ++ case 'C': memset (&mux, 0, sizeof mux); break; + + case ARGP_KEY_NO_ARGS: +- bzero (&mux, sizeof mux); /* Default doesn't use them; be careful. */ ++ memset (&mux, 0, sizeof mux); /* Default doesn't use them; ++ be careful. */ + return argz_create_sep (_HURD_SYMLINK, 0, + &mux.trans_template, &mux.trans_template_len); + case ARGP_KEY_ARGS: +diff --git a/utils/fakeauth.c b/utils/fakeauth.c +index 590a421..ba6a3ee 100644 +--- a/utils/fakeauth.c ++++ b/utils/fakeauth.c +@@ -50,7 +50,7 @@ create_authhandle (struct authhandle **new) + error_t err = ports_create_port (authhandle_portclass, auth_bucket, + sizeof **new, new); + if (! err) +- bzero (&(*new)->euids, (void *) &(*new)[1] - (void *) &(*new)->euids); ++ memset (&(*new)->euids, 0, (void *)&(*new)[1] - (void *)&(*new)->euids); + return err; + } + +diff --git a/utils/frobauth.c b/utils/frobauth.c +index 44690d8..5de7720 100644 +--- a/utils/frobauth.c ++++ b/utils/frobauth.c +@@ -123,7 +123,7 @@ common_parse_opt (int key, char *arg, struct argp_state *state) + break; + + case ARGP_KEY_INIT: +- bzero (fs, sizeof *fs); ++ memset (fs, 0, sizeof *fs); + fs->frobauth = frobauth; + fs->pids_argp_params.pids = &frobauth->pids; + fs->pids_argp_params.num_pids = &frobauth->num_pids; +diff --git a/utils/login.c b/utils/login.c +index a3e0563..9ee296a 100644 +--- a/utils/login.c ++++ b/utils/login.c +@@ -158,7 +158,7 @@ add_utmp_entry (char *args, unsigned args_len, int inherit_host) + char const *host = 0; + long addr = 0; + +- bzero (&utmp, sizeof (utmp)); ++ memset (&utmp, 0, sizeof(utmp)); + + gettimeofday (&utmp.ut_tv, 0); + strncpy (utmp.ut_name, envz_get (args, args_len, "USER") ?: "", +@@ -683,7 +683,7 @@ main(int argc, char *argv[]) + proc_setowner (proc_server, 0, 1); /* Clear the owner. */ + + /* Now start constructing the exec arguments. */ +- bzero (ints, sizeof (*ints) * INIT_INT_MAX); ++ memset (ints, 0, sizeof (*ints) * INIT_INT_MAX); + arg = envz_get (args, args_len, "UMASK"); + ints[INIT_UMASK] = arg && *arg ? strtoul (arg, 0, 8) : umask (0); + +diff --git a/utils/x.c b/utils/x.c +index 7bbc8ac..518f384 100644 +--- a/utils/x.c ++++ b/utils/x.c +@@ -228,8 +228,8 @@ main(int argc, char *argv[]) + } + struct argp argp = {options, parse_opt, args_doc, doc}; + +- bzero (add, sizeof add); +- bzero (remove, sizeof remove); ++ memset (add, 0, sizeof add); ++ memset (remove, 0, sizeof remove); + + + err = +-- +2.1.3 + diff --git a/debian/patches/0005-xxx-replace-bcopy-with-memcpy-or-memmove-as-appropri.patch b/debian/patches/0005-xxx-replace-bcopy-with-memcpy-or-memmove-as-appropri.patch new file mode 100644 index 00000000..d0e4ed24 --- /dev/null +++ b/debian/patches/0005-xxx-replace-bcopy-with-memcpy-or-memmove-as-appropri.patch @@ -0,0 +1,135 @@ +From c324259a062e1082c1daa02d3e910e02d6df9044 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Tue, 2 Dec 2014 00:20:51 +0100 +Subject: [PATCH hurd 5/5] xxx replace bcopy with memcpy or memmove as + appropriate + +* ext2fs/inode.c +* ext2fs/pager.c +* libpager/pagemap.c +* mach-defpager/default_pager.c +* pfinet/ethernet.c +* pfinet/tunnel.c +--- + ext2fs/inode.c | 2 +- + ext2fs/pager.c | 4 ++-- + libpager/pagemap.c | 2 +- + mach-defpager/default_pager.c | 4 ++-- + pfinet/ethernet.c | 10 +++++----- + pfinet/tunnel.c | 2 +- + 6 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/ext2fs/inode.c b/ext2fs/inode.c +index 27530fb..c001a4e 100644 +--- a/ext2fs/inode.c ++++ b/ext2fs/inode.c +@@ -733,7 +733,7 @@ diskfs_set_translator (struct node *np, const char *name, unsigned namelen, + + buf[0] = namelen & 0xFF; + buf[1] = (namelen >> 8) & 0xFF; +- bcopy (name, buf + 2, namelen); ++ memcpy (buf + 2, name, namelen); + + blkptr = disk_cache_block_ref (blkno); + memcpy (blkptr, buf, block_size); +diff --git a/ext2fs/pager.c b/ext2fs/pager.c +index ae51530..a6c4fbb 100644 +--- a/ext2fs/pager.c ++++ b/ext2fs/pager.c +@@ -209,7 +209,7 @@ file_pager_read_page (struct node *node, vm_offset_t page, + else + /* We've already got some buffer, so copy into it. */ + { +- bcopy (new_buf, *buf + offs, new_len); ++ memcpy (*buf + offs, new_buf, new_len); + free_page_buf (new_buf); /* Return NEW_BUF to our pool. */ + STAT_INC (file_pagein_freed_bufs); + } +@@ -316,7 +316,7 @@ pending_blocks_write (struct pending_blocks *pb) + /* Put what we're going to write into a page-aligned buffer. */ + { + void *page_buf = get_page_buf (); +- bcopy (pb->buf + pb->offs, (void *)page_buf, length); ++ memcpy ((void *)page_buf, pb->buf + pb->offs, length); + err = store_write (store, dev_block, page_buf, length, &amount); + free_page_buf (page_buf); + } +diff --git a/libpager/pagemap.c b/libpager/pagemap.c +index b8b3362..963f656 100644 +--- a/libpager/pagemap.c ++++ b/libpager/pagemap.c +@@ -36,7 +36,7 @@ _pager_pagemap_resize (struct pager *p, vm_address_t off) + err = (newaddr == (void *) -1) ? errno : 0; + if (! err) + { +- bcopy (p->pagemap, newaddr, p->pagemapsize * sizeof (*p->pagemap)); ++ memcpy (newaddr, p->pagemap, p->pagemapsize * sizeof (*p->pagemap)); + munmap (p->pagemap, p->pagemapsize * sizeof (*p->pagemap)); + p->pagemap = newaddr; + p->pagemapsize = newsize; +diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c +index 9e4b0e7..83382c0 100644 +--- a/mach-defpager/default_pager.c ++++ b/mach-defpager/default_pager.c +@@ -431,7 +431,7 @@ create_paging_partition(const char *name, + memset (new_list, 0, n * sizeof(partition_t)); + if (i) { + old_list = all_partitions.partition_list; +- bcopy(old_list, new_list, i*sizeof(partition_t)); ++ memcpy (new_list, old_list, i*sizeof(partition_t)); + } + all_partitions.partition_list = new_list; + all_partitions.n_partitions = n; +@@ -1678,7 +1678,7 @@ ddprintf ("default_read(%x,%x,%x,%d)\n",addr,size,offset,block.block.p_index); + * the next piece. + */ + first_time = FALSE; +- bcopy((char *)raddr, (char *)addr, rsize); ++ memcpy ((char *)addr, (char *)raddr, rsize); + addr += rsize; + offset += rsize; + size -= rsize; +diff --git a/pfinet/ethernet.c b/pfinet/ethernet.c +index 1678243..e6ae53c 100644 +--- a/pfinet/ethernet.c ++++ b/pfinet/ethernet.c +@@ -158,10 +158,10 @@ ethernet_demuxer (mach_msg_header_t *inp, + skb->dev = dev; + + /* Copy the two parts of the frame into the buffer. */ +- bcopy (msg->header, skb->data, ETH_HLEN); +- bcopy (msg->packet + sizeof (struct packet_header), +- skb->data + ETH_HLEN, +- datalen - ETH_HLEN); ++ memcpy (skb->data, msg->header, ETH_HLEN); ++ memcpy (skb->data + ETH_HLEN, ++ msg->packet + sizeof (struct packet_header), ++ datalen - ETH_HLEN); + + /* Drop it on the queue. */ + skb->protocol = eth_type_trans (skb, dev); +@@ -389,7 +389,7 @@ setup_ethernet_device (char *name, struct device **device) + error (2, err, "%s: Cannot get hardware Ethernet address", name); + net_address[0] = ntohl (net_address[0]); + net_address[1] = ntohl (net_address[1]); +- bcopy (net_address, dev->dev_addr, ETH_ALEN); ++ memcpy (dev->dev_addr, net_address, ETH_ALEN); + + /* That should be enough. */ + +diff --git a/pfinet/tunnel.c b/pfinet/tunnel.c +index 6a7f355..02e9ee8 100644 +--- a/pfinet/tunnel.c ++++ b/pfinet/tunnel.c +@@ -395,7 +395,7 @@ trivfs_S_io_write (struct trivfs_protid *cred, + skb->len = datalen; + skb->dev = &tdev->dev; + +- bcopy (data, skb->data, datalen); ++ memcpy (skb->data, data, datalen); + + /* Drop it on the queue. */ + skb->mac.raw = skb->data; +-- +2.1.3 + diff --git a/debian/patches/series b/debian/patches/series index ef03f009..8e181e1e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -45,3 +45,8 @@ startup-avoid-broken-puts.patch pfinet_dhcp.patch libports-payloads.patch proc-task-notify-0005-proc-fix-build.patch +0001-libpager-remove-the-seqno-parameters.patch +0002-libpager-use-libports-notification-functions.patch +0003-ext2fs-tune-the-size-of-the-inode-cache.patch +0004-Replace-bzero-with-memset.patch +0005-xxx-replace-bcopy-with-memcpy-or-memmove-as-appropri.patch |