diff -urNh ../fakeroot-0.4.5/communicate.h ./communicate.h
--- ../fakeroot-0.4.5/communicate.h	Tue Sep  7 20:38:14 1999
+++ ./communicate.h	Wed May 15 14:37:56 2002
@@ -25,8 +25,10 @@
 #endif
 
 /* Then include features.h, to find out what glibc we run */
-#ifndef sun
+#if !defined (sun) && !defined (__NetBSD__) 
 #include <features.h>
+#elif defined (__NetBSD__)
+#include <sys/featuretest.h>
 #else
 #include <sys/feature_tests.h>
 #endif
diff -urNh ../fakeroot-0.4.5/configure.in ./configure.in
--- ../fakeroot-0.4.5/configure.in	Wed Sep  8 19:27:19 1999
+++ ./configure.in	Wed May 15 14:35:19 2002
@@ -119,7 +119,7 @@
   FUNC=`echo $SEARCH|sed -e 's/.*%//'`
   PRE=`echo $SEARCH|sed -e 's/%.*//'`
   FOUND=
-  for WRAPPED in __${PRE}x${FUNC} ${PRE}${FUNC}; do
+  for WRAPPED in __${PRE}${FUNC}13 __${PRE}x${FUNC} ${PRE}${FUNC}; do
     AC_CHECK_FUNCS($WRAPPED,FOUND=$WRAPPED)
 dnl
 dnl to unconditionally define only the _* functions, comment out the 2 lines above,
