Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
Strace is a diagnostic and troubleshooting tool for printing out a trace
of all the system calls made by another process. It intercepts and
records the signals received by a process and the system calls which
are called by a process. The name of each system call, its arguments
and its return value are reported.
This version of strace is maintained by Wichert Akkerman.
+39
View File
@@ -0,0 +1,39 @@
# $NetBSD: Makefile,v 1.21 2013/05/31 12:42:05 wiz Exp $
#
DISTNAME= strace-4.5.15
PKGREVISION= 6
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=strace/}
EXTRACT_SUFX= .tar.bz2
MAINTAINER= christos@NetBSD.org
HOMEPAGE= http://sourceforge.net/projects/strace/
COMMENT= Trace system calls
LICENSE= modified-bsd
# NetBSD < 3.99.16
NOT_FOR_PLATFORM= NetBSD-[012]*-* NetBSD-3.[0-9][._]*-* \
NetBSD-3.99.[0-9]-* NetBSD-3.99.1[0-5]-*
NOT_FOR_PLATFORM+= DragonFly-*-*
GNU_CONFIGURE= yes
REPLACE_PERL= strace-graph
USE_TOOLS+= perl:run
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Linux"
USE_TOOLS+= autoconf
pre-configure:
cd ${WRKSRC} && autoconf
.endif
.if ${OPSYS} == "NetBSD"
MAKE_ENV+= NETBSD_SRCDIR=${BSD_SRCDIR:Q}
pre-configure:
${CP} -f ${WRKSRC}/syscalls.pl ${WRKSRC}/netbsd
.endif
.include "../../mk/bsd.pkg.mk"
+4
View File
@@ -0,0 +1,4 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/12 19:09:38 rillig Exp $
bin/strace
bin/strace-graph
man/man1/strace.1
+36
View File
@@ -0,0 +1,36 @@
$NetBSD: distinfo,v 1.18 2011/09/03 14:44:03 christos Exp $
SHA1 (strace-4.5.15.tar.bz2) = a6bd153eeb1a25a50bb5a1d92887a4911ec9ad48
RMD160 (strace-4.5.15.tar.bz2) = 0c6aaa8820a0985d89b21a5da9578b27435c8906
Size (strace-4.5.15.tar.bz2) = 455607 bytes
SHA1 (patch-aa) = 16c7a70bccbebfcf24640cd4e632ff127586e6c9
SHA1 (patch-ab) = 50367d9b603465148df29f468a29c8617b874edb
SHA1 (patch-ac) = 8af13f7db2812538a4d34ddf6e15f679c92b4776
SHA1 (patch-ad) = 091b7a2b555d3e5c8d2c4f338b929c7792ea5b0b
SHA1 (patch-ae) = f10bdf45432bc9a09f33f4fd94009bf9ed097a7f
SHA1 (patch-af) = 6cc8ea3dddff21d99b9b92e7535a4524a2a15a75
SHA1 (patch-ag) = 3368bd7a2fca807cc093090c6a1a9e2d3c81bfb0
SHA1 (patch-ah) = 72d6fd1cd92c22b5215f87fcf268fd375b3f7803
SHA1 (patch-ai) = 01430e21dd0e6d2e19f93fab8846a3464ee5e7a0
SHA1 (patch-aj) = 7aa9cce398f73191a968118ce8c67703d8363045
SHA1 (patch-ak) = 1b82f68c3a21bc24ce464f64bc91081a71f36199
SHA1 (patch-al) = ea408e93a15c5fdd8054a65b409c60536ca928eb
SHA1 (patch-am) = edb9a6a4b76b6f0a39427562fe96a73fea3ecf4a
SHA1 (patch-an) = 23b55878f0f7c6b83b937219a3c730ec5c6cb7ea
SHA1 (patch-ao) = 90c47a7437204258b7d17986f5a5a94a196d0a38
SHA1 (patch-ap) = 8ed16f25eb9ef1c9c1499a77e7f39bf23d50e209
SHA1 (patch-aq) = e900e4025525a598b0b1c7ce9586cd5fecd63093
SHA1 (patch-ar) = 12b13f8b7e2054cbe57da6b502f3fe49b91de9ff
SHA1 (patch-as) = b241a70fb33aabb8282578a124b04aca05f0d3f2
SHA1 (patch-at) = da44d0101eb069ea231bdce7051af357e43cb3d1
SHA1 (patch-au) = 39ce7d7234ac3df0a7db24d0310989015b981a91
SHA1 (patch-av) = fa71fcd3a91f2ed58d9880cf8ae76250eaaadf6d
SHA1 (patch-aw) = 6d9c8243df401fb18e621c8965667778640c9d01
SHA1 (patch-ax) = 6bb4fdfaf26f9ded736f0aa8f0209815ccbea199
SHA1 (patch-ay) = 9a6942117fc4d26a9256a573559597560295d9c0
SHA1 (patch-az) = af6272c48668785dffd7c5b42b8fa2c8edb562d0
SHA1 (patch-ba) = be8e2f79bd8818b99bdce63fb73802f1a4014b2f
SHA1 (patch-bb) = e7e309d96ec9fa2398a968f29f7e6549ff81e37e
SHA1 (patch-bc) = 7eece85b62383a0f6cb3b8e9dbe2a9a0316c6c02
SHA1 (patch-bd) = 6ad13b8b0130886cc87218d9acfe46d8f9fc82ef
SHA1 (patch-be) = 6326b50b3d9be0524d67770d67530069866edd9e
+36
View File
@@ -0,0 +1,36 @@
$NetBSD: patch-aa,v 1.3 2007/12/05 16:31:00 christos Exp $
--- Makefile.in.orig 2007-01-11 17:23:32.000000000 -0500
+++ Makefile.in 2007-12-05 11:01:59.000000000 -0500
@@ -99,6 +99,8 @@
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
+ALLBSD_FALSE = @ALLBSD_FALSE@
+ALLBSD_TRUE = @ALLBSD_TRUE@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
@@ -137,6 +139,8 @@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
+NETBSD_FALSE = @NETBSD_FALSE@
+NETBSD_TRUE = @NETBSD_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -275,9 +279,12 @@
@I386_FALSE@@LINUX_TRUE@@MAINTAINER_MODE_TRUE@ioctlent_h = linux/$(ARCH)/ioctlent.h
@I386_TRUE@@LINUX_TRUE@@MAINTAINER_MODE_TRUE@ioctlent_h = linux/ioctlent.h
@LINUX_TRUE@@MAINTAINER_MODE_TRUE@BUILT_SOURCES = $(ioctlent_h)
-all: $(BUILT_SOURCES) config.h
+all: $(BUILT_SOURCES) config.h @NETBSD_TRUE@ headers
$(MAKE) $(AM_MAKEFLAGS) all-am
+@NETBSD_TRUE@headers:
+@NETBSD_TRUE@ cd netbsd && make
+
.SUFFIXES:
.SUFFIXES: .c .o .obj
am--refresh:
+44
View File
@@ -0,0 +1,44 @@
$NetBSD: patch-ab,v 1.5 2009/12/07 05:06:37 dholland Exp $
--- /dev/null 2007-04-26 23:20:40.000000000 -0400
+++ netbsd/Makefile 2007-04-27 15:14:51.000000000 -0400
@@ -0,0 +1,39 @@
+all:;
+
+.include <bsd.own.mk>
+
+arch != uname -p
+NETBSDSRCDIR?= /usr/src
+
+DEP= syscallent.h ioctlent.h errnoent.h signalent.h
+ALL= ${DEP}
+ALL+= syscall.h ${arch}/errnoent1.h ${arch}/ioctlent1.h ${arch}/syscallent1.h ${arch}/signalent1.h
+
+all: ${ALL}
+
+syscallent.h: syscalls.pl syscalls.print syscalls.cat ${NETBSDSRCDIR}/sys/kern/syscalls.master
+ @chmod +x syscalls.pl
+ ./syscalls.pl ${NETBSDSRCDIR}/sys/kern/syscalls.master syscalls.print syscalls.cat > $@
+
+syscall.h: syscallent.h
+
+signalent.h: mksignal ${NETBSDSRCDIR}/sys/sys/signal.h
+ @chmod +x mksignal
+ ./mksignal ${NETBSDSRCDIR}/sys/sys/signal.h > $@
+
+errnoent.h: mkerrno ${NETBSDSRCDIR}/sys/sys/errno.h
+ @chmod +x mkerrno
+ ./mkerrno ${NETBSDSRCDIR}/sys/sys/errno.h > $@
+
+ioctlent.h: ioctlent.sh
+ @chmod +x ioctlent.sh
+ ./ioctlent.sh > $@
+
+.for i in ${DEP}
+${arch}/${i:R}1.h:
+ @mkdir -p ${arch}
+ echo '#include "../$i"' > $@
+.endfor
+
+clean:
+ rm -f ${ALL} ioctlent.c ioctlent
+557
View File
@@ -0,0 +1,557 @@
$NetBSD: patch-ac,v 1.3 2007/12/05 16:31:00 christos Exp $
--- aclocal.m4.orig 2007-01-11 17:23:29.000000000 -0500
+++ aclocal.m4 2007-12-05 11:01:59.000000000 -0500
@@ -11,11 +11,23 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# -*- Autoconf -*-
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Generated from amversion.in; do not edit by hand.
+
+# 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., 59 Temple Place - Suite 330, Boston, MA
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
@@ -83,16 +95,26 @@
am_aux_dir=`cd $ac_aux_dir && pwd`
])
-# AM_CONDITIONAL -*- Autoconf -*-
+# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
-# serial 7
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 6
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -116,15 +138,26 @@
Usually this means the macro was only invoked conditionally.]])
fi])])
+# serial 7 -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-# serial 8
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
@@ -133,6 +166,7 @@
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
@@ -272,16 +306,27 @@
AC_SUBST([AMDEPBACKSLASH])
])
-# Generate code to set up dependency tracking. -*- Autoconf -*-
+# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
-#serial 3
+#serial 2
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
@@ -340,31 +385,54 @@
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
-# serial 8
+# serial 7
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-# Do all the work for Automake. -*- Autoconf -*-
+# Do all the work for Automake. -*- Autoconf -*-
+
+# This macro actually does too much some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-# serial 12
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
+# serial 11
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
@@ -466,27 +534,51 @@
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
+
+# Copyright (C) 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# -*- Autoconf -*-
+# Copyright (C) 2003 Free Software Foundation, Inc.
-# serial 2
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
@@ -501,17 +593,28 @@
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-# serial 4
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
@@ -530,15 +633,26 @@
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-# Check to see how 'make' treats includes. -*- Autoconf -*-
+# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-# serial 3
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
# AM_MAKE_INCLUDE()
# -----------------
@@ -582,16 +696,27 @@
rm -f confinc confmf
])
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+# -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-# serial 4
+# Copyright (C) 1997, 1999, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -617,16 +742,27 @@
fi
])
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
+
+# Copyright (C) 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
@@ -680,15 +816,26 @@
fi
AC_SUBST([mkdir_p])])
-# Helper functions for option handling. -*- Autoconf -*-
+# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-# serial 3
+# 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
# _AM_MANGLE_OPTION(NAME)
# -----------------------
@@ -713,16 +860,28 @@
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Check to make sure that the build environment is sane.
+#
-# serial 4
+# Copyright (C) 1996, 1997, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
# AM_SANITY_CHECK
# ---------------
@@ -765,14 +924,25 @@
fi
AC_MSG_RESULT(yes)])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
# AM_PROG_INSTALL_STRIP
-# ---------------------
+
+# Copyright (C) 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
@@ -795,13 +965,25 @@
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
+# Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
-# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
+23
View File
@@ -0,0 +1,23 @@
$NetBSD: patch-ad,v 1.2 2007/04/27 19:45:01 christos Exp $
--- config.h.in.orig 2006-01-12 06:21:24.000000000 -0500
+++ config.h.in 2007-04-27 11:31:50.000000000 -0400
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define for the BSD-like operating system. */
+#undef ALLBSD
+
/* Define for the Alpha architecture. */
#undef ALPHA
@@ -327,6 +330,9 @@
/* Define for the MIPS architecture. */
#undef MIPS
+/* Define for the NetBSD operating system. */
+#undef NETBSD
+
/* Name of package */
#undef PACKAGE
+36
View File
@@ -0,0 +1,36 @@
$NetBSD: patch-ae,v 1.3 2007/12/06 16:59:37 christos Exp $
--- configure.ac.orig 2007-01-11 06:37:55.000000000 -0500
+++ configure.ac 2007-12-06 11:55:17.000000000 -0500
@@ -33,6 +33,12 @@
freebsd*)
opsys=freebsd
AC_DEFINE([FREEBSD], 1, [Define for the FreeBSD operating system.])
+ AC_DEFINE([ALLBSD], 1, [Define for the BSD-like operating system.])
+ ;;
+netbsd*)
+ opsys=netbsd
+ AC_DEFINE([NETBSD], 1, [Define for the NetBSD operating system.])
+ AC_DEFINE([ALLBSD], 1, [Define for the BSD-like operating system.])
;;
*)
AC_MSG_RESULT([NO!])
@@ -119,6 +125,8 @@
AM_CONDITIONAL([SUNOS4], [test x$opsys = xsunos4])
AM_CONDITIONAL([SVR4], [test x$opsys = xsvr4])
AM_CONDITIONAL([FREEBSD], [test x$opsys = xfreebsd])
+AM_CONDITIONAL([NETBSD], [test x$opsys = xnetbsd])
+AM_CONDITIONAL([ALLBSD], [test x$opsys = xnetbsd -o x$opsys = xfreebsd])
AC_PROG_CC
AC_GNU_SOURCE
@@ -194,7 +202,8 @@
AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl prctl sendmsg inet_ntop if_indextoname)
AC_CHECK_HEADERS([sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h stropts.h sys/conf.h sys/stream.h sys/tihdr.h sys/tiuser.h sys/sysconfig.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h sys/uio.h sys/aio.h poll.h sys/poll.h sys/vfs.h asm/sysmips.h linux/utsname.h sys/nscsys.h mqueue.h sys/epoll.h libaio.h inttypes.h], [], [])
AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
- [], [], [#include <linux/socket.h>])
+ [], [], [#include <stddef.h>
+#include <linux/socket.h>])
AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
+97
View File
@@ -0,0 +1,97 @@
$NetBSD: patch-af,v 1.3 2011/01/25 22:22:15 shattered Exp $
--- configure.orig 2006-01-12 06:20:14.000000000 -0500
+++ configure 2007-04-27 11:31:55.000000000 -0400
@@ -309,7 +309,7 @@
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os opsys arch LINUX_TRUE LINUX_FALSE I386_TRUE I386_FALSE X86_64_TRUE X86_64_FALSE SUNOS4_TRUE SUNOS4_FALSE SVR4_TRUE SVR4_FALSE FREEBSD_TRUE FREEBSD_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE WARNFLAGS CPP EGREP PERL LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os opsys arch LINUX_TRUE LINUX_FALSE I386_TRUE I386_FALSE X86_64_TRUE X86_64_FALSE SUNOS4_TRUE SUNOS4_FALSE SVR4_TRUE SVR4_FALSE FREEBSD_TRUE FREEBSD_FALSE NETBSD_TRUE NETBSD_FALSE ALLBSD_TRUE ALLBSD_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE WARNFLAGS CPP EGREP PERL LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -1882,6 +1882,24 @@
#define FREEBSD 1
_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
+#define ALLBSD 1
+_ACEOF
+
+ ;;
+netbsd*)
+ opsys=netbsd
+
+cat >>confdefs.h <<\_ACEOF
+#define NETBSD 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define ALLBSD 1
+_ACEOF
+
;;
*)
echo "$as_me:$LINENO: result: NO!" >&5
@@ -2092,6 +2110,26 @@
fi
+
+if test x$opsys = xnetbsd; then
+ NETBSD_TRUE=
+ NETBSD_FALSE='#'
+else
+ NETBSD_TRUE='#'
+ NETBSD_FALSE=
+fi
+
+
+
+if test x$opsys = xnetbsd -o x$opsys = xfreebsd; then
+ ALLBSD_TRUE=
+ ALLBSD_FALSE='#'
+else
+ ALLBSD_TRUE='#'
+ ALLBSD_FALSE=
+fi
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8511,6 +8549,20 @@
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${NETBSD_TRUE}" && test -z "${NETBSD_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"NETBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"NETBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${ALLBSD_TRUE}" && test -z "${ALLBSD_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"ALLBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ALLBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -9104,6 +9158,10 @@
s,@SVR4_FALSE@,$SVR4_FALSE,;t t
s,@FREEBSD_TRUE@,$FREEBSD_TRUE,;t t
s,@FREEBSD_FALSE@,$FREEBSD_FALSE,;t t
+s,@NETBSD_TRUE@,$NETBSD_TRUE,;t t
+s,@NETBSD_FALSE@,$NETBSD_FALSE,;t t
+s,@ALLBSD_TRUE@,$ALLBSD_TRUE,;t t
+s,@ALLBSD_FALSE@,$ALLBSD_FALSE,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
s,@LDFLAGS@,$LDFLAGS,;t t
+53
View File
@@ -0,0 +1,53 @@
$NetBSD: patch-ag,v 1.3 2007/12/06 16:59:37 christos Exp $
--- defs.h.orig 2007-01-15 15:25:52.000000000 -0500
+++ defs.h 2007-12-06 11:54:37.000000000 -0500
@@ -267,6 +267,39 @@
#define PR_FAULTED S_CORE
#endif
+#ifndef LINUX
+#if !defined(PTRACE_ATTACH) && defined(PT_ATTACH)
+#define PTRACE_ATTACH PT_ATTACH
+#endif
+#if !defined(PTRACE_DETACH) && defined(PT_DETACH)
+#define PTRACE_DETACH PT_DETACH
+#endif
+#if !defined(PTRACE_TRACEME) && defined(PT_TRACE_ME)
+#define PTRACE_TRACEME PT_TRACE_ME
+#endif
+#if !defined(PTRACE_SYSCALL) && defined(PT_SYSCALL)
+#define PTRACE_SYSCALL PT_SYSCALL
+#endif
+#if !defined(PTRACE_KILL) && defined(PT_KILL)
+#define PTRACE_KILL PT_KILL
+#endif
+#if !defined(PTRACE_CONT) && defined(PT_CONTINUE)
+#define PTRACE_CONT PT_CONTINUE
+#endif
+#if !defined(PTRACE_PEEKDATA) && defined(PT_READ_D)
+#define PTRACE_PEEKDATA PT_READ_D
+#endif
+#if !defined(PTRACE_PEEKUSER) && defined(PT_READ_I)
+#define PTRACE_PEEKUSER PT_READ_I
+#endif
+#if !defined(PTRACE_GETREGS) && defined(PT_GETREGS)
+#define PTRACE_GETREGS PT_GETREGS
+#endif
+#if !defined(PTRACE_SETREGS) && defined(PT_SETREGS)
+#define PTRACE_SETREGS PT_SETREGS
+#endif
+#endif
+
/* Trace Control Block */
struct tcb {
short flags; /* See below for TCB_ values */
@@ -309,6 +342,8 @@
#endif
#ifdef FREEBSD
struct procfs_status status;
+#endif
+#ifdef ALLBSD
int pfd_reg;
int pfd_status;
#endif
+197
View File
@@ -0,0 +1,197 @@
$NetBSD: patch-ah,v 1.3 2007/12/05 16:31:00 christos Exp $
--- file.c.orig 2007-01-15 15:25:52.000000000 -0500
+++ file.c 2007-12-05 11:22:56.000000000 -0500
@@ -1,5 +1,4 @@
/*
-#ifdef LINUX
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
@@ -44,6 +43,13 @@
#else
#define kernel_dirent dirent
#endif
+#ifdef NETBSD
+#include <sys/statvfs.h>
+#define statfs statvfs
+#define __val __fsid_val
+#define f_fsid f_fsidx
+#endif
+
#ifdef LINUX
# ifdef LINUXSPARC
@@ -162,7 +168,7 @@
#define XATTR_REPLACE 2
#endif
-#ifdef FREEBSD
+#ifdef ALLBSD
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/stat.h>
@@ -831,16 +837,20 @@
#endif /* LINUXSPARC */
static const struct xlat fileflags[] = {
-#ifdef FREEBSD
+#ifdef ALLBSD
{ UF_NODUMP, "UF_NODUMP" },
{ UF_IMMUTABLE, "UF_IMMUTABLE" },
{ UF_APPEND, "UF_APPEND" },
{ UF_OPAQUE, "UF_OPAQUE" },
+#ifdef UF_NOUNLINK
{ UF_NOUNLINK, "UF_NOUNLINK" },
+#endif
{ SF_ARCHIVED, "SF_ARCHIVED" },
{ SF_IMMUTABLE, "SF_IMMUTABLE" },
{ SF_APPEND, "SF_APPEND" },
+#ifdef SF_NOUNLINK
{ SF_NOUNLINK, "SF_NOUNLINK" },
+#endif
#elif UNIXWARE >= 2
#ifdef _S_ISMLD
{ _S_ISMLD, "_S_ISMLD" },
@@ -852,7 +862,7 @@
{ 0, NULL },
};
-#ifdef FREEBSD
+#ifdef ALLBSD
int
sys_chflags(tcp)
struct tcb *tcp;
@@ -1058,7 +1068,7 @@
#endif /* !HAVE_STRUCT_STAT_ST_RDEV */
break;
default:
- tprintf("st_size=%llu, ", statbuf.st_size);
+ tprintf("st_size=%llu, ", (unsigned long long)statbuf.st_size);
break;
}
if (!abbrev(tcp)) {
@@ -1546,6 +1556,7 @@
#endif /* LINUX */
#ifndef SVR4
+#ifndef NETBSD
static const char *
sprintfstype(magic)
@@ -1564,6 +1575,7 @@
sprintf(buf, "%#x", magic);
return buf;
}
+#endif
static void
printstatfs(tcp, addr)
@@ -1591,7 +1603,11 @@
statbuf.f_namelen);
#else /* !ALPHA */
tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
+#ifndef NETBSD
sprintfstype(statbuf.f_type),
+#else
+ statbuf.f_fstypename,
+#endif
(unsigned long)statbuf.f_bsize,
(unsigned long)statbuf.f_blocks,
(unsigned long)statbuf.f_bfree);
@@ -1846,7 +1862,7 @@
return 0;
}
-#if defined(SUNOS4) || defined(SVR4)
+#if defined(SUNOS4) || defined(SVR4) || defined(NETBSD)
int
sys_fchroot(tcp)
struct tcb *tcp;
@@ -1856,7 +1872,7 @@
}
return 0;
}
-#endif /* SUNOS4 || SVR4 */
+#endif /* SUNOS4 || SVR4 || NETBSD */
int
sys_link(tcp)
@@ -2188,7 +2204,7 @@
}
#endif
-#ifdef FREEBSD
+#ifdef ALLBSD
int
sys_mkfifo(tcp)
struct tcb *tcp;
@@ -2199,7 +2215,7 @@
}
return 0;
}
-#endif /* FREEBSD */
+#endif /* ALLBSD */
int
sys_fsync(tcp)
@@ -2254,7 +2270,7 @@
#endif /* LINUX */
-#if defined FREEBSD || defined LINUX
+#if defined ALLBSD || defined LINUX
static const struct xlat direnttypes[] = {
{ DT_UNKNOWN, "DT_UNKNOWN" },
{ DT_FIFO, "DT_FIFO" },
@@ -2327,15 +2343,16 @@
d->d_namlen, d->d_namlen, d->d_name);
}
#endif /* SUNOS4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
if (!abbrev(tcp)) {
- tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
- i ? " " : "", d->d_fileno, d->d_reclen);
+ tprintf("%s{d_fileno=%llu, d_reclen=%u, d_type=",
+ i ? " " : "", (unsigned long long)d->d_fileno,
+ d->d_reclen);
printxval(direnttypes, d->d_type, "DT_???");
tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
d->d_namlen, d->d_namlen, d->d_name);
}
-#endif /* FREEBSD */
+#endif /* ALLBSD */
if (!d->d_reclen) {
tprintf("/* d_reclen == 0, problem here */");
break;
@@ -2421,7 +2438,7 @@
}
#endif
-#ifdef FREEBSD
+#ifdef ALLBSD
int
sys_getdirentries(tcp)
struct tcb * tcp;
@@ -2454,8 +2471,9 @@
for (i = 0; i < len;) {
struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
if (!abbrev(tcp)) {
- tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
- i ? " " : "", d->d_fileno, d->d_reclen);
+ tprintf("%s{d_fileno=%llu, d_reclen=%u, d_type=",
+ i ? " " : "", (unsigned long long)d->d_fileno,
+ d->d_reclen);
printxval(direnttypes, d->d_type, "DT_???");
tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
d->d_namlen, d->d_namlen, d->d_name);
@@ -2493,7 +2511,7 @@
}
#endif /* LINUX */
-#ifdef FREEBSD
+#ifdef ALLBSD
int
sys___getcwd(tcp)
struct tcb *tcp;
+57
View File
@@ -0,0 +1,57 @@
$NetBSD: patch-ai,v 1.2 2007/04/27 19:45:01 christos Exp $
--- ioctl.c.orig 2005-02-02 15:32:13.000000000 -0500
+++ ioctl.c 2007-04-27 11:35:05.000000000 -0400
@@ -68,6 +68,7 @@
const struct ioctlent *ioctlent;
int nioctlents;
+#ifndef NETBSD
static int
compare(a, b)
const void *a;
@@ -77,11 +78,19 @@
unsigned long code2 = ((struct ioctlent *) b)->code;
return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0;
}
+#endif
const struct ioctlent *
ioctl_lookup(code)
long code;
{
+#ifdef NETBSD
+ int i;
+ for (i = 0; i < nioctlents; i++)
+ if (ioctlent[i].code == code)
+ return &ioctlent[i];
+ return NULL;
+#else
struct ioctlent *iop, ioent;
ioent.code = code;
@@ -96,6 +105,7 @@
break;
}
return iop;
+#endif
}
const struct ioctlent *
@@ -130,14 +140,14 @@
case 0x89:
#else /* !LINUX */
case 'r': case 's': case 'i':
-#ifndef FREEBSD
+#ifndef ALLBSD
case 'p':
#endif
#endif /* !LINUX */
return sock_ioctl(tcp, code, arg);
#ifdef USE_PROCFS
#ifndef HAVE_MP_PROCFS
-#ifndef FREEBSD
+#ifndef ALLBSD
case 'q':
#else
case 'p':
+131
View File
@@ -0,0 +1,131 @@
$NetBSD: patch-aj,v 1.5 2011/08/30 10:43:11 christos Exp $
--- /dev/null 2011-08-30 13:38:39.000000000 +0300
+++ netbsd/ioctlent.sh 2011-08-30 12:45:46.000000000 +0300
@@ -0,0 +1,126 @@
+#!/bin/sh
+# $NetBSD: patch-aj,v 1.5 2011/08/30 10:43:11 christos Exp $
+#
+# Copyright (c) 1994
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# @(#)mkioctls 8.2 (Berkeley) 4/28/95
+#
+(
+#echo "#define const" # XXX: timepps lossage
+echo "#include <stdio.h>"
+echo "struct ap_control { int _xxx; };" # XXX: ip_nat.h lossage
+echo "#define COMPAT_43"
+echo "struct lwp;"
+echo "struct videomemory_t { int _xxx; };" # XXX arm video lossage
+echo "typedef struct videomemory_t videomemory_t;" # XXX arm video lossage
+echo "typedef int domid_t;" # XEN lossage
+echo "typedef int xen_pfn_t;" # XEN lossage
+
+echo "#include <sys/types.h>"
+echo "#include <sys/param.h>"
+echo "#include <sys/disk.h>"
+echo "#include <sys/dkbad.h>"
+echo "#include <sys/mount.h>"
+echo "#include <sys/termios.h>"
+echo "#include <sys/disklabel.h>"
+echo "#include <net/if.h>"
+echo "#include <net/route.h>"
+echo "#include <net/ppp_defs.h>"
+echo "#include <netinet/in.h>"
+echo "#include <netinet/in_systm.h>"
+echo "#include <netinet/ip.h>"
+echo "#include <netinet/ip_mroute.h>"
+echo "#include <netinet/ip_compat.h>"
+echo "#include <net80211/ieee80211.h>"
+echo "#include <netiso/iso.h>"
+
+echo "#define debug xxxdebug" # XXX ip_fil.h
+) > ioctlent.c
+set -- $(egrep -l '(_IO\(|_IOR\(|_IOW\(|_IORW\()' /usr/include/*/*.h)
+
+for i
+do
+ echo "#include <$i>"
+done | sed -e "s,${DESTDIR}/usr/include/,,g" >> ioctlent.c
+
+echo "#undef debug" >> ioctlent.c
+
+${CC:-cc} -E -nostdinc -idirafter $DESTDIR/usr/include -dM ${1+"$@"} | awk '
+BEGIN {
+ keep["SLIOCGUNIT"] = 1; # Same as PPPIOCGASYNCMAP
+ keep["TUNSLMODE"] = 1; # Same as PPPIOCGASYNCMAP
+ keep["SIOCRMNAT"] = 1; # Same as SIOCRMAFR
+ keep["SIOCADNAT"] = 1; # Same as SIOCADAFR
+ keep["SIOCDELST"] = 1; # Same as SIOCRMNAT
+ keep["CHIOGPICKER"] = 1; # Same as CDIOREADTOCHEADER
+ keep["KBDSTPMAT"] = 1; # Same as LMREADY, pcvt is gone so ok.
+
+ print ""
+ print "struct ioctlent {\n"
+ print "\t const char *file;\n"
+ print "\t const char *name;\n"
+ print "\t int number;\n"
+ print "};\n"
+ print "const struct ioctlent ioctlent0[] = "
+ print "{"
+ print ""
+ file = "";
+}
+/^#[ ]*define[ ]*[A-Z]*[ ]*_IO[RW]\(/ {
+
+ # find where the name starts
+ for (i = 1; i <= NF; i++)
+ if ($i ~ /define/)
+ break;
+ ++i;
+ printf("/* %s [%s] */\n", $0, $i);
+ #
+ if ($i ~ /^[A-Z0-9a-z_]*$/) {
+ if (keep[$i] != 1) {
+ printf("\t{ \"?\", \"%s\", %s },\n", $i, $i);
+ keep[$i] = 1;
+ }
+ }
+}
+END {
+ print "};\n"
+ print "/* Automatically generated file, do not edit! */"
+ print "int main(int argc, char *argv[]) {\n";
+ print "\tint i;\n";
+ print "\tfor (i = 0; i < sizeof(ioctlent0) / sizeof(ioctlent0[0]); i++)\n"
+ print "\t\tprintf(\"\t{ \\\"%s\\\", \\\"%s\\\", 0x%x },%c\",\n"
+ print "\t\t ioctlent0[i].file, ioctlent0[i].name, 0xffffffff & ioctlent0[i].number, 012);\n"
+ print "\treturn 0;\n";
+ print "}\n";
+}' >> ioctlent.c
+cc ioctlent.c -o ioctlent
+./ioctlent
+22
View File
@@ -0,0 +1,22 @@
$NetBSD: patch-ak,v 1.3 2007/12/05 16:31:00 christos Exp $
--- ipc.c.orig 2007-01-15 15:25:52.000000000 -0500
+++ ipc.c 2007-12-05 11:03:17.000000000 -0500
@@ -32,7 +32,7 @@
#include "defs.h"
-#if defined(LINUX) || defined(SUNOS4) || defined(FREEBSD)
+#if defined(LINUX) || defined(SUNOS4) || defined(ALLBSD)
# ifdef HAVE_MQUEUE_H
# include <mqueue.h>
@@ -410,7 +410,7 @@
return 0;
}
-#endif /* defined(LINUX) || defined(SUNOS4) || defined(FREEBSD) */
+#endif /* defined(LINUX) || defined(SUNOS4) || defined(ALLBSD) */
#ifdef LINUX
int
+14
View File
@@ -0,0 +1,14 @@
$NetBSD: patch-al,v 1.2 2007/04/27 19:45:01 christos Exp $
--- /dev/null 2007-04-26 23:20:40.000000000 -0400
+++ netbsd/mkerrno 2007-04-26 16:32:26.000000000 -0400
@@ -0,0 +1,9 @@
+#!/usr/bin/awk -f
+BEGIN {
+ printf("\t\"ERRNO0\",\n");
+}
+/^#define[ ]E/ {
+ if ($3 > 0) {
+ printf("\t\"%s\",\n", $2);
+ }
+}
+11
View File
@@ -0,0 +1,11 @@
$NetBSD: patch-am,v 1.2 2007/04/27 19:45:01 christos Exp $
--- /dev/null 2007-04-26 23:20:40.000000000 -0400
+++ netbsd/mksignal 2007-04-26 20:55:33.000000000 -0400
@@ -0,0 +1,6 @@
+#!/usr/bin/awk -f
+/^#define[ ]SIG/ {
+ if ($3 > 0) {
+ printf("\t\"%s\",\n", $2);
+ }
+}
+99
View File
@@ -0,0 +1,99 @@
$NetBSD: patch-an,v 1.5 2007/12/06 16:59:38 christos Exp $
--- net.c.orig 2006-12-13 14:57:23.000000000 -0500
+++ net.c 2007-12-06 11:54:11.000000000 -0500
@@ -35,7 +35,6 @@
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-
#if defined(HAVE_SIN6_SCOPE_ID_LINUX)
#define in6_addr in6_addr_libc
#define ipv6_mreq ipv6_mreq_libc
@@ -43,12 +42,19 @@
#endif
#include <netinet/in.h>
-#ifdef HAVE_NETINET_TCP_H
+#if defined(HAVE_NETINET_TCP_H) || defined(NETBSD)
#include <netinet/tcp.h>
#endif
-#ifdef HAVE_NETINET_UDP_H
+#if defined(HAVE_NETINET_UDP_H) || defined(NETBSD)
#include <netinet/udp.h>
#endif
+#ifdef NETBSD
+#include <sys/param.h>
+#include <sys/ucred.h>
+#ifdef NETBSD
+#define ucred uucred
+#endif
+#endif
#include <arpa/inet.h>
#include <net/if.h>
#if defined(LINUX)
@@ -800,8 +806,12 @@
#ifdef SOL_PACKET
static const struct xlat sockpacketoptions[] = {
+#if defined(PACKET_ADD_MEMBERSHIP)
{ PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" },
+#endif
+#if defined(PACKET_DROP_MEMBERSHIP)
{ PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"},
+#endif
#if defined(PACKET_RECV_OUTPUT)
{ PACKET_RECV_OUTPUT, "PACKET_RECV_OUTPUT" },
#endif
@@ -1099,7 +1109,7 @@
return;
}
- tprintf(", {cmsg_len=%zu, cmsg_level=", cmsg->cmsg_len);
+ tprintf(", {cmsg_len=%zu, cmsg_level=", (size_t)cmsg->cmsg_len);
printxval(socketlayers, cmsg->cmsg_level, "SOL_???");
tprintf(", cmsg_type=");
@@ -1125,12 +1135,21 @@
free(cmsg);
return;
}
+#if !defined(SCM_CREDENTIALS) && defined(SCM_CREDS)
+#define SCM_CREDENTIALS SCM_CREDS
+#endif
+
if (cmsg->cmsg_type == SCM_CREDENTIALS
&& CMSG_LEN(sizeof(struct ucred)) <= cmsg_len) {
struct ucred *uc = (struct ucred *) CMSG_DATA (cmsg);
+#ifdef NETBSD
+ tprintf("{uid=%ld, gid=%ld}}",
+ (long)uc->cr_uid, (long)uc->cr_gid);
+#else
tprintf("{pid=%ld, uid=%ld, gid=%ld}}",
(long)uc->pid, (long)uc->uid, (long)uc->gid);
+#endif
free(cmsg);
return;
}
@@ -1472,7 +1491,7 @@
else
tprintf("[%u, %u]", fds[0], fds[1]);
}
-#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(SVR4) || defined(FREEBSD) || defined(IA64)
+#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(SVR4) || defined(ALLBSD) || defined(IA64)
if (exiting(tcp))
tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
#endif
@@ -1519,9 +1538,9 @@
else
tprintf(", [%u, %u]", fds[0], fds[1]);
#endif /* LINUX */
-#if defined(SUNOS4) || defined(SVR4) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(SVR4) || defined(ALLBSD)
tprintf(", [%lu, %lu]", tcp->u_rval, getrval2(tcp));
-#endif /* SUNOS4 || SVR4 || FREEBSD */
+#endif /* SUNOS4 || SVR4 || ALLBSD */
}
return 0;
}
+184
View File
@@ -0,0 +1,184 @@
$NetBSD: patch-ao,v 1.4 2009/12/29 22:03:41 spz Exp $
--- process.c.orig 2007-01-11 23:08:38.000000000 +0100
+++ process.c 2009-12-29 21:57:56.000000000 +0100
@@ -40,6 +40,7 @@
#include "defs.h"
#include <fcntl.h>
+#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/wait.h>
@@ -52,7 +53,7 @@
#include <machine/reg.h>
#endif /* SUNOS4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
#include <sys/ptrace.h>
#endif
@@ -305,7 +306,7 @@
#endif /* HAVE_PRCTL */
-#if defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALLBSD) || defined(SUNOS4) || defined(SVR4)
int
sys_gethostid(tcp)
struct tcb *tcp;
@@ -314,7 +315,7 @@
return RVAL_HEX;
return 0;
}
-#endif /* FREEBSD || SUNOS4 || SVR4 */
+#endif /* ALLBSD || SUNOS4 || SVR4 */
int
sys_sethostname(tcp)
@@ -327,7 +328,7 @@
return 0;
}
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA) || defined(ALLBSD) || defined(SUNOS4) || defined(SVR4)
int
sys_gethostname(tcp)
struct tcb *tcp;
@@ -341,7 +342,7 @@
}
return 0;
}
-#endif /* ALPHA || FREEBSD || SUNOS4 || SVR4 */
+#endif /* ALPHA || ALLBSD || SUNOS4 || SVR4 */
int
sys_setdomainname(tcp)
@@ -1058,7 +1059,7 @@
#endif /* !USE_PROCFS */
-#if defined(SUNOS4) || defined(LINUX) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(LINUX) || defined(ALLBSD)
int
sys_vfork(tcp)
@@ -1069,7 +1070,7 @@
return 0;
}
-#endif /* SUNOS4 || LINUX || FREEBSD */
+#endif /* SUNOS4 || LINUX || ALLBSD */
#ifndef LINUX
@@ -2051,7 +2052,7 @@
#endif /* SVR4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
int
sys_wait(tcp)
struct tcb *tcp;
@@ -2070,12 +2071,14 @@
}
#endif
+#ifndef NETBSD
int
sys_waitpid(tcp)
struct tcb *tcp;
{
return printwaitn(tcp, 3, 0);
}
+#endif
int
sys_wait4(tcp)
@@ -2205,7 +2208,7 @@
#ifndef SVR4
static const struct xlat ptrace_cmds[] = {
-#ifndef FREEBSD
+#ifndef ALLBSD
{ PTRACE_TRACEME, "PTRACE_TRACEME" },
{ PTRACE_PEEKTEXT, "PTRACE_PEEKTEXT", },
{ PTRACE_PEEKDATA, "PTRACE_PEEKDATA", },
@@ -2271,7 +2274,7 @@
#endif /* !I386 */
{ PTRACE_GETUCODE, "PTRACE_GETUCODE" },
#endif /* SUNOS4 */
-#else /* FREEBSD */
+#else /* ALLBSD */
{ PT_TRACE_ME, "PT_TRACE_ME" },
{ PT_READ_I, "PT_READ_I" },
{ PT_READ_D, "PT_READ_D" },
@@ -2282,20 +2285,26 @@
#endif
{ PT_CONTINUE, "PT_CONTINUE" },
{ PT_KILL, "PT_KILL" },
+#if !(defined(NETBSD) && (defined(ALPHA) || defined(SPARC) || defined(SPARC64)))
{ PT_STEP, "PT_STEP" },
+#endif
{ PT_ATTACH, "PT_ATTACH" },
{ PT_DETACH, "PT_DETACH" },
{ PT_GETREGS, "PT_GETREGS" },
{ PT_SETREGS, "PT_SETREGS" },
{ PT_GETFPREGS, "PT_GETFPREGS" },
{ PT_SETFPREGS, "PT_SETFPREGS" },
+#ifdef PT_GETDBREGS
{ PT_GETDBREGS, "PT_GETDBREGS" },
+#endif
+#ifdef PT_SETDBREGS
{ PT_SETDBREGS, "PT_SETDBREGS" },
-#endif /* FREEBSD */
+#endif
+#endif /* ALLBSD */
{ 0, NULL },
};
-#ifndef FREEBSD
+#ifndef ALLBSD
#ifndef SUNOS4_KERNEL_ARCH_KLUDGE
static
#endif /* !SUNOS4_KERNEL_ARCH_KLUDGE */
@@ -2982,12 +2991,14 @@
sys_ptrace(tcp)
struct tcb *tcp;
{
+#ifndef NETBSD
const struct xlat *x;
+#endif
long addr;
if (entering(tcp)) {
printxval(ptrace_cmds, tcp->u_arg[0],
-#ifndef FREEBSD
+#ifndef ALLBSD
"PTRACE_???"
#else
"PT_???"
@@ -2995,7 +3006,7 @@
);
tprintf(", %lu, ", tcp->u_arg[1]);
addr = tcp->u_arg[2];
-#ifndef FREEBSD
+#ifndef ALLBSD
if (tcp->u_arg[0] == PTRACE_PEEKUSER
|| tcp->u_arg[0] == PTRACE_POKEUSER) {
for (x = struct_user_offsets; x->str; x++) {
@@ -3057,10 +3068,10 @@
}
}
#endif /* SUNOS4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
tprintf("%lu", tcp->u_arg[3]);
}
-#endif /* FREEBSD */
+#endif /* ALLBSD */
return 0;
}
+27
View File
@@ -0,0 +1,27 @@
$NetBSD: patch-ap,v 1.3 2007/12/05 16:31:01 christos Exp $
--- resource.c.orig 2006-10-15 21:17:52.000000000 -0400
+++ resource.c 2007-12-05 11:04:00.000000000 -0500
@@ -37,7 +37,7 @@
#include <sys/times.h>
#include <linux/kernel.h>
#endif /* LINUX */
-#if defined(SVR4) || defined(FREEBSD)
+#if defined(SVR4) || defined(ALLBSD)
#include <sys/times.h>
#include <sys/time.h>
#endif
@@ -454,9 +454,11 @@
tprintf("{...}");
else {
tprintf("{tms_utime=%lu, tms_stime=%lu, ",
- tbuf.tms_utime, tbuf.tms_stime);
+ (unsigned long)tbuf.tms_utime,
+ (unsigned long)tbuf.tms_stime);
tprintf("tms_cutime=%lu, tms_cstime=%lu}",
- tbuf.tms_cutime, tbuf.tms_cstime);
+ (unsigned long)tbuf.tms_cutime,
+ (unsigned long)tbuf.tms_cstime);
}
}
return 0;
+126
View File
@@ -0,0 +1,126 @@
$NetBSD: patch-aq,v 1.4 2011/08/30 10:43:11 christos Exp $
--- signal.c.orig 2007-01-12 00:08:38.000000000 +0200
+++ signal.c 2011-08-30 12:50:29.000000000 +0300
@@ -36,12 +36,27 @@
#include "defs.h"
#include <signal.h>
+#include <sys/param.h>
#include <sys/user.h>
#include <fcntl.h>
-#ifdef SVR4
+#if defined(SVR4) || defined(NETBSD)
#include <sys/ucontext.h>
#endif /* SVR4 */
+#ifdef NETBSD
+#if !defined(UC_CPU) && defined(_UC_CPU)
+#define UC_CPU _UC_CPU
+#endif
+#if !defined(UC_SIGMASK) && defined(_UC_SIGMASK)
+#define UC_SIGMASK _UC_SIGMASK
+#endif
+#if !defined(UC_STACK) && defined(_UC_STACK)
+#define UC_STACK _UC_STACK
+#endif
+#if !defined(UC_FPU) && defined(_UC_FPU)
+#define UC_FPU _UC_FPU
+#endif
+#endif
#ifdef HAVE_SYS_REG_H
# include <sys/reg.h>
@@ -1056,14 +1071,14 @@
return 0;
}
-#if defined(SUNOS4) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(ALLBSD)
int
sys_sigblock(tcp)
struct tcb *tcp;
{
return sys_sigsetmask(tcp);
}
-#endif /* SUNOS4 || FREEBSD */
+#endif /* SUNOS4 || ALLBSD */
#endif /* !SVR4 */
@@ -1165,13 +1180,13 @@
printsignal(tcp->u_arg[0]);
tprintf(", ");
switch (tcp->u_arg[1]) {
- case (int) SIG_ERR:
+ case (long) SIG_ERR:
tprintf("SIG_ERR");
break;
- case (int) SIG_DFL:
+ case (long) SIG_DFL:
tprintf("SIG_DFL");
break;
- case (int) SIG_IGN:
+ case (long) SIG_IGN:
#ifndef USE_PROCFS
if (tcp->u_arg[0] == SIGTRAP) {
tcp->flags |= TCB_SIGTRAPPED;
@@ -1193,11 +1208,11 @@
}
else {
switch (tcp->u_rval) {
- case (int) SIG_ERR:
+ case (long) SIG_ERR:
tcp->auxstr = "SIG_ERR"; break;
- case (int) SIG_DFL:
+ case (long) SIG_DFL:
tcp->auxstr = "SIG_DFL"; break;
- case (int) SIG_IGN:
+ case (long) SIG_IGN:
tcp->auxstr = "SIG_IGN"; break;
default:
tcp->auxstr = NULL;
@@ -1489,7 +1504,7 @@
#endif /* LINUX */
-#if defined(SVR4) || defined(FREEBSD)
+#if defined(SVR4) || defined(ALLBSD)
int
sys_sigsuspend(tcp)
@@ -1521,7 +1536,7 @@
#endif /* !FREEBSD */
#endif /* SVR4 || FREEBSD */
-#if defined SVR4 || defined LINUX || defined FREEBSD
+#if defined SVR4 || defined LINUX || defined ALLBSD
#if defined LINUX && !defined SS_ONSTACK
#define SS_ONSTACK 1
#define SS_DISABLE 2
@@ -1613,7 +1628,7 @@
#endif /* SVR4 */
-#if defined(LINUX) || defined(FREEBSD)
+#if defined(LINUX) || defined(ALLBSD)
static int
print_stack_t(tcp, addr)
@@ -1702,14 +1717,14 @@
return 0;
}
-#if defined(FREEBSD) || defined(SUNOS4)
+#if defined(ALLBSD) || defined(SUNOS4)
int
sys_killpg(tcp)
struct tcb *tcp;
{
return sys_kill(tcp);
}
-#endif /* FREEBSD || SUNOS4 */
+#endif /* ALLBSD || SUNOS4 */
#ifdef LINUX
int
+50
View File
@@ -0,0 +1,50 @@
$NetBSD: patch-ar,v 1.3 2007/04/27 19:45:02 christos Exp $
--- sock.c.orig 2005-06-01 15:02:37.000000000 -0400
+++ sock.c 2007-04-27 11:31:51.000000000 -0400
@@ -60,15 +60,23 @@
{ IFF_NOARP, "IFF_NOARP" },
{ IFF_PROMISC, "IFF_PROMISC" },
{ IFF_ALLMULTI, "IFF_ALLMULTI" },
+#ifdef IFF_MASTER
{ IFF_MASTER, "IFF_MASTER" },
+#endif
+#ifdef IFF_SLAVE
{ IFF_SLAVE, "IFF_SLAVE" },
+#endif
{ IFF_MULTICAST, "IFF_MULTICAST" },
+#ifdef IFF_PORTSEL
{ IFF_PORTSEL, "IFF_PORTSEL" },
+#endif
+#ifdef IFF_AUTOMEDIA
{ IFF_AUTOMEDIA, "IFF_AUTOMEDIA" },
+#endif
{ 0, NULL }
};
-
+#ifndef ALLBSD
static void
print_addr(tcp, addr, ifr)
struct tcb *tcp;
@@ -82,16 +90,19 @@
} else
printstr(tcp, addr, sizeof(ifr->ifr_addr.sa_data));
}
+#endif
int
sock_ioctl(tcp, code, arg)
struct tcb *tcp;
long code, arg;
{
- struct ifreq ifr;
struct ifconf ifc;
+#ifndef ALLBSD
+ struct ifreq ifr;
const char *str = NULL;
unsigned char *bytes;
+#endif
if (entering(tcp)) {
if (code == SIOCGIFCONF) {
+113
View File
@@ -0,0 +1,113 @@
$NetBSD: patch-as,v 1.1 2007/04/27 19:45:02 christos Exp $
--- strace.c.orig 2006-01-12 04:50:49.000000000 -0500
+++ strace.c 2007-04-27 11:31:51.000000000 -0400
@@ -820,13 +820,13 @@
}
#else
/* Open the process pseudo-file in /proc. */
-#ifndef FREEBSD
+#ifndef ALLBSD
sprintf(proc, "/proc/%d", tcp->pid);
if ((tcp->pfd = open(proc, O_RDWR|O_EXCL)) < 0) {
-#else /* FREEBSD */
+#else /* ALLBSD */
sprintf(proc, "/proc/%d/mem", tcp->pid);
if ((tcp->pfd = open(proc, O_RDWR)) < 0) {
-#endif /* FREEBSD */
+#endif /* ALLBSD */
perror("strace: open(\"/proc/...\", ...)");
return -1;
}
@@ -839,7 +839,7 @@
return -1;
}
#endif
-#ifdef FREEBSD
+#ifdef ALLBSD
sprintf(proc, "/proc/%d/regs", tcp->pid);
if ((tcp->pfd_reg = open(proc, O_RDONLY)) < 0) {
perror("strace: open(\"/proc/.../regs\", ...)");
@@ -853,7 +853,7 @@
}
} else
tcp->pfd_status = -1;
-#endif /* FREEBSD */
+#endif /* ALLBSD */
rebuild_pollv();
if (!attaching) {
/*
@@ -869,7 +869,7 @@
break;
}
}
-#ifndef FREEBSD
+#ifndef ALLBSD
/* Stop the process so that we own the stop. */
if (IOCTL(tcp->pfd, PIOCSTOP, (char *)NULL) < 0) {
perror("strace: PIOCSTOP");
@@ -1204,8 +1204,10 @@
int sig;
{
int error = 0;
+#if defined(NETBSD) || defined(LINUX)
+ int resumed, status;
+#endif
#ifdef LINUX
- int status, resumed;
struct tcb *zombie = NULL;
/* If the group leader is lingering only because of this other
@@ -1219,16 +1221,18 @@
if (tcp->flags & TCB_BPTSET)
sig = SIGKILL;
-#ifdef LINUX
+#if defined(LINUX) || defined(NETBSD)
/*
* Linux wrongly insists the child be stopped
* before detaching. Arghh. We go through hoops
* to make a clean break of things.
*/
#if defined(SPARC)
+#ifdef PTRACE_SUNDETACH
#undef PTRACE_DETACH
#define PTRACE_DETACH PTRACE_SUNDETACH
#endif
+#endif
if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) == 0) {
/* On a clear day, you can see forever. */
}
@@ -1296,7 +1300,7 @@
}
}
}
-#endif /* LINUX */
+#endif /* NETBSD */
#if defined(SUNOS4)
/* PTRACE_DETACH won't respect `sig' argument, so we post it here. */
@@ -2047,9 +2051,9 @@
pid = wait4(-1, &status, 0, cflag ? &ru : NULL);
#endif /* __WALL */
#endif /* LINUX */
-#ifdef SUNOS4
+#if defined(SUNOS4) || defined(NETBSD)
pid = wait(&status);
-#endif /* SUNOS4 */
+#endif /* SUNOS4 || NETBSD */
wait_errno = errno;
if (interactive)
sigprocmask(SIG_BLOCK, &blocked_set, NULL);
@@ -2279,7 +2283,11 @@
printtrailer(tcp);
}
if (((tcp->flags & TCB_ATTACHED) ||
+#ifdef LINUX
tcp->nclone_threads > 0) &&
+#else
+ 0) &&
+#endif
!sigishandled(tcp, WSTOPSIG(status))) {
#ifdef TCB_GROUP_EXITING
handle_group_exit(tcp, WSTOPSIG(status));
+31
View File
@@ -0,0 +1,31 @@
$NetBSD: patch-at,v 1.1 2007/04/27 19:45:02 christos Exp $
--- stream.c.orig 2005-06-01 15:22:07.000000000 -0400
+++ stream.c 2007-04-27 11:31:51.000000000 -0400
@@ -50,7 +50,7 @@
#include <sys/tihdr.h>
#endif
-#if defined(HAVE_SYS_STREAM_H) || defined(LINUX) || defined(FREEBSD)
+#if defined(HAVE_SYS_STREAM_H) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD)
#ifndef HAVE_STROPTS_H
#define RS_HIPRI 1
@@ -370,7 +370,7 @@
}
#endif
-#if !defined(LINUX) && !defined(FREEBSD)
+#if !defined(LINUX) && !defined(ALLBSD)
static const struct xlat stream_flush_options[] = {
{ FLUSHR, "FLUSHR" },
@@ -1298,6 +1298,6 @@
}
}
-#endif /* !LINUX && !FREEBSD */
+#endif /* !LINUX && !ALLBSD */
-#endif /* HAVE_SYS_STREAM_H || LINUX || FREEBSD */
+#endif /* HAVE_SYS_STREAM_H || LINUX || FREEBSD || NETBSD */
+306
View File
@@ -0,0 +1,306 @@
$NetBSD: patch-au,v 1.4 2009/12/29 22:03:41 spz Exp $
--- syscall.c.orig 2006-12-21 23:13:33.000000000 +0100
+++ syscall.c 2009-12-29 21:45:24.000000000 +0100
@@ -38,9 +38,9 @@
#include <signal.h>
#include <time.h>
#include <errno.h>
+#include <sys/param.h>
#include <sys/user.h>
#include <sys/syscall.h>
-#include <sys/param.h>
#if HAVE_ASM_REG_H
#if defined (SPARC) || defined (SPARC64)
@@ -56,6 +56,10 @@
#endif
#endif
+#ifdef NETBSD
+#include <machine/reg.h>
+#include <machine/psl.h>
+#endif
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#ifndef PTRACE_PEEKUSR
@@ -624,6 +628,7 @@
}
#endif
+#ifndef NETBSD
static void
decode_subcall(tcp, subcall, nsubcalls, style)
struct tcb *tcp;
@@ -709,6 +714,7 @@
#endif /* FREEBSD */
}
}
+#endif /* !NETBSD */
#endif
struct tcb *tcp_last = NULL;
@@ -747,7 +753,7 @@
#endif
if ( sys_execve == func
-#if defined(SPARC) || defined(SPARC64) || defined(SUNOS4)
+#if !defined(NETBSD) && (defined(SPARC) || defined(SPARC64) || defined(SUNOS4))
|| sys_execv == func
#endif
#if UNIXWARE > 2
@@ -756,9 +762,12 @@
)
return internal_exec(tcp);
- if ( sys_waitpid == func
- || sys_wait4 == func
-#if defined(SVR4) || defined(FREEBSD) || defined(SUNOS4)
+ if (
+ sys_wait4 == func
+#ifndef NETBSD
+ || sys_waitpid == func
+#endif
+#if defined(SVR4) || defined(ALLBSD) || defined(SUNOS4)
|| sys_wait == func
#endif
#ifdef ALPHA
@@ -811,9 +820,9 @@
static long rax;
#endif
#endif /* LINUX */
-#ifdef FREEBSD
- struct reg regs;
-#endif /* FREEBSD */
+#ifdef ALLBSD
+ static struct reg regs;
+#endif /* ALLBSD */
int
get_scno(tcp)
@@ -1283,9 +1292,9 @@
#ifdef HAVE_PR_SYSCALL
scno = tcp->status.PR_SYSCALL;
#else /* !HAVE_PR_SYSCALL */
-#ifndef FREEBSD
+#ifndef ALLBSD
scno = tcp->status.PR_WHAT;
-#else /* FREEBSD */
+#else /* ALLBSD */
if (pread(tcp->pfd_reg, &regs, sizeof(regs), 0) < 0) {
perror("pread");
return -1;
@@ -1299,8 +1308,41 @@
scno = regs.r_eax;
break;
}
-#endif /* FREEBSD */
+#endif /* ALLBSD */
#endif /* !HAVE_PR_SYSCALL */
+#else /* !USE_PROCFS */
+#ifdef NETBSD
+ if (ptrace(PTRACE_GETREGS,pid,(char *)&regs, 0) < 0) {
+ perror("GETREGS");
+ return -1;
+ }
+#ifdef __i386__
+ switch (regs.r_eax) {
+ case SYS_syscall:
+ case SYS___syscall:
+ if ((scno = ptrace(PTRACE_PEEKUSER, pid,
+ (char *)regs.r_esp + sizeof(int), sizeof(int))) == -1) {
+ perror("PEEKUSER __syscall");
+ return -1;
+ }
+ break;
+ default:
+ scno = regs.r_eax;
+ break;
+ }
+#endif
+#ifdef __x86_64__
+ switch (regs.regs[_REG_RAX]) {
+ case SYS_syscall:
+ case SYS___syscall:
+ scno = regs.regs[_REG_RDI];
+ break;
+ default:
+ scno = regs.regs[_REG_RAX];
+ break;
+ }
+#endif
+#endif /* NETBSD */
#endif /* USE_PROCFS */
if (!(tcp->flags & TCB_INSYSCALL))
tcp->scno = scno;
@@ -1325,7 +1367,9 @@
struct tcb *tcp;
{
#ifndef USE_PROCFS
+#ifndef NETBSD
int pid = tcp->pid;
+#endif
#else /* USE_PROCFS */
int scno = known_scno(tcp);
@@ -1698,17 +1742,36 @@
}
#endif /* MIPS */
#endif /* SVR4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
+#ifdef __i386__
if (regs.r_eflags & PSL_C) {
tcp->u_rval = -1;
u_error = regs.r_eax;
} else {
tcp->u_rval = regs.r_eax;
+#if 0
+ /* XXX Linux only */
tcp->u_lrval =
((unsigned long long) regs.r_edx << 32) + regs.r_eax;
+#endif
u_error = 0;
}
-#endif /* FREEBSD */
+#endif
+#ifdef __x86_64__
+ if (regs.regs[_REG_RFL] & PSL_C) {
+ tcp->u_rval = -1;
+ u_error = regs.regs[_REG_RAX];
+ } else {
+ tcp->u_rval = regs.regs[_REG_RAX];
+#if 0
+ /* XXX Linux only */
+ tcp->u_lrval =
+ ((unsigned long long) regs.regs[_REG_RDX] << 64) + regs.regs[_REG_RAX];
+#endif
+ u_error = 0;
+ }
+#endif
+#endif /* ALLBSD */
tcp->u_error = u_error;
return 1;
}
@@ -1891,6 +1954,32 @@
return -1;
}
#endif /* FREEBSD */
+#ifdef NETBSD
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0)
+ return -1;
+#ifdef __i386__
+ if (error) {
+ regs.r_eflags |= PSL_C;
+ regs.r_eax = error;
+ }
+ else {
+ regs.r_eflags &= ~PSL_C;
+ regs.r_eax = rval;
+ }
+#endif
+#ifdef __x86_64__
+ if (error) {
+ regs.regs[_REG_RFL] |= PSL_C;
+ regs.regs[_REG_RAX] = error;
+ }
+ else {
+ regs.regs[_REG_RFL] &= ~PSL_C;
+ regs.regs[_REG_RAX] = rval;
+ }
+#endif
+ if (ptrace(PTRACE_SETREGS, tcp->pid, (char *)&regs, 0) < 0)
+ return -1;
+#endif /* NETBSD */
/* All branches reach here on success (only). */
tcp->u_error = error;
@@ -1903,7 +1992,9 @@
struct tcb *tcp;
{
#ifndef USE_PROCFS
+#ifndef NETBSD
int pid = tcp->pid;
+#endif
#endif /* !USE_PROCFS */
#ifdef LINUX
#if defined(S390) || defined(S390X)
@@ -2201,6 +2292,58 @@
I DONT KNOW WHAT TO DO
#endif /* !HAVE_PR_SYSCALL */
#endif /* SVR4 */
+#ifdef NETBSD
+ if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1)
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ else
+ tcp->u_nargs = 5;
+#ifdef __i386__
+ switch(regs.r_eax) {
+ case SYS___syscall:
+ umoven(tcp, regs.r_esp + sizeof(int) + sizeof(quad_t),
+ tcp->u_nargs * sizeof(unsigned long),
+ (char *) tcp->u_arg);
+ break;
+ case SYS_syscall:
+ umoven(tcp, regs.r_esp + 2 * sizeof(int),
+ tcp->u_nargs * sizeof(unsigned long),
+ (char *) tcp->u_arg);
+ break;
+ default:
+ umoven(tcp, regs.r_esp + sizeof(int),
+ tcp->u_nargs * sizeof(unsigned long),
+ (char *) tcp->u_arg);
+ break;
+ }
+#endif
+#ifdef __x86_64__
+{
+ int bias, i;
+ static int ar[2][6] = {
+ { _REG_RDI, _REG_RSI, _REG_RDX,
+ _REG_R10, _REG_R8, _REG_R9 }, /* x86-64 ABI */
+ { _REG_RBX, _REG_RCX, _REG_RDX,
+ _REG_RSI, _REG_RDI, _REG_RBP } /* i386 ABI */
+ };
+ switch(regs.regs[_REG_RAX]) {
+ case SYS___syscall:
+ case SYS_syscall:
+ bias = 1;
+ break;
+ default:
+ bias = 0;
+ break;
+ }
+ for (i = 0; i < tcp->u_nargs; i++) {
+ tcp->u_arg[i] = regs.regs[ar[0][i + bias]];
+#if 0
+ if (upeek(tcp->pid, ar[0][i + bias] * 8, &tcp->u_arg[i]) < 0)
+ return -1;
+#endif
+ }
+}
+#endif
+#endif /* NETBSD */
#ifdef FREEBSD
if (tcp->scno >= 0 && tcp->scno < nsyscalls &&
sysent[tcp->scno].nargs > tcp->status.val)
@@ -2570,6 +2713,19 @@
pread(tcp->pfd_reg, &regs, sizeof(regs), 0);
val = regs.r_edx;
#endif
+#ifdef NETBSD
+ struct reg regs;
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, sizeof(regs)) < 0) {
+ perror("PTRACE_GETREGS get edx");
+ return -1;
+ }
+#ifdef __i386__
+ val = regs.r_edx;
+#endif
+#ifdef __x86_64__
+ val = regs.regs[_REG_RDX];
+#endif
+#endif /* NETBSD */
return val;
}
+189
View File
@@ -0,0 +1,189 @@
$NetBSD: patch-av,v 1.4 2011/09/01 13:00:49 christos Exp $
--- /dev/null 2011-09-01 15:59:46.000000000 +0300
+++ syscalls.pl 2011-09-01 15:59:28.000000000 +0300
@@ -0,0 +1,184 @@
+#!/usr/pkg/bin/perl -w
+#
+# Copyright (c) 2000, Gaël Roualland <gael.roualland@iname.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# $Id: patch-av,v 1.4 2011/09/01 13:00:49 christos Exp $
+#/
+
+# Buils syscall.h and syscallent.h from:
+# - syscalls.cat containing lines of format: syscall catmask
+# - syscalls.print containing lines of format: syscall [printfunction]
+# if no printfunction is provided, sys_<call> is used.
+# - syscalls.master in the FreeBSD kernel source tree (/usr/src/sys/kern)
+
+use strict;
+use POSIX;
+
+use vars qw(%sysprint %syscat);
+
+sub usage() {
+ print STDERR
+ "usage: $0 syscalls.master [<syscalls.print>] [<syscalls.cat>]\n";
+ exit 1;
+}
+
+sub readprint ($) {
+ my($fprint) = @_;
+
+ open (PRINT, "< $fprint") || die "can't open $fprint: $!";
+ while(<PRINT>) {
+ chomp;
+ s/^\s*//;
+ s/\s+$//;
+ s/#.*$//;
+ my($sys, $func) = split(/\s+/);
+ if (defined($sys)) {
+ if (defined($func)) {
+ $sysprint{$sys} = $func;
+ } else {
+ $sysprint{$sys} = "sys_$sys";
+ }
+ }
+ }
+ close(PRINT);
+}
+
+sub readcat ($) {
+ my($fcat) = @_;
+
+ open (CAT, "< $fcat") || die "can't open $fcat: $!";
+ while(<CAT>) {
+ chomp;
+ s/^\s*//;
+ s/\s+$//;
+ s/#.*$//;
+ my($sys, $cat) = split(/\s+/);
+ $syscat{$sys} = $cat if (defined($sys) && defined($cat));
+ }
+ close(CAT);
+}
+
+
+usage if (!defined($ARGV[0]) || defined($ARGV[3]));
+
+%sysprint = ();
+readprint $ARGV[1] if defined $ARGV[1];
+
+%syscat = ();
+readcat $ARGV[2] if defined $ARGV[2];
+
+open(MASTER, "< $ARGV[0]") || die "can't open $ARGV[0]: $!";
+
+open(SYSCALL, "> syscall.h") || die "can't create syscall.h: $!";
+
+print SYSCALL "/*\n * Automatically generated by $0 on " . ctime(time()) . " */\n\n";
+print "/*\n * Automatically generated by $0 on " . ctime(time()) . " */\n\n";
+
+my $sysnum = 0;
+
+while (<MASTER>) {
+ chomp;
+ # join broken lines
+ while (/\\$/) {
+ my $line;
+ s/\\$//;
+ $line = <MASTER>;
+ chomp($line);
+ $_ = "$_$line";
+ }
+
+ if (/^(\d+)\s+(\w+)\s+\{\s*([^}]+)\s*\}([^}]*)$/ ||
+ /^(\d+)\s+(\w+)\s+\w+\s+\{\s*([^}]+)\s*\}([^}]*)$/) {
+ my($compat, $proto, $ext, $name, $nargs, @args, $pfunc, $cat, $num);
+ my(@fun, $xproto, $oldstyle);
+ $num = $1;
+ if ($2 eq 'OBSOL' || $2 eq 'UNIMPL') {
+ $sysnum++;
+ next;
+ }
+
+ if ($3 eq "MPSAFE") {
+ $proto = $4;
+ $ext = $5;
+ } else {
+ $proto = $3;
+ $ext = $4;
+ }
+
+ if ($num > $sysnum) { # syscall gap
+ while($sysnum < $num) {
+ print " { -1,\t0,\tprintargs,\t\"SYS_$sysnum\"\t}, /* $sysnum */\n";
+ $sysnum++;
+ }
+ } elsif ($num < $sysnum) {
+ next if ($num == $sysnum - 1); # perhaps #ifdef
+ warn "error in master file: syscall $num found, expecting $sysnum.";
+ next;
+ }
+
+ # int|sys||name(args);
+ @fun = split(/\|/, $proto);
+ $oldstyle = @fun;
+ if ($oldstyle == 1) {
+ $xproto = $proto;
+ } else {
+ $xproto = $fun[3];
+ }
+
+ if (($oldstyle == 1 && $xproto =~ /^[^\s]+\s+([^\s]+)\s*\(([^)]*)\);/)
+ || ($oldstyle != 1 && $xproto =~ /^(\w+)\(([^)]*)\); /)) {
+ my @args = split(/,/, $2);
+ $nargs = @args;
+ $name = $1;
+ if ($oldstyle == 1) {
+ $name = substr($name, 1) if (substr($name, 0, 1) eq "*");
+ $name = substr($name, 4);
+ } else {
+ $name = "__" . $name . $fun[2] if ($fun[2] ne "");
+ }
+ if (defined($sysprint{$name})) {
+ $pfunc = $sysprint{$name};
+ print SYSCALL "int $pfunc();\n";
+ } else {
+ $pfunc = "sys_$name";
+ print SYSCALL "#define $pfunc printargs\n";
+ }
+ if (defined($syscat{$name})) {
+ $cat = $syscat{$name};
+ } else {
+ $cat = "0";
+ }
+ print " { $nargs,\t$cat,\t$pfunc,\t\"$name\"\t}, /* $sysnum */\n";
+ $sysnum++;
+ } else {
+ warn "bad syscall specification for $sysnum: >$xproto<";
+ }
+ } else {
+ # warn "unregognized line $_";
+ }
+}
+close(MASTER);
+exit 0;
+202
View File
@@ -0,0 +1,202 @@
$NetBSD: patch-aw,v 1.1 2007/04/27 19:45:02 christos Exp $
--- /dev/null 2007-04-26 23:20:40.000000000 -0400
+++ netbsd/syscalls.print 2007-04-27 14:39:29.000000000 -0400
@@ -0,0 +1,197 @@
+#
+# Copyright (c) 2000, Gaël Roualland <gael.roualland@iname.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# $Id: patch-aw,v 1.1 2007/04/27 19:45:02 christos Exp $
+#
+# Printable syscalls
+# syntax: syscall [printfunc]
+#
+# mostly built from sys_* functions in source code
+
+__getcwd
+__sysctl
+accept
+access
+adjtime
+alarm
+bind
+brk
+capget
+capset
+chdir
+chflags
+chmod
+chown
+chroot
+close
+connect
+creat
+dup
+dup2
+errlist
+execv
+execve
+exit
+fchdir
+fchflags
+fchmod
+fchown
+fchroot
+fcntl
+flock
+fork
+fpathconf
+fstat
+fstatfs
+fsync
+ftruncate
+getdents
+getdirentries
+getdomainname
+getdtablesize
+getgid
+getgroups
+gethostid
+gethostname
+getitimer
+getpagesize
+getpeername
+getpgid
+getpgrp
+getpid
+getpriority
+getrlimit
+getrusage
+getsid
+getsockname
+getsockopt
+gettimeofday
+getuid
+indir
+ioctl
+kill
+killpg
+link
+listen
+lseek
+lstat
+mincore
+mkdir
+mkfifo
+mknod
+mmap
+mprotect
+msgctl
+msgget
+msgrcv
+msgsnd
+msync
+munmap
+nerr
+nice
+open
+pathconf
+pipe
+poll
+pread
+ptrace
+pwrite
+quotactl
+read
+readlink
+readv
+recv
+recvfrom
+recvmsg
+rename
+rmdir
+sbrk
+select
+semctl
+semget
+semop
+send
+sendfile
+sendmsg
+sendto
+setdomainname
+setgroups
+sethostname
+setitimer
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setsid
+setsockopt
+settimeofday
+shmat
+shmctl
+shmdt
+shmget
+shutdown
+sigaction
+sigaltstack
+sigblock
+sigcleanup
+signal
+sigpause
+sigpending
+sigprocmask
+sigsetmask
+sigsuspend
+socket
+socketpair
+stat
+statfs
+stime
+symlink
+sysctl
+time
+times
+truncate
+umask
+uname
+unlink
+utime
+utimes
+vfork
+wait
+wait4
+waitpid
+write
+writev
+__fstat30 sys_fstat
+__stat30 sys_stat
+__lstat30 sys_lstat
+statvfs1 sys_statfs
+fstatvfs1 sys_fstatfs
+__getdents30 sys_getdents
+__sigaction_sigtramp sys_sigaction
+180
View File
@@ -0,0 +1,180 @@
$NetBSD: patch-ax,v 1.1 2007/04/27 19:45:02 christos Exp $
--- /dev/null 2007-04-26 23:20:40.000000000 -0400
+++ netbsd/syscalls.cat 2007-04-26 15:06:52.000000000 -0400
@@ -0,0 +1,175 @@
+#
+# Copyright (c) 2000, Gaël Roualland <gael.roualland@iname.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# $Id: patch-ax,v 1.1 2007/04/27 19:45:02 christos Exp $
+#
+# Syscalls categories
+# syntax: syscall catmask
+#
+# mostly built from other archs/os syscallent.h
+
+# file calls
+access TF
+acct TF
+acl TF
+chdir TF
+chmod TF
+chown TF
+chroot TF
+creat TF
+close TF
+chflags TF
+fstat64 TF
+fstat TF
+fchdir TF
+fchflags TF
+lchown TF
+link TF
+lstat TF
+lstat64 TF
+lxstat TF
+mkdir TF
+mknod TF
+mount TF
+oldlstat TF
+oldstat TF
+oldumount TF
+open TF
+outime TF
+pathconf TF
+pread TF
+pwrite TF
+readlink TF
+rename TF
+rmdir TF
+sendfile TF
+stat TF
+stat64 TF
+statfs TF
+statvfs TF
+swapon TF
+symlink TF
+truncate TF
+umount TF
+unlink TF
+unmount TF
+uselib TF
+utime TF
+utimes TF
+xmknod TF
+xstat TF
+
+# file/process calls
+exec TF|TP
+execv TF|TP
+execve TF|TP
+
+# IPC calls
+msgctl TI
+msgget TI
+msgrcv TI
+msgsnd TI
+msgsys TI
+semctl TI
+semget TI
+semop TI
+semsys TI
+shmat TI
+shmctl TI
+shmdt TI
+shmget TI
+shmsys TI
+
+# network calls
+accept TN
+bind TN
+connect TN
+getmsg TN
+getpeername TN
+getpmsg TN
+getsockname TN
+getsockopt TN
+listen TN
+poll TN
+putmsg TN
+putpmsg TN
+recv TN
+recvfrom TN
+recvmsg TN
+send TN
+sendmsg TN
+sendto TN
+setsockopt TN
+shutdown TN
+socket TN
+socketpair TN
+
+# process calls
+_exit TP
+clone TP
+fork TP
+fork1 TP
+owait TP
+owait3 TP
+vfork TP
+wait TP
+wait4 TP
+waitid TP
+waitpid TP
+waitsys TP
+
+# signal calls
+kill TS
+killpg TS
+ksigqueue TS
+pause TS
+rt_sigaction TS
+rt_sigpending TS
+rt_sigprocmask TS
+rt_sigqueueinfo TS
+rt_sigreturn TS
+rt_sigsuspend TS
+rt_sigtimedwait TS
+sigaction TS
+sigaltstack TS
+sigblock TS
+sigcleanup TS
+sigfillset TS
+siggetmask TS
+sighold TS
+sigignore TS
+signal TS
+sigpause TS
+sigpending TS
+sigpoll TS
+sigprocmask TS
+sigrelse TS
+sigreturn TS
+sigsendset TS
+sigset TS
+sigsetmask TS
+sigsuspend TS
+sigtimedwait TS
+51
View File
@@ -0,0 +1,51 @@
$NetBSD: patch-ay,v 1.2 2007/04/28 03:42:31 christos Exp $
--- system.c.orig 2006-01-12 16:21:06.000000000 -0500
+++ system.c 2007-04-27 19:00:30.000000000 -0400
@@ -568,7 +568,7 @@
#endif /* SUNOS4 */
-#if defined(SUNOS4) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(ALLBSD)
static const struct xlat pathconflimits[] = {
#ifdef _PC_LINK_MAX
{ _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
@@ -624,7 +624,7 @@
return 0;
}
-#endif /* SUNOS4 || FREEBSD */
+#endif /* SUNOS4 || ALLBSD */
#ifdef SVR4
@@ -1976,7 +1976,8 @@
}
#endif
-#ifdef FREEBSD
+#ifdef ALLBSD
+#include <sys/param.h>
#include <sys/sysctl.h>
int sys___sysctl(tcp)
@@ -1985,7 +1986,8 @@
int qoid[CTL_MAXNAME+2];
char ctl[1024];
size_t len;
- int i, numeric;
+ size_t i;
+ int numeric;
if (entering(tcp)) {
if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME ||
@@ -2016,7 +2018,7 @@
} else {
if (!syserror(tcp) && (umove(tcp, tcp->u_arg[3], &len) >= 0)) {
printstr(tcp, tcp->u_arg[2], len);
- tprintf(", [%u], ", len);
+ tprintf(", [%zu], ", (size_t)len);
} else
tprintf("%#lx, %#lx, ", tcp->u_arg[2], tcp->u_arg[3]);
printstr(tcp, tcp->u_arg[4], tcp->u_arg[5]);
+31
View File
@@ -0,0 +1,31 @@
$NetBSD: patch-az,v 1.1 2007/04/27 19:45:03 christos Exp $
--- term.c.orig 2005-06-01 15:02:38.000000000 -0400
+++ term.c 2007-04-27 11:31:51.000000000 -0400
@@ -184,7 +184,7 @@
long code, arg;
{
struct termios tios;
-#ifndef FREEBSD
+#ifndef ALLBSD
struct termio tio;
#else
#define TCGETS TIOCGETA
@@ -216,7 +216,7 @@
return 0;
if (abbrev(tcp)) {
tprintf(", {");
-#ifndef FREEBSD
+#ifndef ALLBSD
printxval(baud_options, tios.c_cflag & CBAUD, "B???");
#else
printxval(baud_options, tios.c_ispeed, "B???");
@@ -237,7 +237,7 @@
(long) tios.c_iflag, (long) tios.c_oflag);
tprintf("c_cflags=%#lx, c_lflags=%#lx, ",
(long) tios.c_cflag, (long) tios.c_lflag);
-#if !defined(SVR4) && !defined(FREEBSD)
+#if !defined(SVR4) && !defined(ALLBSD)
tprintf("c_line=%u, ", tios.c_line);
#endif
if (!(tios.c_lflag & ICANON))
+69
View File
@@ -0,0 +1,69 @@
$NetBSD: patch-ba,v 1.1 2007/04/27 19:45:03 christos Exp $
--- util.c.orig 2005-10-21 18:06:46.000000000 -0400
+++ util.c 2007-04-27 11:31:51.000000000 -0400
@@ -36,9 +36,9 @@
#include "defs.h"
#include <signal.h>
+#include <sys/param.h>
#include <sys/syscall.h>
#include <sys/user.h>
-#include <sys/param.h>
#include <fcntl.h>
#if HAVE_SYS_UIO_H
#include <sys/uio.h>
@@ -58,6 +58,9 @@
# include <asm/rse.h>
#endif
+#ifdef NETBSD
+#include <machine/reg.h>
+#endif
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
# define PTRACE_PEEKUSR PTRACE_PEEKUSER
@@ -96,6 +99,7 @@
# define PTRACE_SETREGS PTRACE_SETREGS64
#endif /* SPARC64 */
+
#if !defined(__GLIBC__)
#include <linux/unistd.h>
@@ -759,6 +763,20 @@
return -1;
#endif /* USE_PROCFS */
+#ifdef NETBSD
+ struct ptrace_io_desc piod;
+
+ piod.piod_op = PIOD_READ_D;
+ piod.piod_offs = (void *)addr;
+ piod.piod_addr = laddr;
+ piod.piod_len = len;
+
+ if (ptrace(PT_IO, tcp->pid, (char *)&piod, sizeof(piod)) < 0) {
+ perror("PT_IO");
+ return -1;
+ }
+#endif
+
return 0;
}
@@ -1079,6 +1097,14 @@
pread(tcp->pfd_reg, &regs, sizeof(regs), 0);
return regs.r_eip;
#endif /* FREEBSD */
+#ifdef NETBSD
+ struct reg regs;
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *) &regs, 0) < 0) {
+ perror("getpc: ptrace(PTRACE_GETREGS, ...)");
+ return -1;
+ }
+ return regs.r_eip;
+#endif /* NETBSD */
}
#endif
+61
View File
@@ -0,0 +1,61 @@
$NetBSD: patch-bb,v 1.2 2007/12/05 16:31:01 christos Exp $
--- io.c.orig 2006-12-13 14:57:23.000000000 -0500
+++ io.c 2007-12-05 11:17:44.000000000 -0500
@@ -74,6 +74,47 @@
return 0;
}
+#ifdef NETBSD
+int
+sys_pread(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %lu", tcp->u_arg[2]);
+#ifdef _LP64
+ tprintf(", %lu", tcp->u_arg[3]);
+#else
+ tprintf(", %llu", ((unsigned long long)tcp->u_arg[4] << 32)
+ | tcp->u_arg[5]);
+#endif
+ }
+ return 0;
+}
+
+int
+sys_pwrite(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu", tcp->u_arg[2]);
+#ifdef _LP64
+ tprintf(", %lu", tcp->u_arg[3]);
+#else
+ tprintf(", %llu", ((unsigned long long)tcp->u_arg[4] << 32)
+ | tcp->u_arg[5]);
+#endif
+ }
+ return 0;
+}
+#endif
#if HAVE_SYS_UIO_H
void
tprint_iov(tcp, len, addr)
@@ -347,7 +388,7 @@
#endif /* LINUX */
-#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
+#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T && !defined(NETBSD)
int
sys_pread64(tcp)
struct tcb *tcp;
+42
View File
@@ -0,0 +1,42 @@
$NetBSD: patch-bc,v 1.3 2011/09/03 14:44:03 christos Exp $
--- quota.c.orig 2006-10-16 03:30:53.000000000 +0300
+++ quota.c 2011-08-30 12:49:51.000000000 +0300
@@ -687,14 +687,20 @@
#endif /* Linux */
-#if defined(SUNOS4) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(ALLBSD)
#ifdef SUNOS4
#include <ufs/quota.h>
#endif
-#ifdef FREEBSD
+#ifdef ALLBSD
#include <ufs/ufs/quota.h>
+#ifdef __NetBSD__
+#include <sys/param.h>
+#if __NetBSD_Version__ >= 599004700
+#include <ufs/ufs/quota1.h>
+#endif
+#endif
#endif
static const struct xlat quotacmds[] = {
@@ -723,7 +726,7 @@
tprintf(", ");
printstr(tcp, tcp->u_arg[1], -1);
#endif
-#ifdef FREEBSD
+#ifdef ALLBSD
printpath(tcp, tcp->u_arg[0]);
tprintf(", ");
printxval(quotacmds, tcp->u_arg[1], "Q_???");
@@ -733,4 +736,4 @@
return 0;
}
-#endif /* SUNOS4 || FREEBSD */
+#endif /* SUNOS4 || ALLBSD */
+21
View File
@@ -0,0 +1,21 @@
$NetBSD: patch-bd,v 1.1 2007/12/05 16:31:02 christos Exp $
--- desc.c.orig 2007-12-05 11:23:22.000000000 -0500
+++ desc.c 2007-12-05 11:23:34.000000000 -0500
@@ -425,14 +425,14 @@
return 0;
}
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4)
+#if defined(ALPHA) || defined(ALLBSD) || defined(SUNOS4)
int
sys_getdtablesize(tcp)
struct tcb *tcp;
{
return 0;
}
-#endif /* ALPHA || FREEBSD || SUNOS4 */
+#endif /* ALPHA || ALLBSD || SUNOS4 */
static int
decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
+40
View File
@@ -0,0 +1,40 @@
$NetBSD: patch-be,v 1.1 2007/12/05 16:31:02 christos Exp $
--- mem.c.orig 2007-12-05 11:20:07.000000000 -0500
+++ mem.c 2007-12-05 11:20:17.000000000 -0500
@@ -70,7 +70,7 @@
#endif
}
-#if defined(FREEBSD) || defined(SUNOS4)
+#if defined(ALLBSD) || defined(SUNOS4)
int
sys_sbrk(tcp)
struct tcb *tcp;
@@ -80,7 +80,7 @@
}
return RVAL_HEX;
}
-#endif /* FREEBSD || SUNOS4 */
+#endif /* ALLBSD || SUNOS4 */
static const struct xlat mmap_prot[] = {
{ PROT_NONE, "PROT_NONE", },
@@ -541,7 +541,7 @@
return 0;
}
-#if defined(ALPHA) || defined(FREEBSD) || defined(IA64) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA) || defined(ALLBSD) || defined(IA64) || defined(SUNOS4) || defined(SVR4)
int
sys_getpagesize(tcp)
struct tcb *tcp;
@@ -550,7 +550,7 @@
return RVAL_HEX;
return 0;
}
-#endif /* ALPHA || FREEBSD || IA64 || SUNOS4 || SVR4 */
+#endif /* ALPHA || ALLBSD || IA64 || SUNOS4 || SVR4 */
#if defined(LINUX) && defined(__i386__)
void