diff -urNh ../fakeroot-0.4.5/fake/config.cache ./fake/config.cache
--- ../fakeroot-0.4.5/fake/config.cache	Wed Sep 26 19:27:09 2001
+++ ./fake/config.cache	Thu Jan  1 00:00:00 1970
@@ -1,58 +0,0 @@
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-ac_cv_cygwin=${ac_cv_cygwin=no}
-ac_cv_exeext=${ac_cv_exeext=no}
-ac_cv_header_dlfcn_h=${ac_cv_header_dlfcn_h=yes}
-ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen=yes}
-ac_cv_mingw32=${ac_cv_mingw32=no}
-ac_cv_objext=${ac_cv_objext=o}
-ac_cv_path_install=${ac_cv_path_install=$'/usr/bin/install -c'}
-ac_cv_prog_CC=${ac_cv_prog_CC=gcc}
-ac_cv_prog_CPP=${ac_cv_prog_CPP=$'cc -E'}
-ac_cv_prog_CXX=${ac_cv_prog_CXX=c++}
-ac_cv_prog_LN_S=${ac_cv_prog_LN_S=$'ln -s'}
-ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=ranlib}
-ac_cv_prog_STRIP=${ac_cv_prog_STRIP=strip}
-ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no}
-ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes}
-ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes}
-ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross=no}
-ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=yes}
-ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works=yes}
-ac_cv_prog_gcc=${ac_cv_prog_gcc=yes}
-ac_cv_prog_gxx=${ac_cv_prog_gxx=yes}
-ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes}
-lt_cv_archive_cmds_need_lc=${lt_cv_archive_cmds_need_lc=no}
-lt_cv_compiler_c_o=${lt_cv_compiler_c_o=yes}
-lt_cv_compiler_o_lo=${lt_cv_compiler_o_lo=yes}
-lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method=pass_all}
-lt_cv_file_magic_cmd=${lt_cv_file_magic_cmd=$'$MAGIC_CMD'}
-lt_cv_file_magic_test_file=${lt_cv_file_magic_test_file=$'/lib/libc.so.5 /lib/libc.so.5.4.46 /lib/libc.so.6 /lib/libc-2.1.1.so /lib/libc-2.2.4.so'}
-lt_cv_global_symbol_to_c_name_address=${lt_cv_global_symbol_to_c_name_address=$'sed -n -e \'s/^: \\([^ ]*\\) $/  {\\"\\1\\", (lt_ptr) 0},/p\' -e \'s/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)$/  {"\\2", (lt_ptr) \\&\\2},/p\''}
-lt_cv_global_symbol_to_cdecl=${lt_cv_global_symbol_to_cdecl=$'sed -n -e \'s/^. .* \\(.*\\)$/extern char \\1;/p\''}
-lt_cv_ld_reload_flag=${lt_cv_ld_reload_flag=-r}
-lt_cv_path_LD=${lt_cv_path_LD=/usr/bin/ld}
-lt_cv_path_NM=${lt_cv_path_NM=$'/usr/bin/nm -B'}
-lt_cv_prog_cc_can_build_shared=${lt_cv_prog_cc_can_build_shared=yes}
-lt_cv_prog_cc_no_builtin=${lt_cv_prog_cc_no_builtin=}
-lt_cv_prog_cc_pic=${lt_cv_prog_cc_pic=$' -fPIC'}
-lt_cv_prog_cc_pic_works=${lt_cv_prog_cc_pic_works=yes}
-lt_cv_prog_cc_shlib=${lt_cv_prog_cc_shlib=}
-lt_cv_prog_cc_static=${lt_cv_prog_cc_static=-static}
-lt_cv_prog_cc_static_works=${lt_cv_prog_cc_static_works=yes}
-lt_cv_prog_cc_wl=${lt_cv_prog_cc_wl=-Wl,}
-lt_cv_prog_gnu_ld=${lt_cv_prog_gnu_ld=yes}
-lt_cv_sys_global_symbol_pipe=${lt_cv_sys_global_symbol_pipe=$'sed -n -e \'s/^.*[ \t]\\([ABCDGISTW][ABCDGISTW]*\\)[ \t][ \t]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)$/\\1 \\2\\3 \\3/p\''}
-lt_cv_sys_path_separator=${lt_cv_sys_path_separator=:}
diff -urNh ../fakeroot-0.4.5/fakerootconfig.h ./fakerootconfig.h
--- ../fakeroot-0.4.5/fakerootconfig.h	Sat Oct  9 15:31:20 1999
+++ ./fakerootconfig.h	Wed May 15 11:30:43 2002
@@ -1,14 +1,8 @@
-#define NEXT_STAT(a,b,c) next___xstat(a,b,c)
-#define STAT_ARG(a,b,c) (a,b,c)
-#define NEXT_FSTAT(a,b,c) next___fxstat(a,b,c)
-#define FSTAT_ARG(a,b,c) (a,b,c)
-#define NEXT_LSTAT(a,b,c) next___lxstat(a,b,c)
-#define LSTAT_ARG(a,b,c) (a,b,c)
-#define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
-#define STAT64_ARG(a,b,c) (a,b,c)
-#define NEXT_FSTAT64(a,b,c) next___fxstat64(a,b,c)
-#define FSTAT64_ARG(a,b,c) (a,b,c)
-#define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
-#define LSTAT64_ARG(a,b,c) (a,b,c)
-#define NEXT_MKNOD(a,b,c,d) next___xmknod(a,b,c,d)
-#define MKNOD_ARG(a,b,c,d) (a,b,c,d)
+#define NEXT_STAT(a,b,c) next___stat13(b,c)
+#define STAT_ARG(a,b,c) (b,c)
+#define NEXT_FSTAT(a,b,c) next___fstat13(b,c)
+#define FSTAT_ARG(a,b,c) (b,c)
+#define NEXT_LSTAT(a,b,c) next___lstat13(b,c)
+#define LSTAT_ARG(a,b,c) (b,c)
+#define NEXT_MKNOD(a,b,c,d) next_mknod(b,c,d)
+#define MKNOD_ARG(a,b,c,d) (b,c,d)
diff -urNh ../fakeroot-0.4.5/libfakeroot.c ./libfakeroot.c
--- ../fakeroot-0.4.5/libfakeroot.c	Fri Apr 13 16:56:00 2001
+++ ./libfakeroot.c	Wed May 15 14:37:01 2002
@@ -52,6 +52,8 @@
 */
 #ifdef __alpha__
 #define LIBCPATH "/lib/libc.so.6.1"
+#elif defined (__NetBSD__)
+#define LIBCPATH "/usr/lib/libc.so.12"
 #else
 #define LIBCPATH "/lib/libc.so.6"
 #endif
