summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorscottr <scottr@pkgsrc.org>2008-08-31 06:36:47 +0000
committerscottr <scottr@pkgsrc.org>2008-08-31 06:36:47 +0000
commit8e053ee7cbe7ca88f5f7497012c7b5e067fdb341 (patch)
treead70d02044d266efd42987cd467f72e230ab63dc /sysutils
parentdb126d9af2e923010a3c1d14227f5350fe7c703c (diff)
downloadpkgsrc-8e053ee7cbe7ca88f5f7497012c7b5e067fdb341.tar.gz
Update to version 2008.08.08-109361. This release provides the following
enhancements: - Simple command-line tools to interface with VMware host - Guest OS scripts that can be triggered by the VMware host - Startup script When compiled with X11 support (the default), this release also provides: - GTK+-based GUI to configure time sync, device connections, and scripts - Helper application to interface with the xf86-video-vmware driver, enabling dynamic screen resize
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/open-vm-tools/Makefile41
-rw-r--r--sysutils/open-vm-tools/PLIST3
-rw-r--r--sysutils/open-vm-tools/PLIST.common13
-rw-r--r--sysutils/open-vm-tools/PLIST.common_end2
-rw-r--r--sysutils/open-vm-tools/PLIST.x115
-rw-r--r--sysutils/open-vm-tools/distinfo86
-rwxr-xr-xsysutils/open-vm-tools/files/vmtools.sh18
-rw-r--r--sysutils/open-vm-tools/options.mk18
-rw-r--r--sysutils/open-vm-tools/patches/patch-aa18
-rw-r--r--sysutils/open-vm-tools/patches/patch-ab56
-rw-r--r--sysutils/open-vm-tools/patches/patch-ac34
-rw-r--r--sysutils/open-vm-tools/patches/patch-ad20
-rw-r--r--sysutils/open-vm-tools/patches/patch-ae59
-rw-r--r--sysutils/open-vm-tools/patches/patch-af31
-rw-r--r--sysutils/open-vm-tools/patches/patch-ag67
-rw-r--r--sysutils/open-vm-tools/patches/patch-ah61
-rw-r--r--sysutils/open-vm-tools/patches/patch-ai47
-rw-r--r--sysutils/open-vm-tools/patches/patch-aj119
-rw-r--r--sysutils/open-vm-tools/patches/patch-ak68
-rw-r--r--sysutils/open-vm-tools/patches/patch-al29
-rw-r--r--sysutils/open-vm-tools/patches/patch-am72
-rw-r--r--sysutils/open-vm-tools/patches/patch-an86
-rw-r--r--sysutils/open-vm-tools/patches/patch-ao43
-rw-r--r--sysutils/open-vm-tools/patches/patch-ap23
-rw-r--r--sysutils/open-vm-tools/patches/patch-aq37
-rw-r--r--sysutils/open-vm-tools/patches/patch-ar47
-rw-r--r--sysutils/open-vm-tools/patches/patch-as113
-rw-r--r--sysutils/open-vm-tools/patches/patch-at73
-rw-r--r--sysutils/open-vm-tools/patches/patch-au46
-rw-r--r--sysutils/open-vm-tools/patches/patch-av31
-rw-r--r--sysutils/open-vm-tools/patches/patch-aw38
-rw-r--r--sysutils/open-vm-tools/patches/patch-ax143
-rw-r--r--sysutils/open-vm-tools/patches/patch-ay60
-rw-r--r--sysutils/open-vm-tools/patches/patch-az10
-rw-r--r--sysutils/open-vm-tools/patches/patch-ba31
-rw-r--r--sysutils/open-vm-tools/patches/patch-bb73
-rw-r--r--sysutils/open-vm-tools/patches/patch-bc99
-rw-r--r--sysutils/open-vm-tools/patches/patch-bd22
-rw-r--r--sysutils/open-vm-tools/patches/patch-be40
-rw-r--r--sysutils/open-vm-tools/patches/patch-bf31
-rw-r--r--sysutils/open-vm-tools/patches/patch-bg24
-rw-r--r--sysutils/open-vm-tools/patches/patch-bh31
-rw-r--r--sysutils/open-vm-tools/patches/patch-bi13
-rw-r--r--sysutils/open-vm-tools/patches/patch-bj38
-rw-r--r--sysutils/open-vm-tools/patches/patch-bk31
-rw-r--r--sysutils/open-vm-tools/patches/patch-bl67
-rw-r--r--sysutils/open-vm-tools/patches/patch-bm72
-rw-r--r--sysutils/open-vm-tools/patches/patch-bn37
-rw-r--r--sysutils/open-vm-tools/patches/patch-bo37
-rw-r--r--sysutils/open-vm-tools/patches/patch-bp40
-rw-r--r--sysutils/open-vm-tools/patches/patch-bq42
-rw-r--r--sysutils/open-vm-tools/patches/patch-br16
-rw-r--r--sysutils/open-vm-tools/patches/patch-bs13
-rw-r--r--sysutils/open-vm-tools/patches/patch-bt13
-rw-r--r--sysutils/open-vm-tools/patches/patch-bu145
-rw-r--r--sysutils/open-vm-tools/patches/patch-bv13
-rw-r--r--sysutils/open-vm-tools/patches/patch-bw13
57 files changed, 1673 insertions, 885 deletions
diff --git a/sysutils/open-vm-tools/Makefile b/sysutils/open-vm-tools/Makefile
index 68fa2bd8bb4..6e3330b4534 100644
--- a/sysutils/open-vm-tools/Makefile
+++ b/sysutils/open-vm-tools/Makefile
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2008/01/18 05:09:45 tnn Exp $
+# $NetBSD: Makefile,v 1.6 2008/08/31 06:36:47 scottr Exp $
-DISTNAME= open-vm-tools-2007.09.04-56574
-PKGNAME= open-vm-tools-2007.09.04.56574
-PKGREVISION= 1
+DISTNAME= open-vm-tools-2008.08.08-109361
+PKGNAME= open-vm-tools-2008.08.08.109361
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=open-vm-tools/}
@@ -16,16 +15,34 @@ GNU_CONFIGURE= yes
USE_LANGUAGES+= c c++
USE_LIBTOOL= yes
USE_TOOLS+= pkg-config
+USE_DIRS+= xdg-1.4
-post-install:
- ${INSTALL_PROGRAM_DIR} ${PREFIX}/sbin
- ${INSTALL_PROGRAM} ${WRKSRC}/guestd/guestd ${PREFIX}/sbin/vmware-guestd
+PLIST_SRC= PLIST.common
+CONFIGURE_ARGS+= --disable-unity
+
+INSTALLATION_DIRS+= ${PKG_SYSCONFDIR} share/examples/vmware-tools
+
+PKG_SYSCONFSUBDIR= vmware-tools
+EGDIR= ${PREFIX}/share/examples/vmware-tools
+CONF_FILES_PERMS+= ${EGDIR}/poweroff-vm-default ${PKG_SYSCONFDIR}/poweroff-vm-default ${ROOT_USER} ${ROOT_GROUP} 755
+CONF_FILES_PERMS+= ${EGDIR}/poweron-vm-default ${PKG_SYSCONFDIR}/poweron-vm-default ${ROOT_USER} ${ROOT_GROUP} 755
+CONF_FILES_PERMS+= ${EGDIR}/resume-vm-default ${PKG_SYSCONFDIR}/resume-vm-default ${ROOT_USER} ${ROOT_GROUP} 755
+CONF_FILES_PERMS+= ${EGDIR}/suspend-vm-default ${PKG_SYSCONFDIR}/suspend-vm-default ${ROOT_USER} ${ROOT_GROUP} 755
+CONF_FILES_PERMS+= ${EGDIR}/tools.conf ${PKG_SYSCONFDIR}/tools.conf ${ROOT_USER} ${ROOT_GROUP} 755
+RCD_SCRIPTS= vmtools
+
+SUBST_CLASSES+= fix-paths
+SUBST_STAGE.fix-paths= pre-configure
+SUBST_MESSAGE.fix-paths= Fixing absolute paths.
+SUBST_FILES.fix-paths= scripts/Makefile.in
+SUBST_SED.fix-paths= -e 's|/etc/vmware-tools|${EGDIR}|g'
+SUBST_SED.fix-paths+= -e '/^conf_SCRIPTS/s|./common/vm-support ||'
+
+.include "../../net/libdnet/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
-.include "../../x11/gtk2/buildlink3.mk"
-.include "../../x11/libXinerama/buildlink3.mk"
-.include "../../x11/libXrandr/buildlink3.mk"
-.include "../../x11/libXrender/buildlink3.mk"
-.include "../../x11/libXtst/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+
+.include "options.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/open-vm-tools/PLIST b/sysutils/open-vm-tools/PLIST
deleted file mode 100644
index e9a91ed449b..00000000000
--- a/sysutils/open-vm-tools/PLIST
+++ /dev/null
@@ -1,3 +0,0 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
-lib/libguestlib.la
-sbin/vmware-guestd
diff --git a/sysutils/open-vm-tools/PLIST.common b/sysutils/open-vm-tools/PLIST.common
new file mode 100644
index 00000000000..cd9af3ea4bc
--- /dev/null
+++ b/sysutils/open-vm-tools/PLIST.common
@@ -0,0 +1,13 @@
+@comment $NetBSD: PLIST.common,v 1.1 2008/08/31 06:36:47 scottr Exp $
+bin/vmware-checkvm
+bin/vmware-hgfsclient
+bin/vmware-toolbox-cmd
+bin/vmware-xferlogs
+lib/libguestlib.la
+sbin/vmware-guestd
+share/examples/rc.d/vmtools
+share/examples/vmware-tools/poweroff-vm-default
+share/examples/vmware-tools/poweron-vm-default
+share/examples/vmware-tools/resume-vm-default
+share/examples/vmware-tools/suspend-vm-default
+share/examples/vmware-tools/tools.conf
diff --git a/sysutils/open-vm-tools/PLIST.common_end b/sysutils/open-vm-tools/PLIST.common_end
new file mode 100644
index 00000000000..3a1a35eabb1
--- /dev/null
+++ b/sysutils/open-vm-tools/PLIST.common_end
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.common_end,v 1.1 2008/08/31 06:36:47 scottr Exp $
+@dirrm share/examples/vmware-tools
diff --git a/sysutils/open-vm-tools/PLIST.x11 b/sysutils/open-vm-tools/PLIST.x11
new file mode 100644
index 00000000000..2e235b5d120
--- /dev/null
+++ b/sysutils/open-vm-tools/PLIST.x11
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST.x11,v 1.1 2008/08/31 06:36:47 scottr Exp $
+bin/vmware-toolbox
+bin/vmware-user
+bin/vmware-user-suid-wrapper
+share/applications/vmware-user.desktop
diff --git a/sysutils/open-vm-tools/distinfo b/sysutils/open-vm-tools/distinfo
index 194c11062b4..d64b849c843 100644
--- a/sysutils/open-vm-tools/distinfo
+++ b/sysutils/open-vm-tools/distinfo
@@ -1,34 +1,54 @@
-$NetBSD: distinfo,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: distinfo,v 1.2 2008/08/31 06:36:47 scottr Exp $
-SHA1 (open-vm-tools-2007.09.04-56574.tar.gz) = d3ffcd974e67b5f83b760582f8c2606721d94403
-RMD160 (open-vm-tools-2007.09.04-56574.tar.gz) = 8bb9952471ff5635e70741afd357170b6c0a8307
-Size (open-vm-tools-2007.09.04-56574.tar.gz) = 1987725 bytes
-SHA1 (patch-aa) = 18b8fdb983268f3f8d584cb87df22f704bd871ea
-SHA1 (patch-ab) = 06e20655385abe4882ee5b1f0743194c9d4ad89e
-SHA1 (patch-ac) = 9b41a45492069a955487ebec74aeab8fe81f2389
-SHA1 (patch-ad) = 88343d37ef042d3b7755d3c61246aa499fd33d75
-SHA1 (patch-ae) = 5935f63467af70ef0f139ff0a640a67976cca3b1
-SHA1 (patch-af) = b8255d69d143f2a0274162ac8d9c869e5c3ecfb9
-SHA1 (patch-ag) = 4f589d6ca71c7222f841cc02d01398d2ca7f796c
-SHA1 (patch-ah) = 311d8e44fc98f61653c39e7595b3c588441b6414
-SHA1 (patch-ai) = 0441e29f7b286142f0a98ede57e2a0b9bee6a4fd
-SHA1 (patch-aj) = 441a6774359864afa85e73b4375198d67c5f81f3
-SHA1 (patch-ak) = df29cec4aa4bbe0aef485a544865dc9c033d99fd
-SHA1 (patch-al) = 89d9f42aa123f5bb3f6c9b2b5cdf080a06b06d3b
-SHA1 (patch-am) = f62d4a9b0acb6e527a4912ee86ed47ee948d06ea
-SHA1 (patch-an) = 60b92ad15dfcf251dbe9e6859693efdef3b668c2
-SHA1 (patch-ao) = 0447c1de5251c8e946025604d7ce0b577bda3962
-SHA1 (patch-ap) = 4a76ce695183be059442cc731f2b04bf122ac59c
-SHA1 (patch-aq) = a95a41e051f9b3fe5ef0b32df3660b914da37f6d
-SHA1 (patch-ar) = 45a84a45e137d02fa16e100f8dd82d8d4f249e02
-SHA1 (patch-as) = 23818461de9c6a9803e674a0ccf8544c8ac2cfb7
-SHA1 (patch-at) = 03dcfb95ec6159e3445405a3a2fb467898d94b3b
-SHA1 (patch-au) = 776c001223ecd043fa4a8fc61d5c8bd1c5b4ef4d
-SHA1 (patch-av) = 02f5d5d9e91d6aacf79168bc751396b217789125
-SHA1 (patch-aw) = 8f84b0cf9728ccd3bbb1c547d61956d8c9664a88
-SHA1 (patch-ax) = 7d7eebdf405ea4b5aac10986133f66f9f89d3893
-SHA1 (patch-ay) = 5bdfd3b2ba1681a6e11b43e0f19965e3eef7ed01
-SHA1 (patch-az) = 430c96756a27712d0731a9561266ba45da56937e
-SHA1 (patch-ba) = 01c5aa4b52a80c1a5159c49fcf40d4081f3a1ede
-SHA1 (patch-bb) = cb40fa71de36265afc872be009fdd0c189404c23
-SHA1 (patch-bc) = f4876b2eeb10362b7d0fa2062cf899d398db28ab
+SHA1 (open-vm-tools-2008.08.08-109361.tar.gz) = 1c44c3524cd9cbc5870f1c6065b03a6b31859a25
+RMD160 (open-vm-tools-2008.08.08-109361.tar.gz) = 4ea0a6aa2edda2bc404c865dc5b58f3a177ae411
+Size (open-vm-tools-2008.08.08-109361.tar.gz) = 2971141 bytes
+SHA1 (patch-aa) = 2905e5340f371a5585ce867b29c7d65632a2ee68
+SHA1 (patch-ab) = 66ab38809e1ab7b1b0dfd51b88d93a8f0faa2fad
+SHA1 (patch-ac) = bb3bd4900d7fe64cb2bf79c3680a0dfac753bc95
+SHA1 (patch-ad) = dbb64d3c063f9bf89483dd1d3c945d4502cefc2d
+SHA1 (patch-ae) = 785a5d5d27ce6f8281caa56a27f90a3b200ac082
+SHA1 (patch-af) = 7ead621ec1b8987e64ceaa73909c74927e50330f
+SHA1 (patch-ag) = 6d5d462934942ec8b7439e2e51d179e627833111
+SHA1 (patch-ah) = 18577d28bea81a036495d3f86b4713b8a1003fdc
+SHA1 (patch-ai) = 59cdf9ae813aa9ac0cf5920e19cbfd23b720b50b
+SHA1 (patch-aj) = ee2e2bfc5f976d00fb4a830184e37427852a90d3
+SHA1 (patch-ak) = d27cd0cbbf2db45a07a8bf4a006ad5e28feb8b3a
+SHA1 (patch-al) = 0342d300f6c27a3a523f80f06d087c60c68b9a53
+SHA1 (patch-am) = a4d678ad7e163de381a547cad1c24bca08c72a73
+SHA1 (patch-an) = 10153f5ce56ca226fcb773f0e707fc3a1a51a902
+SHA1 (patch-ao) = 5d6457e994f559fd826811644d2e77f46ce10d1e
+SHA1 (patch-ap) = ca1a6efeaa90cf6e759e2d27ff3b2da8ffef63d0
+SHA1 (patch-aq) = 18a3072f2c307ed35e5c2356e5656c0ce5f19dc0
+SHA1 (patch-ar) = aa98d78890c9fb46c18f727ba3609ad562c01480
+SHA1 (patch-as) = 45e3957d07227c8fb1741fcf6b15c982e9b52bfd
+SHA1 (patch-at) = 659b97c50168fa74f3e6a8ffe2bafae0420f0d49
+SHA1 (patch-au) = 31eeee4521020952ef51b29351802efd9fe4297f
+SHA1 (patch-av) = b61f165fd9a6e5241795e2e69aa73caba32539a8
+SHA1 (patch-aw) = 82788d7ab312ee07abf3e159028b440d41912a14
+SHA1 (patch-ax) = c2ecb902dc8d8bcbe833f7b8841d4697f8f33d60
+SHA1 (patch-ay) = c9c7a7f9871fdc3213bafce05a7433db862ac4a4
+SHA1 (patch-az) = 2a8494c8cbfb0270a5fdd46e0c5ccaf19fc5f94f
+SHA1 (patch-ba) = cb0433af4a7c5c9a9010edbc15998577c44c92ae
+SHA1 (patch-bb) = 2dc1b2281eff27965fc83ca20e9c026287227287
+SHA1 (patch-bc) = d806bf75979d870db8616fa212e3f619d4508249
+SHA1 (patch-bd) = 0af45ab34089ea1d47b15f9dc3ddec129ab98b1a
+SHA1 (patch-be) = 29d8fd6b32d622b4ed03efecb4aeb2a35a7c254b
+SHA1 (patch-bf) = c14f4c641f6f1536d8ae7cd20995506bb59470b4
+SHA1 (patch-bg) = e129e88832690763e4b34cc59c614cf31e79802a
+SHA1 (patch-bh) = 723d8bc1a2064572e7ff4768c137830fbb6773d6
+SHA1 (patch-bi) = d3749e561947e32b5de2af3acb3ff7c26a47ccb4
+SHA1 (patch-bj) = b3c6961c4e8ec54ed2a1c608a8d04e0d38c4176c
+SHA1 (patch-bk) = 48d44394dc31d50dc1ffebfac10c813a18a8f094
+SHA1 (patch-bl) = 651f31b2c1d056e5090b893d1db7badfdb592561
+SHA1 (patch-bm) = 4a0235a64263b1f56a357fe5106a40269a2a11e1
+SHA1 (patch-bn) = 12e1bbd0aea73a2df4fd36e7a8ad8006327404ea
+SHA1 (patch-bo) = 7480a6016308049eef86aeec8103ccf12733133c
+SHA1 (patch-bp) = c577501c0c00dcb8d4b6b8aec8347879aabc0330
+SHA1 (patch-bq) = 121e5db459e1e0f5f5dbaa5e0e3a40e7bc8a74a7
+SHA1 (patch-br) = 7c14091b3f7a7e75e0d7db654cff1e0476e36888
+SHA1 (patch-bs) = 4b2a334ed4611c87b90f2e092cffb88aae058928
+SHA1 (patch-bt) = 34c85d8d994c33fb4e18f76bb8b6baa41098f23e
+SHA1 (patch-bu) = 9e2533d967cfb1cdc780516359ab8e7c373b70f5
+SHA1 (patch-bv) = c15eadcf4968703c9bf4c16d368f7f7b5b39b046
+SHA1 (patch-bw) = 002f3a78a5d0f52d1e1a2cd62f6ad8136f531939
diff --git a/sysutils/open-vm-tools/files/vmtools.sh b/sysutils/open-vm-tools/files/vmtools.sh
new file mode 100755
index 00000000000..d1c6bee33ea
--- /dev/null
+++ b/sysutils/open-vm-tools/files/vmtools.sh
@@ -0,0 +1,18 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: vmtools.sh,v 1.1 2008/08/31 06:36:47 scottr Exp $
+#
+
+# PROVIDE: vmtools
+# REQUIRE: DAEMON
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="vmtools"
+rcvar="vmtools"
+pidfile="/var/run/vmware-guestd.pid"
+command="@PREFIX@/sbin/vmware-guestd"
+command_args="--background ${pidfile}"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/sysutils/open-vm-tools/options.mk b/sysutils/open-vm-tools/options.mk
new file mode 100644
index 00000000000..d60af1d70c8
--- /dev/null
+++ b/sysutils/open-vm-tools/options.mk
@@ -0,0 +1,18 @@
+# $NetBSD: options.mk,v 1.1 2008/08/31 06:36:47 scottr Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.open-vm-tools
+PKG_SUPPORTED_OPTIONS= x11
+PKG_SUGGESTED_OPTIONS= x11
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mx11)
+PLIST_SRC+= PLIST.x11
+. include "../../x11/gtk2/buildlink3.mk"
+. include "../../x11/libXinerama/buildlink3.mk"
+. include "../../x11/libXrandr/buildlink3.mk"
+. include "../../x11/libXrender/buildlink3.mk"
+. include "../../x11/libXtst/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --without-x
+.endif
diff --git a/sysutils/open-vm-tools/patches/patch-aa b/sysutils/open-vm-tools/patches/patch-aa
index 58a5d3aaf2a..cf184473f12 100644
--- a/sysutils/open-vm-tools/patches/patch-aa
+++ b/sysutils/open-vm-tools/patches/patch-aa
@@ -1,14 +1,14 @@
-$NetBSD: patch-aa,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-aa,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- configure 2007/09/28 13:16:03 1.1
-+++ configure 2007/09/28 13:17:22
-@@ -2171,6 +2171,9 @@
- freebsd*)
- os="freebsd"
+--- configure.orig 2008-08-08 02:02:06.000000000 -0500
++++ configure
+@@ -2251,6 +2251,9 @@ case "$host_os" in
+ linux*)
+ os="linux"
;;
+ netbsd*)
+ os="netbsd"
+ ;;
- solaris*)
- os="solaris"
- case "$host_os" in
+ freebsd*)
+ os="freebsd"
+ ;;
diff --git a/sysutils/open-vm-tools/patches/patch-ab b/sysutils/open-vm-tools/patches/patch-ab
index 87f4d83dd16..97bae0fdd29 100644
--- a/sysutils/open-vm-tools/patches/patch-ab
+++ b/sysutils/open-vm-tools/patches/patch-ab
@@ -1,13 +1,45 @@
-$NetBSD: patch-ab,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ab,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/include/vm_product.h 2007/09/28 18:47:13 1.1
-+++ lib/include/vm_product.h 2007/09/28 18:47:55
-@@ -416,6 +416,8 @@
- # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Windows"
- #elif defined(__FreeBSD__)
- # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for FreeBSD"
-+#elif defined(__NetBSD__)
-+# define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for NetBSD"
- #elif defined(sun)
- # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Solaris"
- #else
+--- guestd/Makefile.in.orig 2008-08-08 02:02:07.000000000 -0500
++++ guestd/Makefile.in
+@@ -144,6 +144,7 @@ ECHO = @ECHO@
+ ECHO_C = @ECHO_C@
+ ECHO_N = @ECHO_N@
+ ECHO_T = @ECHO_T@
++EGDIR = @datarootdir@/examples
+ EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
+ F77 = @F77@
+@@ -559,7 +560,7 @@ info: info-am
+
+ info-am:
+
+-install-data-am: install-pamSCRIPTS
++install-data-am:
+
+ install-dvi: install-dvi-am
+
+@@ -597,7 +598,7 @@ ps: ps-am
+
+ ps-am:
+
+-uninstall-am: uninstall-pamSCRIPTS uninstall-sbinPROGRAMS
++uninstall-am: uninstall-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+
+@@ -620,11 +621,11 @@ uninstall-am: uninstall-pamSCRIPTS unins
+
+
+ install-exec-hook:
+- $(INSTALL) -d $(DESTDIR)/etc/vmware-tools
+- echo 'disable-tools-version = "true"' > $(DESTDIR)/etc/vmware-tools/tools.conf
++ $(MKDIR_P) $(DESTDIR)${EGDIR}/vmware-tools
++ echo 'disable-tools-version = "true"' > $(DESTDIR)${EGDIR}/vmware-tools/tools.conf
+
+ uninstall-hook:
+- $(RM) -rf $(DESTDIR)/etc/vmware-tools
++ $(RM) -rf $(DESTDIR)${EGDIR}/vmware-tools
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
diff --git a/sysutils/open-vm-tools/patches/patch-ac b/sysutils/open-vm-tools/patches/patch-ac
index b68a79e6d58..d8b6ff31f6a 100644
--- a/sysutils/open-vm-tools/patches/patch-ac
+++ b/sysutils/open-vm-tools/patches/patch-ac
@@ -1,23 +1,13 @@
-$NetBSD: patch-ac,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ac,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/include/vm_basic_types.h 2007/09/28 18:49:45 1.1
-+++ lib/include/vm_basic_types.h 2007/09/28 18:51:32
-@@ -140,7 +140,7 @@
- * This applies to Solaris as well.
- */
-
--#if defined(__FreeBSD__) || defined(sun)
-+#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- # ifdef KLD_MODULE
- # include <sys/types.h>
- # else
-@@ -631,7 +631,8 @@
- * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_
- * is defined. Use the same logic here so we don't define it twice. [greg]
- */
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
-+# include <sys/types.h>
- # ifdef _BSD_SIZE_T_
- # undef _BSD_SIZE_T_
- # ifdef VM_I386
+--- guestd/foreignVMToolsDaemon.c.orig 2008-08-08 02:01:56.000000000 -0500
++++ guestd/foreignVMToolsDaemon.c
+@@ -55,7 +55,7 @@
+ #include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ #include <fcntl.h>
+-#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) || defined(__NetBSD__)
+ #include <unistd.h>
+ #else
+ #include <linux/unistd.h>
diff --git a/sysutils/open-vm-tools/patches/patch-ad b/sysutils/open-vm-tools/patches/patch-ad
index 44c15e11f21..1dd1c3cca3f 100644
--- a/sysutils/open-vm-tools/patches/patch-ad
+++ b/sysutils/open-vm-tools/patches/patch-ad
@@ -1,13 +1,13 @@
-$NetBSD: patch-ad,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ad,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/include/su.h 2007/09/28 19:00:23 1.1
-+++ lib/include/su.h 2007/09/28 19:00:48
-@@ -49,7 +49,7 @@
- Bool Id_AuthSet(void const *buf, size_t size);
- Bool Id_AuthCheck(char const *right);
+--- guestd/foreignVMToolsDaemon.h.orig 2008-08-08 02:01:56.000000000 -0500
++++ guestd/foreignVMToolsDaemon.h
+@@ -59,7 +59,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock
--#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__)) && !defined(N_PLAT_NLM)
-+#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(N_PLAT_NLM)
-
- #include <sys/types.h>
+ #ifdef __APPLE__
+ #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+-#elif defined(__FreeBSD__) || defined(sun)
++#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
#include <unistd.h>
+ #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+ #else
diff --git a/sysutils/open-vm-tools/patches/patch-ae b/sysutils/open-vm-tools/patches/patch-ae
index f997b90aef0..53a7943b905 100644
--- a/sysutils/open-vm-tools/patches/patch-ae
+++ b/sysutils/open-vm-tools/patches/patch-ae
@@ -1,22 +1,49 @@
-$NetBSD: patch-ae,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ae,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/user/utilPosix.c 2007/09/28 19:02:18 1.1
-+++ lib/user/utilPosix.c 2007/09/28 19:03:46
-@@ -80,7 +80,7 @@
+--- guestd/main.c.orig 2008-08-08 02:01:56.000000000 -0500
++++ guestd/main.c
+@@ -59,7 +59,7 @@
+ #include "vmBackup.h"
+ #include "codeset.h"
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ #include "socketMgr.h"
+ #endif
+@@ -864,7 +864,7 @@ GuestdSleep(uint64 numUsecs,
+ int maxFd; /* Max fd of all Fd sets */
+ fd_set readFds; /* Read fd set to select on */
+ fd_set writeFds;
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ SocketSelectable *sockReadFds = NULL;
+ SocketSelectable *sockWriteFds = NULL;
+ int numSockReadFds = 0;
+@@ -911,7 +911,7 @@ GuestdSleep(uint64 numUsecs,
+ }
+ #endif
--#if !__FreeBSD__ && !sun
-+#if !__FreeBSD__ && !sun && !__NetBSD__
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ SocketMgr_GetSelectables(SOCKETMGR_IN,
+ &sockReadFds,
+ &numSockReadFds);
+@@ -969,7 +969,7 @@ GuestdSleep(uint64 numUsecs,
+ curAsyncProc = NULL;
+ }
- /*
- *-----------------------------------------------------------------------------
-@@ -542,7 +542,7 @@
- #endif // __linux__
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ for (index = 0; index < numSockReadFds; index++) {
+ if (FD_ISSET(sockReadFds[index], &readFds)) {
+ SocketMgr_ProcessSelectable(sockReadFds[index], SOCKETMGR_IN);
+@@ -984,7 +984,7 @@ GuestdSleep(uint64 numUsecs,
+ #endif
+ }
-
--#if defined(__linux__) || defined(__FreeBSD__) || defined(sun)
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- /*
- *----------------------------------------------------------------------------
- *
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ free((void *) sockReadFds);
+ free((void *) sockWriteFds);
+ #endif
diff --git a/sysutils/open-vm-tools/patches/patch-af b/sysutils/open-vm-tools/patches/patch-af
index 3146526904f..65df0bad2a1 100644
--- a/sysutils/open-vm-tools/patches/patch-af
+++ b/sysutils/open-vm-tools/patches/patch-af
@@ -1,13 +1,22 @@
-$NetBSD: patch-af,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-af,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/user/util.c 2007/09/28 19:02:18 1.1
-+++ lib/user/util.c 2007/09/28 19:04:12
-@@ -575,7 +575,7 @@
- tid = getpid();
- ASSERT(tid != (pid_t)-1);
- return tid;
--#elif __FreeBSD__ || sun
-+#elif __FreeBSD__ || sun || __NetBSD__
- pid_t tid;
+--- lib/dnd/dndLinux.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/dnd/dndLinux.c
+@@ -39,7 +39,7 @@
+ #include "util.h"
+ #include "escape.h"
+ #include "su.h"
+-#if defined(linux) || defined(sun) || defined(__FreeBSD__)
++#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #include "vmblock.h"
+ #include "mntinfo.h"
+ #endif
+@@ -288,7 +288,7 @@ DnD_UriListGetNextFile(char const *uriLi
- tid = getpid();
+
+ /* We need to make this suck less. */
+-#if defined(linux) || defined(sun) || defined(__FreeBSD__)
++#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+ /*
+ *----------------------------------------------------------------------------
+ *
diff --git a/sysutils/open-vm-tools/patches/patch-ag b/sysutils/open-vm-tools/patches/patch-ag
index 59500494afd..73350d5f3e5 100644
--- a/sysutils/open-vm-tools/patches/patch-ag
+++ b/sysutils/open-vm-tools/patches/patch-ag
@@ -1,58 +1,13 @@
-$NetBSD: patch-ag,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ag,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/file/filePosix.c 2007/09/28 19:06:00 1.1
-+++ lib/file/filePosix.c 2007/09/28 19:07:57
-@@ -24,7 +24,7 @@
-
- #include <sys/types.h> /* Needed before sys/vfs.h with glibc 2.0 --hpreg */
-
--#if !__FreeBSD__
-+#if !__FreeBSD__ && !__NetBSD__
- # if !__APPLE__
- # include <sys/vfs.h>
- # endif
-@@ -64,7 +64,7 @@
- #include "dynbuf.h"
- #include "localconfig.h"
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- static char *FilePosixLookupFSDeviceName(const char *filename);
-
- # ifdef VMX86_SERVER
-@@ -382,7 +382,7 @@
- *----------------------------------------------------------------------
+--- lib/dynxdr/dynxdr.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/dynxdr/dynxdr.c
+@@ -54,7 +54,7 @@ typedef struct DynXdrData {
+ * Mac OS X, FreeBSD and Solaris don't take a const parameter to the
+ * "x_getpostn" function.
*/
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- Bool
- File_IsRemote(const char *fileName) // IN: File name
- {
-@@ -412,7 +412,7 @@
- #endif
- #endif
- }
--#endif /* !FreeBSD && !sun */
-+#endif /* !FreeBSD && !sun && !__NetBSD__ */
-
-
- /*
-@@ -698,7 +698,7 @@
- }
-
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- /*
- *----------------------------------------------------------------------
- *
-@@ -1368,7 +1368,7 @@
- }
-
-
--#endif /* !FreeBSD && !sun */
-+#endif /* !FreeBSD && !sun && !defined(__NetBSD__) */
-
-
- /*
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) | defined(__NetBSD__)
+ # define DYNXDR_GETPOS_CONST
+ #else
+ # define DYNXDR_GETPOS_CONST const
diff --git a/sysutils/open-vm-tools/patches/patch-ah b/sysutils/open-vm-tools/patches/patch-ah
index b61cc5e8875..377a2fb310f 100644
--- a/sysutils/open-vm-tools/patches/patch-ah
+++ b/sysutils/open-vm-tools/patches/patch-ah
@@ -1,22 +1,49 @@
-$NetBSD: patch-ah,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ah,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/file/fileIOPosix.c 2007/09/28 19:09:01 1.1
-+++ lib/file/fileIOPosix.c 2007/09/28 19:10:57
-@@ -659,7 +659,7 @@
+--- lib/file/fileIO.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/file/fileIO.c
+@@ -254,7 +254,7 @@ FileIO_Lock(FileIODescriptor *file, // I
+
+ ASSERT(file);
+
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ if (access & FILEIO_OPEN_LOCKED) {
+ int err;
+
+@@ -286,7 +286,7 @@ FileIO_Lock(FileIODescriptor *file, // I
+ }
+ #else
ASSERT(file->lockToken == NULL);
- ASSERT(FILEIO_ERROR_LAST < 16); /* See comment in fileIO.h */
-
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM) && !defined(__NetBSD__)
- /*
- * If FILEIO_OPEN_EXCLUSIVE_LOCK or FILEIO_OPEN_MULTIWRITER_LOCK or
- * (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_LOCKED) are passed, and we are
-@@ -1101,7 +1101,7 @@
- /*
- * readv & writev are not available in the FreeBSD or Solaris Tools builds
- */
--#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun))
-+#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__))
+-#endif // !__FreeBSD__ && !sun
++#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__)
+
+ return ret;
+ }
+@@ -316,7 +316,7 @@ FileIO_Unlock(FileIODescriptor *file)
+ ASSERT(file);
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ if (file->lockToken != NULL) {
+ int err;
+
+@@ -333,7 +333,7 @@ FileIO_Unlock(FileIODescriptor *file)
+ }
+ #else
+ ASSERT(file->lockToken == NULL);
+-#endif // !__FreeBSD__ && !sun
++#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__)
+
+ return ret;
+ }
+@@ -449,7 +449,7 @@ FileIO_StatsExit(const FileIODescriptor
+ /*
+ * Pwrite & Pread are not available in the FreeBSD tools build VM
+ */
+-#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__)
++#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #if defined(_WIN32) || defined(GLIBC_VERSION_21) || defined(__APPLE__)
/*
+ *----------------------------------------------------------------------
diff --git a/sysutils/open-vm-tools/patches/patch-ai b/sysutils/open-vm-tools/patches/patch-ai
index 1082ab7fdec..06d6d8c698f 100644
--- a/sysutils/open-vm-tools/patches/patch-ai
+++ b/sysutils/open-vm-tools/patches/patch-ai
@@ -1,22 +1,31 @@
-$NetBSD: patch-ai,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ai,v 1.2 2008/08/31 06:36:47 scottr Exp $
---- lib/file/fileLockPosix.c 2007/09/28 19:14:30 1.1
-+++ lib/file/fileLockPosix.c 2007/09/28 19:15:17
-@@ -26,7 +26,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/types.h> /* Needed before sys/vfs.h with glibc 2.0 --hpreg */
--#if !defined(__FreeBSD__)
-+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
- #if defined(__APPLE__)
- #include <sys/param.h>
- #include <sys/mount.h>
-@@ -117,7 +117,7 @@
- fileLockOptions.userWorld = userWorld;
- }
+--- lib/file/fileIOPosix.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/file/fileIOPosix.c
+@@ -62,7 +62,7 @@
+ #include <dlfcn.h>
+ #include <sys/xattr.h>
+ #else
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ #else
+@@ -720,7 +720,7 @@ FileIO_Create(FileIODescriptor *file,
+ ASSERT(file->lockToken == NULL);
+ ASSERT_ON_COMPILE(FILEIO_ERROR_LAST < 16); /* See comment in fileIO.h */
+
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM) && !defined(__NetBSD__)
+ /*
+ * If FILEIO_OPEN_EXCLUSIVE_LOCK or FILEIO_OPEN_MULTIWRITER_LOCK or
+ * (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_LOCKED) are passed, and we are
+@@ -1248,7 +1248,7 @@ FileIO_Sync(const FileIODescriptor *file
+ /*
+ * readv & writev are not available in the FreeBSD or Solaris Tools builds
+ */
+-#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun))
++#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__))
+
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
/*
- *----------------------------------------------------------------------
- *
diff --git a/sysutils/open-vm-tools/patches/patch-aj b/sysutils/open-vm-tools/patches/patch-aj
index db41dfb50c5..f10f61e0ab6 100644
--- a/sysutils/open-vm-tools/patches/patch-aj
+++ b/sysutils/open-vm-tools/patches/patch-aj
@@ -1,111 +1,22 @@
-$NetBSD: patch-aj,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-aj,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/guestInfo/guestInfoPosix.c 2007/09/28 19:18:35 1.1
-+++ lib/guestInfo/guestInfoPosix.c 2007/09/28 19:23:49
-@@ -43,10 +43,11 @@
- #include <sys/socket.h>
- #include <sys/stat.h>
- #include <errno.h>
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- # include <netinet/in.h>
- # include <net/if_dl.h>
- # include <ifaddrs.h>
-+# include <sys/param.h>
- # include <sys/sysctl.h>
- #endif
- #include "arpa/inet.h"
-@@ -134,7 +135,7 @@
- };
-
-
+--- lib/file/fileLockPosix.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/file/fileLockPosix.c
+@@ -26,7 +26,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/types.h> /* Needed before sys/vfs.h with glibc 2.0 --hpreg */
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
- static int FindMacAddress(PNicInfo nicInfo, char *macAddress);
- #endif
- static int GetSystemBitness(void);
-@@ -191,7 +192,7 @@
- *-----------------------------------------------------------------------------
- */
-
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) && !defined(__NetBSD__)
- Bool
- GuestInfoGetNicInfo(PNicInfo nicInfo) // IN:
- {
-@@ -283,7 +284,7 @@
- return TRUE;
- }
-
--#else /* FreeBSD */
-+#else /* FreeBSD && !defined(__NetBSD__) */
-
- Bool
- GuestInfoGetNicInfo(PNicInfo nicInfo) // IN:
-@@ -339,7 +340,10 @@
- * Get the mac address for this interface. Some interfaces (like the
- * loopback interface) have no MAC address, and we skip them.
- */
--# ifndef sun
-+#ifdef __NetBSD__
-+ Debug("GuestInfo: Failed to get MAC address, skipping interface\n");
-+ continue;
-+#elif !defined(sun)
- if (ioctl(sockfd, SIOCGIFHWADDR, ifr) < 0) {
- Debug("GuestInfo: Failed to get MAC address, skipping interface\n");
- continue;
-@@ -366,6 +370,7 @@
- *ptr, *(ptr + 1), *(ptr + 2),
- *(ptr + 3), *(ptr + 4), *(ptr + 5));
-
-+#ifndef __NetBSD__
- /* Which entry in nic info corresponds to this MAC address? */
- macIndex = FindMacAddress(nicInfo, macAddress);
- if (macIndex < 0) {
-@@ -381,6 +386,7 @@
- macAddress, sizeof macAddress);
- nicInfo->numNicEntries++;
- }
-+#endif
-
- /* Get the corresponding IP address. */
- ifr->ifr_addr.sa_family = AF_INET;
-@@ -828,6 +834,20 @@
- if (releaseLen != 0) {
- Str_Strncat(osName, outBufLen, buf.release, releaseLen);
- }
-+ } else if (strstr(osNameFull, "NetBSD")) {
-+ size_t nameLen = sizeof STR_OS_NETBSD - 1;
-+ size_t releaseLen = 0;
-+
-+ /* NetBSD, as usual, just DTRT */
-+ releaseLen = strlen(buf.release);
-+
-+ if (nameLen + releaseLen + 1 > outBufLen) {
-+ Debug("GuestInfoGetOSName: Error: buffer too small\n");
-+ return FALSE;
-+ }
-+
-+ Str_Strcpy(osName, STR_OS_NETBSD, outBufLen);
-+ Str_Strncat(osName, outBufLen, buf.release, releaseLen);
- } else if (strstr(osNameFull, "SunOS")) {
- size_t nameLen = sizeof STR_OS_SOLARIS - 1;
- size_t releaseLen = 0;
-@@ -872,7 +892,7 @@
+ #if defined(__APPLE__)
+ #include <sys/param.h>
+ #include <sys/mount.h>
+@@ -121,7 +121,7 @@ FileLock_Init(int lockerPid,
+ fileLockOptions.userWorld = userWorld;
}
-
--#if !defined(__FreeBSD__)
-+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
/*
- *-----------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
-@@ -927,7 +947,7 @@
- GetSystemBitness(void)
- {
- char buf[MAX_ARCH_NAME_LEN] = { 0 };
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- int mib[2];
- size_t len;
-
diff --git a/sysutils/open-vm-tools/patches/patch-ak b/sysutils/open-vm-tools/patches/patch-ak
index 303c37b898f..6d84204ee23 100644
--- a/sysutils/open-vm-tools/patches/patch-ak
+++ b/sysutils/open-vm-tools/patches/patch-ak
@@ -1,14 +1,58 @@
-$NetBSD: patch-ak,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ak,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/include/osNames.h 2007/09/28 19:25:17 1.1
-+++ lib/include/osNames.h 2007/09/28 19:25:53
-@@ -127,6 +127,9 @@
- /* FreeBSD */
- #define STR_OS_FREEBSD "FreeBSD"
-
-+/* NetBSD */
-+#define STR_OS_NETBSD "NetBSD"
-+
- /* Solaris */
- #define STR_OS_SOLARIS "Solaris"
+--- lib/file/filePosix.c.orig 2008-08-08 02:01:54.000000000 -0500
++++ lib/file/filePosix.c
+@@ -24,7 +24,7 @@
+ #include <sys/types.h> /* Needed before sys/vfs.h with glibc 2.0 --hpreg */
+
+-#if !__FreeBSD__
++#if !__FreeBSD__ && !__NetBSD__
+ # if !__APPLE__
+ # include <sys/vfs.h>
+ # endif
+@@ -64,7 +64,7 @@
+
+ #include "unicodeOperations.h"
+
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ #if !defined(__APPLE__)
+ static char *FilePosixLookupMountPoint(char const *canPath, Bool *bind);
+ #endif
+@@ -320,7 +320,7 @@ FileAttributes(ConstUnicode pathName, /
+ *----------------------------------------------------------------------
+ */
+
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ Bool
+ File_IsRemote(ConstUnicode pathName) // IN: Path name
+ {
+@@ -626,7 +626,7 @@ File_GetTimes(ConstUnicode pathName,
+ * XXX atime is almost always MAX.
+ */
+
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ /*
+ * FreeBSD: All supported versions have timestamps with nanosecond resolution.
+ * FreeBSD 5+ has also file creation time.
+@@ -788,7 +788,7 @@ File_SetTimes(ConstUnicode pathName,
+ }
+
+
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ /*
+ *-----------------------------------------------------------------------------
+ *
+@@ -1747,7 +1747,7 @@ File_IsSameFile(ConstUnicode path1, //
+ }
+
+
+-#endif /* !FreeBSD && !sun */
++#endif /* !FreeBSD && !sun && !NetBSD */
+
+
+ /*
diff --git a/sysutils/open-vm-tools/patches/patch-al b/sysutils/open-vm-tools/patches/patch-al
index 68101a6d160..1abf9d6e092 100644
--- a/sysutils/open-vm-tools/patches/patch-al
+++ b/sysutils/open-vm-tools/patches/patch-al
@@ -1,21 +1,12 @@
-$NetBSD: patch-al,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-al,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/include/hgfsUtil.h 2007/09/28 21:35:00 1.1
-+++ lib/include/hgfsUtil.h 2007/09/28 21:36:02
-@@ -39,6 +39,7 @@
- !defined(__timespec_defined) && \
- !defined(sun) && \
- !defined(__FreeBSD__) && \
-+ !defined(__NetBSD__) && \
- !__APPLE__ && \
- !defined(_WIN32)
- struct timespec {
-@@ -75,7 +76,7 @@
- /*
- * Older FreeBSDs do not define EPROTO, so we'll define our own error code.
- */
--#if defined(__FreeBSD__) && !defined(EPROTO)
-+#if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(EPROTO)
- #define EPROTO (ELAST + 1)
- #endif
+--- lib/guestApp/Makefile.in.orig 2008-08-08 02:02:08.000000000 -0500
++++ lib/guestApp/Makefile.in
+@@ -248,6 +248,7 @@ libGuestApp_a_SOURCES = guestApp.c guest
+ @HAVE_X11_TRUE@libGuestAppX11_a_SOURCES = $(libGuestApp_a_SOURCES) \
+ @HAVE_X11_TRUE@ guestAppPosixX11.c
+ @HAVE_X11_TRUE@libGuestAppX11_a_CPPFLAGS = -DGUESTAPP_HAS_X11
++CFLAGS += -DGUESTAPP_TOOLS_INSTALL_PATH=\"$(sysconfdir)/vmware-tools\"
+ all: all-am
+ .SUFFIXES:
diff --git a/sysutils/open-vm-tools/patches/patch-am b/sysutils/open-vm-tools/patches/patch-am
index 532ad976e50..aa564a860d6 100644
--- a/sysutils/open-vm-tools/patches/patch-am
+++ b/sysutils/open-vm-tools/patches/patch-am
@@ -1,62 +1,20 @@
-$NetBSD: patch-am,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-am,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/misc/idLinux.c 2007/09/28 21:37:59 1.1
-+++ lib/misc/idLinux.c 2007/09/28 21:39:55
-@@ -85,7 +85,7 @@
- #endif
-
+--- lib/guestApp/guestApp.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/guestApp/guestApp.c
+@@ -72,6 +72,7 @@ extern "C" {
+ * intelligent for that platform as well.
+ */
--#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__)
-+#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- /*
- *----------------------------------------------------------------------------
- *
-@@ -149,6 +149,9 @@
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
- return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
- #else
- if (uid32) {
- int r = syscall(SYS_setgid32, egid);
-@@ -193,6 +196,9 @@
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
- return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
++#if !defined(GUESTAPP_TOOLS_INSTALL_PATH)
+ #if defined(N_PLAT_NLM)
+ #define GUESTAPP_TOOLS_INSTALL_PATH "SYS:\\ETC\\VMWTOOL"
+ #elif defined(_WIN32)
+@@ -79,6 +80,7 @@ extern "C" {
#else
- if (uid32) {
- int r = syscall(SYS_setresuid32, uid, euid, suid);
-@@ -235,6 +241,9 @@
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
- return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
- #else
- if (uid32) {
- int r = syscall(SYS_setresgid32, gid, egid, sgid);
-@@ -281,6 +290,9 @@
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
- return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
- #else
- if (uid32) {
- int r = syscall(SYS_setreuid32, uid, euid);
-@@ -294,7 +306,7 @@
- }
-
+ #define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools"
+ #endif
++#endif
--#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__)
-+#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
/*
- *----------------------------------------------------------------------------
- *
+ * An option name/value pair stored locally in the guest app.
diff --git a/sysutils/open-vm-tools/patches/patch-an b/sysutils/open-vm-tools/patches/patch-an
index d254c3368a5..83cc7887d8d 100644
--- a/sysutils/open-vm-tools/patches/patch-an
+++ b/sysutils/open-vm-tools/patches/patch-an
@@ -1,31 +1,63 @@
-$NetBSD: patch-an,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-an,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/netUtil/netUtilLinux.c 2007/09/28 21:41:22 1.1
-+++ lib/netUtil/netUtilLinux.c 2007/09/28 21:43:27
-@@ -32,7 +32,7 @@
+--- lib/guestInfo/guestInfoPosix.c.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/guestInfo/guestInfoPosix.c
+@@ -38,10 +38,11 @@
#endif
-
-
--#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- # error This file should not be compiled
- #endif
-
-@@ -59,7 +59,7 @@
- #include <net/if.h>
- #include <sys/ioctl.h>
-
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- #include "ifaddrs.h"
+ #include <unistd.h>
+ #include <sys/types.h>
++#include <sys/param.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+ #include <errno.h>
+-#if defined(__FreeBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+ # include <sys/sysctl.h>
#endif
-
-@@ -94,7 +94,7 @@
- *----------------------------------------------------------------------
- */
-
--#ifndef __FreeBSD__ /* { */
-+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
- char *
- NetUtil_GetPrimaryIP(void)
+ #ifndef NO_DNET
+@@ -229,6 +230,7 @@ ReadInterfaceDetails(const struct intf_e
+ if (ip) {
+ GuestInfoAddSubnetMask(ip, entry->intf_addr.addr_bits);
+ }
++#if !defined(__NetBSD__) /* libdnet addr_ntoa() breaks with IPv6 on NetBSD */
+ } else if (entry->intf_alias_addrs[i].addr_type == ADDR_TYPE_IP6) {
+ memcpy(ipAddress,
+ addr_ntoa(&entry->intf_alias_addrs[i]),
+@@ -236,6 +238,7 @@ ReadInterfaceDetails(const struct intf_e
+ GuestInfoAddIpAddress(nic,
+ ipAddress,
+ INFO_IP_ADDRESS_FAMILY_IPV6);
++#endif /* defined(__NetBSD__) */
+ }
+ }
+ }
+@@ -697,6 +700,20 @@ GuestInfoGetOSName(unsigned int outBufFu
+ if (releaseLen != 0) {
+ Str_Strncat(osName, outBufLen, buf.release, releaseLen);
+ }
++ } else if (strstr(osNameFull, "NetBSD")) {
++ size_t nameLen = sizeof STR_OS_NETBSD - 1;
++ size_t releaseLen = 0;
++
++ /* NetBSD, as usual, just DTRT */
++ releaseLen = strlen(buf.release);
++
++ if (nameLen + releaseLen + 1 > outBufLen) {
++ Debug("GuestInfoGetOSName: Error: buffer too small\n");
++ return FALSE;
++ }
++
++ Str_Strcpy(osName, STR_OS_NETBSD, outBufLen);
++ Str_Strncat(osName, outBufLen, buf.release, releaseLen);
+ } else if (strstr(osNameFull, "SunOS")) {
+ size_t nameLen = sizeof STR_OS_SOLARIS - 1;
+ size_t releaseLen = 0;
+@@ -766,7 +783,7 @@ int
+ GuestInfo_GetSystemBitness(void)
{
+ char buf[MAX_ARCH_NAME_LEN] = { 0 };
+-#if defined(__FreeBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+ int mib[2];
+ size_t len;
+
diff --git a/sysutils/open-vm-tools/patches/patch-ao b/sysutils/open-vm-tools/patches/patch-ao
index 6fcda403bc0..b6d83edbc87 100644
--- a/sysutils/open-vm-tools/patches/patch-ao
+++ b/sysutils/open-vm-tools/patches/patch-ao
@@ -1,31 +1,14 @@
-$NetBSD: patch-ao,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ao,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/procMgr/procMgrPosix.c 2007/09/28 21:44:48 1.1
-+++ lib/procMgr/procMgrPosix.c 2007/09/28 21:45:36
-@@ -32,7 +32,7 @@
- // pull in setresuid()/setresgid() if possible
- #define _GNU_SOURCE
- #include <unistd.h>
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- #include <asm/param.h>
- #include <locale.h>
- #include <sys/stat.h>
-@@ -141,7 +141,7 @@
- ProcMgr_ListProcesses(void)
- {
- ProcMgr_ProcList *procList = NULL;
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- Bool failed = FALSE;
- DynBuf dbProcId;
- DynBuf dbProcCmd;
-@@ -755,7 +755,7 @@
- /*
- * if its not linux, assume its gone
- */
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- char procname[256];
- int ret;
- struct stat st;
+--- lib/include/conf.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/conf.h
+@@ -41,6 +41,9 @@
+ # ifdef sun
+ # define CONFVAL_HALT_DEFAULT "/usr/sbin/init 5"
+ # define CONFVAL_REBOOT_DEFAULT "/usr/sbin/init 6"
++# elif defined(__NetBSD__)
++# define CONFVAL_HALT_DEFAULT "/sbin/shutdown -p now"
++# define CONFVAL_REBOOT_DEFAULT "/sbin/shutdown -r now"
+ # else
+ # define CONFVAL_HALT_DEFAULT "/sbin/shutdown -h now"
+ # define CONFVAL_REBOOT_DEFAULT "/sbin/shutdown -r now"
diff --git a/sysutils/open-vm-tools/patches/patch-ap b/sysutils/open-vm-tools/patches/patch-ap
index b57fe06d6cd..f564e9acb05 100644
--- a/sysutils/open-vm-tools/patches/patch-ap
+++ b/sysutils/open-vm-tools/patches/patch-ap
@@ -1,15 +1,14 @@
-$NetBSD: patch-ap,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ap,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/string/str.c 2007/09/28 21:47:18 1.1
-+++ lib/string/str.c 2007/09/28 21:48:13
-@@ -37,6 +37,10 @@
- #include "bsd_output.h"
- #endif
+--- lib/include/guest_os.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/guest_os.h
+@@ -298,6 +298,9 @@ typedef enum GuestOSFamilyType {
+ /* FreeBSD */
+ #define STR_OS_FREEBSD "FreeBSD"
-+#ifdef __NetBSD__
-+#include <wchar.h>
-+#endif
++/* NetBSD */
++#define STR_OS_NETBSD "NetBSD"
+
- #if defined _WIN32 && !defined HAS_BSD_PRINTF
- #define vsnprintf _vsnprintf
- #endif
+ /* Solaris */
+ #define STR_OS_SOLARIS "Solaris"
+
diff --git a/sysutils/open-vm-tools/patches/patch-aq b/sysutils/open-vm-tools/patches/patch-aq
index bea05e20f67..ba7bb04dc6f 100644
--- a/sysutils/open-vm-tools/patches/patch-aq
+++ b/sysutils/open-vm-tools/patches/patch-aq
@@ -1,22 +1,21 @@
-$NetBSD: patch-aq,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-aq,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/system/systemLinux.c 2007/09/29 08:14:52 1.1
-+++ lib/system/systemLinux.c 2007/09/29 08:16:09
-@@ -32,7 +32,7 @@
- #endif
-
-
--#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- # error This file should not be compiled
- #endif
-
-@@ -59,7 +59,7 @@
- #include <net/if.h>
- #include <sys/ioctl.h>
-
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- #include "ifaddrs.h"
+--- lib/include/hgfsUtil.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/hgfsUtil.h
+@@ -44,6 +44,7 @@
+ !defined(__timespec_defined) && \
+ !defined(sun) && \
+ !defined(__FreeBSD__) && \
++ !defined(__NetBSD__) && \
+ !__APPLE__ && \
+ !defined(_WIN32)
+ struct timespec {
+@@ -96,7 +97,7 @@ struct timespec {
+ /*
+ * FreeBSD (pre-6.0) does not define EPROTO, so we'll define our own error code.
+ */
+-#if defined(__FreeBSD__) && !defined(EPROTO)
++#if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(EPROTO)
+ #define EPROTO (ELAST + 1)
#endif
diff --git a/sysutils/open-vm-tools/patches/patch-ar b/sysutils/open-vm-tools/patches/patch-ar
index 4d6985abd57..f32511c8916 100644
--- a/sysutils/open-vm-tools/patches/patch-ar
+++ b/sysutils/open-vm-tools/patches/patch-ar
@@ -1,38 +1,13 @@
-$NetBSD: patch-ar,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ar,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/user/hostinfoPosix.c 2007/09/29 10:16:41 1.1
-+++ lib/user/hostinfoPosix.c 2007/09/29 10:19:15
-@@ -694,8 +694,8 @@
- e = s + strlen(s);
+--- lib/include/iovector.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/iovector.h
+@@ -32,7 +32,7 @@
+ /*
+ * Ugly definition of struct iovec.
+ */
+-#if __linux__ || sun || __APPLE__
++#if __linux__ || sun || __APPLE__ || __NetBSD__
+ #include <sys/uio.h> // for struct iovec
+ #else // if __linux__ || sun || __APPLE__
- /* Skip leading and trailing while spaces */
-- for (; s < e && isspace(*s); s++);
-- for (; s < e && isspace(e[-1]); e--);
-+ for (; s < e && isspace((unsigned)*s); s++);
-+ for (; s < e && isspace((unsigned)e[-1]); e--);
- *e = 0;
-
- /* Free previous value */
-@@ -1071,7 +1071,9 @@
- {
- int s, fd;
- struct sigaction sa;
-+#ifdef RLIMIT_AS
- struct rlimit rlim;
-+#endif
- #ifdef __linux__
- int err;
- uid_t euid;
-@@ -1095,10 +1097,12 @@
- }
- }
-
-+#ifdef RLIMIT_AS
- if (getrlimit(RLIMIT_AS, &rlim) == 0) {
- rlim.rlim_cur = rlim.rlim_max;
- setrlimit(RLIMIT_AS, &rlim);
- }
-+#endif
-
- #ifdef __linux__
- /*
diff --git a/sysutils/open-vm-tools/patches/patch-as b/sysutils/open-vm-tools/patches/patch-as
index 4135fafd93b..98b62ec74bc 100644
--- a/sysutils/open-vm-tools/patches/patch-as
+++ b/sysutils/open-vm-tools/patches/patch-as
@@ -1,72 +1,57 @@
-$NetBSD: patch-as,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-as,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/wiper/wiperPosix.c 2007/09/29 12:46:28 1.1
-+++ lib/wiper/wiperPosix.c 2007/09/29 12:48:36
-@@ -23,7 +23,7 @@
- *
- */
-
--#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__)
-+#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__NetBSD__)
- #error This file should not be compiled on this platform.
- #endif
-
-@@ -31,12 +31,12 @@
- #include <sys/stat.h>
- #if defined(__linux__) || defined(sun)
- # include <sys/vfs.h>
--#elif defined(__FreeBSD__) || defined(__APPLE__)
-+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- # include <sys/param.h>
- # include <sys/ucred.h>
+--- lib/include/mntinfo.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/mntinfo.h
+@@ -34,7 +34,7 @@
+ # include <limits.h>
+ #elif defined(__linux__)
+ # include <mntent.h>
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
# include <sys/mount.h>
- # include <fstab.h>
--# if BSD_VERSION >= 50
-+# if defined(__FreeBSD__) && BSD_VERSION >= 50
- # include <libgen.h>
- # endif /* BSD_VERSION < 50 */
#endif
-@@ -65,7 +65,7 @@
-
- #if defined(sun) || defined(__linux__)
- # define PROCFS "proc"
+ #include "posix.h"
+@@ -106,17 +106,27 @@
+ # define MNTINFO_FSTYPE(mnt) mnt->mnt_type
+ # define MNTINFO_MNTPT(mnt) mnt->mnt_dir
+ # define MNTINFO_MNT_IS_RO(mnt) (hasmntopt((mnt), "rw") == NULL)
-#elif defined(__FreeBSD__) || defined(__APPLE__)
+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- # define PROCFS "procfs"
- #endif
-
-@@ -195,7 +195,7 @@
- return TRUE;
- }
-
--#elif defined(__FreeBSD__) || defined(__APPLE__) /* } FreeBSD { */
-+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) /* } FreeBSD { */
+ struct mntHandle {
++# if defined(__NetBSD__)
++ struct statvfs *mountPoints; // array of mountpoints per getmntinfo(3)
++# else
+ struct statfs *mountPoints; // array of mountpoints per getmntinfo(3)
++# endif
+ int numMountPoints; // number of elements in mntArray
+ int mountIndex; // current location within mountPoints array
+ };
+ # define MNTFILE _PATH_FSTAB
+ # define MNTHANDLE struct mntHandle *
+-# define MNTINFO struct statfs
+-# define DECLARE_MNTINFO(name) struct statfs __ ## name; \
++# if defined(__NetBSD__)
++# define MNTINFO struct statvfs
++# define DECLARE_MNTINFO(name) struct statvfs __ ## name; \
++ struct statvfs *name = &__ ## name
++# else
++# define MNTINFO struct statfs
++# define DECLARE_MNTINFO(name) struct statfs __ ## name; \
+ struct statfs *name = &__ ## name
++# endif
- static INLINE Bool
- WiperIsDiskDevice(MNTINFO *mnt, // IN: file system being considered
-@@ -209,7 +209,7 @@
- * function, as a whole, does not even apply to OS X, so this caveat is
- * only minor.
- */
--#if BSD_VERSION < 50
-+#if defined(__NetBSD__) || BSD_VERSION < 50
- /*
- * Before FreeBSD 5, device nodes had static major/minor numbers.
- * (FreeBSD 5 included devfs which got rid of this concept.) So
-@@ -509,14 +509,14 @@
- uint64 *free, // OUT
- uint64 *total) // OUT
- {
--#ifdef sun
-+#if defined(sun) || defined(__NetBSD__)
- struct statvfs statfsbuf;
+ # define OPEN_MNTFILE(mode) \
+ ({ \
+@@ -155,7 +165,11 @@ struct mntHandle {
+ # define MNTINFO_NAME(mnt) mnt->f_mntfromname
+ # define MNTINFO_FSTYPE(mnt) mnt->f_fstypename
+ # define MNTINFO_MNTPT(mnt) mnt->f_mntonname
+-# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY)
++# if defined(__NetBSD__)
++# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flag & MNT_RDONLY)
++# else
++# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY)
++# endif
#else
- struct statfs statfsbuf;
+ # error "Define mount information macros for your OS type"
#endif
- ASSERT(p);
-
--#ifdef sun
-+#if defined(sun) || defined(__NetBSD__)
- if (statvfs(p->mountPoint, &statfsbuf) < 0) {
- #else
- if (statfs(p->mountPoint, &statfsbuf) < 0) {
diff --git a/sysutils/open-vm-tools/patches/patch-at b/sysutils/open-vm-tools/patches/patch-at
index 615b9b701b7..5678ce15f26 100644
--- a/sysutils/open-vm-tools/patches/patch-at
+++ b/sysutils/open-vm-tools/patches/patch-at
@@ -1,57 +1,22 @@
-$NetBSD: patch-at,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-at,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/include/mntinfo.h 2007/09/29 12:49:29 1.1
-+++ lib/include/mntinfo.h 2007/09/29 12:52:41
-@@ -34,7 +34,7 @@
- # include <limits.h>
- #elif defined(__linux__)
- # include <mntent.h>
--#elif defined(__FreeBSD__)
-+#elif defined(__FreeBSD__) || defined(__NetBSD__)
- # include <sys/mount.h>
- #endif
+--- lib/include/posix.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/posix.h
+@@ -151,7 +151,7 @@ int Posix_Getgrnam_r(ConstUnicode name,
+ char *buf, size_t size, struct group **pgr);
-@@ -105,17 +105,27 @@
- # define MNTINFO_FSTYPE(mnt) mnt->mnt_type
- # define MNTINFO_MNTPT(mnt) mnt->mnt_dir
- # define MNTINFO_MNT_IS_RO(mnt) (hasmntopt((mnt), "rw") == NULL)
--#elif defined(__FreeBSD__) || defined(__APPLE__)
-+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- struct mntHandle {
-+# if defined(__NetBSD__)
-+ struct statvfs *mountPoints; // array of mountpoints per getmntinfo(3)
-+# else
- struct statfs *mountPoints; // array of mountpoints per getmntinfo(3)
-+# endif
- int numMountPoints; // number of elements in mntArray
- int mountIndex; // current location within mountPoints array
- };
- # define MNTFILE _PATH_FSTAB
- # define MNTHANDLE struct mntHandle *
--# define MNTINFO struct statfs
--# define DECLARE_MNTINFO(name) struct statfs __ ## name; \
-+# if defined(__NetBSD__)
-+# define MNTINFO struct statvfs
-+# define DECLARE_MNTINFO(name) struct statvfs __ ## name; \
-+ struct statvfs *name = &__ ## name
-+# else
-+# define MNTINFO struct statfs
-+# define DECLARE_MNTINFO(name) struct statfs __ ## name; \
- struct statfs *name = &__ ## name
-+# endif
+ #if !defined(sun)
+-#if !defined(__APPLE__) && !defined(__FreeBSD__)
++#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ int Posix_Mount(ConstUnicode source, ConstUnicode target,
+ const char *filesystemtype, unsigned long mountflags,
+ const void *data);
+@@ -161,7 +161,7 @@ struct mntent *Posix_Getmntent(FILE *fp)
+ struct mntent *Posix_Getmntent_r(FILE *fp, struct mntent *m,
+ char *buf, int size);
+
+-#endif // !defined(__APPLE__) && !defined(__FreeBSD__)
++#endif // !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #else // !defined(sun)
+ int Posix_Getmntent(FILE *fp, struct mnttab *mp);
- # define OPEN_MNTFILE(mode) \
- ({ \
-@@ -150,7 +160,11 @@
- # define MNTINFO_NAME(mnt) mnt->f_mntfromname
- # define MNTINFO_FSTYPE(mnt) mnt->f_fstypename
- # define MNTINFO_MNTPT(mnt) mnt->f_mntonname
--# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY)
-+# if defined(__NetBSD__)
-+# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flag & MNT_RDONLY)
-+# else
-+# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY)
-+# endif
- #else
- # error "Define mount information macros for your OS type"
- #endif
diff --git a/sysutils/open-vm-tools/patches/patch-au b/sysutils/open-vm-tools/patches/patch-au
index e5bdcafea86..2fa6964339c 100644
--- a/sysutils/open-vm-tools/patches/patch-au
+++ b/sysutils/open-vm-tools/patches/patch-au
@@ -1,13 +1,37 @@
-$NetBSD: patch-au,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-au,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- guestd/foreignVMToolsDaemon.c 2007/09/29 13:01:02 1.1
-+++ guestd/foreignVMToolsDaemon.c 2007/09/29 13:01:37
-@@ -56,7 +56,7 @@
- #include <netinet/tcp.h>
- #include <arpa/inet.h>
- #include <fcntl.h>
--#if defined(__FreeBSD__) || defined(sun)
-+#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+--- lib/include/su.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/su.h
+@@ -51,7 +51,7 @@ Bool Id_AuthSet(void const *buf, size_t
+ Bool Id_AuthCheck(char const *right,
+ char const *localizedDescription);
+
+-#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__)) && !defined(N_PLAT_NLM)
++#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(N_PLAT_NLM)
+
+ #include <sys/types.h>
#include <unistd.h>
- #else
- #include <linux/unistd.h>
+@@ -87,7 +87,11 @@ int Id_SetRESGid(gid_t rgid, gid_t egid,
+ static INLINE int
+ Id_SetEUid(uid_t euid)
+ {
++#if defined(__NetBSD__)
++ return seteuid(euid);
++#else
+ return Id_SetRESUid((uid_t)-1, euid, (uid_t)-1);
++#endif
+ }
+
+
+@@ -111,7 +115,11 @@ Id_SetEUid(uid_t euid)
+ static INLINE int
+ Id_SetEGid(gid_t egid)
+ {
++#if defined(__NetBSD__)
++ return setegid(egid);
++#else
+ return Id_SetRESGid((gid_t)-1, egid, (gid_t)-1);
++#endif
+ }
+
+ #define IsSuperUser() (0 == geteuid())
diff --git a/sysutils/open-vm-tools/patches/patch-av b/sysutils/open-vm-tools/patches/patch-av
index d74d160acaa..51cd63294f5 100644
--- a/sysutils/open-vm-tools/patches/patch-av
+++ b/sysutils/open-vm-tools/patches/patch-av
@@ -1,13 +1,22 @@
-$NetBSD: patch-av,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-av,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- guestd/foreignVMToolsDaemon.h 2007/09/29 13:02:18 1.1
-+++ guestd/foreignVMToolsDaemon.h 2007/09/29 13:02:45
-@@ -60,7 +60,7 @@
+--- lib/include/util.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/util.h
+@@ -55,7 +55,7 @@
+ /*
+ * Define the Util_ThreadID type.
+ */
+-#if defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <pthread.h>
+ typedef pthread_t Util_ThreadID;
+ #elif defined(_WIN32)
+@@ -119,7 +119,7 @@ EXTERN char *Util_GetSafeTmpDir(Bool use
+ EXTERN int Util_MakeSafeTemp(ConstUnicode tag,
+ Unicode *presult);
+
+-#if defined(__linux__) || defined(__FreeBSD__) || defined(sun)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ EXTERN Bool Util_GetProcessName(pid_t pid, char *bufOut, size_t bufOutSize);
+ #endif
- #ifdef __APPLE__
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
--#elif defined(__FreeBSD__) || defined(sun)
-+#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- #include <unistd.h>
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
- #else
diff --git a/sysutils/open-vm-tools/patches/patch-aw b/sysutils/open-vm-tools/patches/patch-aw
index cadbdbdb32d..9ad26c51725 100644
--- a/sysutils/open-vm-tools/patches/patch-aw
+++ b/sysutils/open-vm-tools/patches/patch-aw
@@ -1,13 +1,31 @@
-$NetBSD: patch-aw,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-aw,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/include/iovector.h 2007/09/29 13:04:52 1.1
-+++ lib/include/iovector.h 2007/09/29 13:07:40
-@@ -32,7 +32,7 @@
- /*
- * Ugly definition of struct iovec.
+--- lib/include/vm_atomic.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/vm_atomic.h
+@@ -22,8 +22,8 @@
+ * Atomic power
*/
--#if __linux__ || sun || __APPLE__
-+#if __linux__ || sun || __APPLE__ || __NetBSD__
- #include <sys/uio.h> // for struct iovec
- #else // if __linux__ || sun || __APPLE__
+-#ifndef _ATOMIC_H_
+-#define _ATOMIC_H_
++#ifndef _VM_ATOMIC_H_
++#define _VM_ATOMIC_H_
+
+ #define INCLUDE_ALLOW_USERLEVEL
+ #define INCLUDE_ALLOW_VMMEXT
+@@ -154,7 +154,8 @@ Atomic_VolatileToAtomic(volatile uint32
+ __GNUC__ >= 3 && \
+ !defined(BSD_VERSION) && \
+ (!defined(MODULE) || defined(__VMKERNEL_MODULE__)) && \
+- !defined(__APPLE__) /* PR136775 */
++ !defined(__APPLE__) /* PR136775 */ || \
++ !defined(__NetBSD__)
+ #define ATOMIC_USE_FENCE
+ #endif
+
+@@ -2046,4 +2047,4 @@ Atomic_MFence(void)
+ Atomic_Xor(&fence, 0x1);
+ }
+
+-#endif // ifndef _ATOMIC_H_
++#endif // ifndef _VM_ATOMIC_H_
diff --git a/sysutils/open-vm-tools/patches/patch-ax b/sysutils/open-vm-tools/patches/patch-ax
index 2e2856c4274..48a4c640c5d 100644
--- a/sysutils/open-vm-tools/patches/patch-ax
+++ b/sysutils/open-vm-tools/patches/patch-ax
@@ -1,112 +1,41 @@
-$NetBSD: patch-ax,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ax,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- guestd/main.c 2007/09/29 13:11:05 1.1
-+++ guestd/main.c 2007/09/29 13:12:20
-@@ -39,7 +39,7 @@
- #include <sys/wait.h>
- #include <errno.h>
- #include <stdlib.h>
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- #include <utmp.h>
- #include <pwd.h>
- #include <grp.h>
-@@ -79,7 +79,7 @@
- #include "vmstdio.h"
- #include "vmBackup.h"
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- #include "socketMgr.h"
- #include "dnd.h"
- #endif
-@@ -126,7 +126,7 @@
- # define HGFS_MOUNT_FLAGS MS_DATA /* from <sys/mount.h> */
+--- lib/include/vm_basic_types.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/vm_basic_types.h
+@@ -41,7 +41,7 @@
+ #include "includeCheck.h"
+
+ /* STRICT ANSI means the Xserver build and X defines Bool differently. */
+-#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__)
++#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ typedef char Bool;
#endif
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- #define VMWAREUSER_CHECK_TIME 1000 /* 10 seconds */
- #define XAUTOSTART_CONF "xautostart.conf"
- #define NR_XBLESSED_APP_DEFAULT 2
-@@ -158,7 +158,7 @@
- * Global variables
- */
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- static const char *gBinDir;
- static char *gDefaultBlessedApp[] = {
- XBLESSED_APP1_DEFAULT,
-@@ -525,7 +525,7 @@
- #endif /* sun */
-
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- /*
- *----------------------------------------------------------------------
- *
-@@ -1496,7 +1496,7 @@
- int maxFd; /* Max fd of all Fd sets */
- fd_set readFds; /* Read fd set to select on */
- fd_set writeFds;
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- SocketSelectable *sockReadFds = NULL;
- SocketSelectable *sockWriteFds = NULL;
- int numSockReadFds = 0;
-@@ -1539,7 +1539,7 @@
- }
- }
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- SocketMgr_GetSelectables(SOCKETMGR_IN,
- &sockReadFds,
- &numSockReadFds);
-@@ -1597,7 +1597,7 @@
- curAsyncProc = NULL;
- }
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- for (index = 0; index < numSockReadFds; index++) {
- if (FD_ISSET(sockReadFds[index], &readFds)) {
- SocketMgr_ProcessSelectable(sockReadFds[index], SOCKETMGR_IN);
-@@ -1612,7 +1612,7 @@
- #endif
- }
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- free((void *) sockReadFds);
- free((void *) sockWriteFds);
+@@ -151,7 +151,7 @@ typedef char int8;
#endif
-@@ -1641,7 +1641,7 @@
- GuestdDaemon(GuestApp_Dict **pConfDict, // IN/OUT
- int *gDaemonSignalPtr) // IN/OUT
- {
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- pid_t vmwareuserPid = 0;
- #endif
- ToolsDaemon_Data *data = NULL;
-@@ -1695,7 +1695,7 @@
- GuestApp_GetDictEntryBool(*pConfDict, CONFNAME_DISABLEQUERYDISKINFO));
- }
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- gBinDir = GuestApp_GetDictEntry(*pConfDict, CONFNAME_BINDIR);
- if (gBinDir == NULL) {
- gBinDir = "/usr/bin";
-@@ -1775,7 +1775,7 @@
- ToolsDaemon_Cleanup(data);
- }
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- if (vmwareuserPid != 0) {
- kill(vmwareuserPid, SIGTERM);
- }
+ #if !defined(USING_AUTOCONF)
+-# if defined(__FreeBSD__) || defined(sun)
++# if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ # ifdef KLD_MODULE
+ # include <sys/types.h>
+ # else
+@@ -267,7 +267,7 @@ typedef int64 VmTimeVirtualClock; /* Vi
+ #endif
+ #ifdef VM_X86_64
+ #define FMT64 "l"
+- #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__)
++ #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #define FMT64 "ll"
+ #else
+ #define FMT64 "L"
+@@ -717,7 +717,8 @@ typedef void * UserVA;
+ * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_
+ * is defined. Use the same logic here so we don't define it twice. [greg]
+ */
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
++# include <sys/types.h>
+ # ifdef _BSD_SIZE_T_
+ # undef _BSD_SIZE_T_
+ # ifdef VM_I386
diff --git a/sysutils/open-vm-tools/patches/patch-ay b/sysutils/open-vm-tools/patches/patch-ay
index 31f7e2a5edf..f5fd9f421b5 100644
--- a/sysutils/open-vm-tools/patches/patch-ay
+++ b/sysutils/open-vm-tools/patches/patch-ay
@@ -1,49 +1,13 @@
-$NetBSD: patch-ay,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ay,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/file/fileIO.c 2007/09/29 13:15:17 1.1
-+++ lib/file/fileIO.c 2007/09/29 13:16:06
-@@ -241,7 +241,7 @@
- * Lock the file if necessary.
- */
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- if (access & FILEIO_OPEN_LOCKED) {
- int err;
-
-@@ -264,7 +264,7 @@
- }
- #else
- ASSERT(file->lockToken == NULL);
--#endif // !__FreeBSD__ && !sun
-+#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__)
-
- return ret;
- }
-@@ -292,7 +292,7 @@
- {
- FileIOResult ret = FILEIO_SUCCESS;
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- if (file->lockToken != NULL) {
- int err;
-
-@@ -309,7 +309,7 @@
- }
- #else
- ASSERT(file->lockToken == NULL);
--#endif // !__FreeBSD__ && !sun
-+#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__)
-
- return ret;
- }
-@@ -419,7 +419,7 @@
- /*
- * Pwrite & Pread are not available in the FreeBSD tools build VM
- */
--#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__)
-+#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__) && !defined(__NetBSD__)
- #if _WIN32 || defined(GLIBC_VERSION_21) || __APPLE__
- /*
- *----------------------------------------------------------------------
+--- lib/include/vm_product.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/vm_product.h
+@@ -498,6 +498,8 @@
+ # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Windows"
+ #elif defined(__FreeBSD__)
+ # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for FreeBSD"
++#elif defined(__NetBSD__)
++# define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for NetBSD"
+ #elif defined(sun)
+ # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Solaris"
+ #elif defined(__APPLE__)
diff --git a/sysutils/open-vm-tools/patches/patch-az b/sysutils/open-vm-tools/patches/patch-az
index 30876ba740f..3529c5d4c35 100644
--- a/sysutils/open-vm-tools/patches/patch-az
+++ b/sysutils/open-vm-tools/patches/patch-az
@@ -1,7 +1,7 @@
-$NetBSD: patch-az,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-az,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/include/vmblock.h 2007/09/29 13:18:10 1.1
-+++ lib/include/vmblock.h 2007/09/29 13:19:22
+--- lib/include/vmblock.h.orig 2008-08-08 02:01:52.000000000 -0500
++++ lib/include/vmblock.h
@@ -25,12 +25,13 @@
#ifndef _VMBLOCK_H_
#define _VMBLOCK_H_
@@ -18,7 +18,7 @@ $NetBSD: patch-az,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
#endif
#define VMBLOCK_FS_NAME "vmblock"
-@@ -53,7 +54,7 @@
+@@ -54,7 +55,7 @@
# define VMBLOCK_DEVICE_MODE O_WRONLY
# define VMBLOCK_CONTROL(fd, op, path) write(fd, path, op)
@@ -27,7 +27,7 @@ $NetBSD: patch-az,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
# define VMBLOCK_MOUNT_POINT "/var/run/" VMBLOCK_FS_NAME
# define VMBLOCK_DEVICE VMBLOCK_MOUNT_POINT
# define VMBLOCK_DEVICE_MODE O_RDONLY
-@@ -70,7 +71,7 @@
+@@ -71,7 +72,7 @@
# endif
# define VMBLOCK_CONTROL(fd, op, path) ioctl(fd, op, path)
diff --git a/sysutils/open-vm-tools/patches/patch-ba b/sysutils/open-vm-tools/patches/patch-ba
index 290dd4e2aa1..3b382edc07c 100644
--- a/sysutils/open-vm-tools/patches/patch-ba
+++ b/sysutils/open-vm-tools/patches/patch-ba
@@ -1,13 +1,22 @@
-$NetBSD: patch-ba,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-ba,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- vmware-user/foreignVMToolsDaemon.h 2007/09/30 10:16:08 1.1
-+++ vmware-user/foreignVMToolsDaemon.h 2007/09/30 10:16:49
-@@ -60,7 +60,7 @@
-
- #ifdef __APPLE__
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
--#elif defined(__FreeBSD__) || defined(sun)
-+#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- #include <unistd.h>
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+--- lib/misc/codesetOld.c.orig 2008-08-08 02:01:54.000000000 -0500
++++ lib/misc/codesetOld.c
+@@ -70,7 +70,7 @@
+ #endif
+
+
+-#if defined(__FreeBSD__) || defined(sun)
++#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ static const char nul[] = {'\0', '\0'};
#else
+ static const wchar_t nul = L'\0';
+@@ -735,7 +735,7 @@ CodeSetOldGetCodeSetFromLocale(void)
+ codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new));
+ freelocale(new);
+
+-#elif defined(sun)
++#elif defined(sun) || defined(__NetBSD__)
+
+ char *locale = setlocale(LC_CTYPE, NULL);
+ if (!setlocale(LC_CTYPE, "")) {
diff --git a/sysutils/open-vm-tools/patches/patch-bb b/sysutils/open-vm-tools/patches/patch-bb
index f7252a7766b..5205b355718 100644
--- a/sysutils/open-vm-tools/patches/patch-bb
+++ b/sysutils/open-vm-tools/patches/patch-bb
@@ -1,13 +1,62 @@
-$NetBSD: patch-bb,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-bb,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- vmware-user/foreignVMToolsDaemon.c 2007/09/30 12:24:28 1.1
-+++ vmware-user/foreignVMToolsDaemon.c 2007/09/30 12:25:01
-@@ -56,7 +56,7 @@
- #include <netinet/tcp.h>
- #include <arpa/inet.h>
- #include <fcntl.h>
--#if defined(__FreeBSD__) || defined(sun)
-+#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- #include <unistd.h>
- #else
- #include <linux/unistd.h>
+--- lib/misc/idLinux.c.orig 2008-08-08 02:01:54.000000000 -0500
++++ lib/misc/idLinux.c
+@@ -99,7 +99,7 @@ static AuthorizationRef IdAuthCreateWith
+ #endif
+
+
+-#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__)
++#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ /*
+ *----------------------------------------------------------------------------
+ *
+@@ -163,6 +163,9 @@ Id_SetGid(gid_t egid) // IN: new egid
+ #elif defined(__FreeBSD__)
+ Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
+ return -1;
++#elif defined(__NetBSD__)
++ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
++ return -1;
+ #else
+ if (uid32) {
+ int r = syscall(SYS_setgid32, egid);
+@@ -207,6 +210,9 @@ Id_SetRESUid(uid_t uid, // IN: new uid
+ #elif defined(__FreeBSD__)
+ Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
+ return -1;
++#elif defined(__NetBSD__)
++ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
++ return -1;
+ #else
+ if (uid32) {
+ int r = syscall(SYS_setresuid32, uid, euid, suid);
+@@ -249,6 +255,9 @@ Id_SetRESGid(gid_t gid, // IN: new gid
+ #elif defined(__FreeBSD__)
+ Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
+ return -1;
++#elif defined(__NetBSD__)
++ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
++ return -1;
+ #else
+ if (uid32) {
+ int r = syscall(SYS_setresgid32, gid, egid, sgid);
+@@ -295,6 +304,9 @@ Id_SetREUid(uid_t uid, // IN: new uid
+ #elif defined(__FreeBSD__)
+ Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
+ return -1;
++#elif defined(__NetBSD__)
++ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
++ return -1;
+ #else
+ if (uid32) {
+ int r = syscall(SYS_setreuid32, uid, euid);
+@@ -308,7 +320,7 @@ Id_SetREUid(uid_t uid, // IN: new uid
+ }
+
+
+-#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__)
++#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ /*
+ *----------------------------------------------------------------------------
+ *
diff --git a/sysutils/open-vm-tools/patches/patch-bc b/sysutils/open-vm-tools/patches/patch-bc
index c98d6332cff..8bf40f09ff3 100644
--- a/sysutils/open-vm-tools/patches/patch-bc
+++ b/sysutils/open-vm-tools/patches/patch-bc
@@ -1,22 +1,89 @@
-$NetBSD: patch-bc,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $
+$NetBSD: patch-bc,v 1.2 2008/08/31 06:36:48 scottr Exp $
---- lib/dnd/dndLinux.c 2007/09/30 13:19:05 1.1
-+++ lib/dnd/dndLinux.c 2007/09/30 13:19:37
-@@ -37,7 +37,7 @@
- #include "util.h"
- #include "escape.h"
- #include "su.h"
--#if defined(linux) || defined(sun) || defined(__FreeBSD__)
-+#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
- #include "vmblock.h"
- #include "mntinfo.h"
+--- lib/misc/posixPosix.c.orig 2008-08-08 02:01:54.000000000 -0500
++++ lib/misc/posixPosix.c
+@@ -50,7 +50,7 @@
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ #include <CoreFoundation/CoreFoundation.h>
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ #elif !defined(N_PLAT_NLM)
+@@ -77,6 +77,7 @@
+ # endif
+
+ #include "vmware.h"
++#include "vm_atomic.h"
+ #include "posixInt.h"
+ #if defined(sun)
+ #include "hashTable.h" // For setenv emulation
+@@ -1578,7 +1579,7 @@ GetpwInternal(struct passwd *pw) // IN:
+ spw.pw_gecos = NULL;
+ free(spw.pw_shell);
+ spw.pw_shell = NULL;
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ free(spw.pw_class);
+ spw.pw_class = NULL;
+ #endif
+@@ -1586,10 +1587,12 @@ GetpwInternal(struct passwd *pw) // IN:
+ /* Fill out structure with new values. */
+ spw.pw_uid = pw->pw_uid;
+ spw.pw_gid = pw->pw_gid;
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ spw.pw_change = pw->pw_change;
+ spw.pw_expire = pw->pw_expire;
++# if defined(__FreeBSD__)
+ spw.pw_fields = pw->pw_fields;
++# endif
#endif
-@@ -327,7 +327,7 @@
+
+ #if !defined(sun)
+@@ -1617,7 +1620,7 @@ GetpwInternal(struct passwd *pw) // IN:
+ (spw.pw_shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) {
+ goto exit;
+ }
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ if (pw->pw_class &&
+ (spw.pw_class = Unicode_Alloc(pw->pw_class, STRING_ENCODING_DEFAULT)) == NULL) {
+ goto exit;
+@@ -1634,7 +1637,7 @@ exit:
+ }
- /* We need to make this suck less. */
--#if defined(linux) || defined(sun) || defined(__FreeBSD__)
-+#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+-#if !defined(sun) // {
++#if !defined(sun) && !defined(__NetBSD__) // {
+
/*
- *----------------------------------------------------------------------------
+ *----------------------------------------------------------------------
+@@ -1902,7 +1905,7 @@ PasswdCopy(struct passwd *orig, // IN
+ if (!CopyFieldIntoBuf(orig->pw_shell, &new->pw_shell, &buf, &bufLen)) {
+ return NULL;
+ }
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ if (!CopyFieldIntoBuf(orig->pw_class, &new->pw_class, &buf, &bufLen)) {
+ return NULL;
+ }
+@@ -2647,7 +2650,7 @@ Posix_Getgrnam_r(ConstUnicode name, /
+
+ #if !defined(sun) // {
+
+-#if !defined(__APPLE__) && !defined(__FreeBSD__) // {
++#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) // {
+ /*
+ *----------------------------------------------------------------------
*
+@@ -3030,7 +3033,7 @@ Posix_Fprintf(FILE *stream,
+ }
+
+
+-#endif // } !defined(__APPLE__) && !defined(__FreeBSD)
++#endif // } !defined(__APPLE__) && !defined(__FreeBSD) && !defined(__NetBSD__)
+
+
+ #else // } !defined(sun) {
diff --git a/sysutils/open-vm-tools/patches/patch-bd b/sysutils/open-vm-tools/patches/patch-bd
new file mode 100644
index 00000000000..22952c26866
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bd
@@ -0,0 +1,22 @@
+$NetBSD: patch-bd,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/misc/util_misc.c.orig 2008-08-08 02:01:54.000000000 -0500
++++ lib/misc/util_misc.c
+@@ -47,7 +47,7 @@
+ # include <pwd.h>
+ #endif
+
+-#if defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <pthread.h>
+ #endif
+
+@@ -481,7 +481,7 @@ Util_GetCurrentThreadId(void)
+ tid = getpid();
+ ASSERT(tid != (pid_t)-1);
+ return tid;
+-#elif defined(__APPLE__) || defined(__FreeBSD__)
++#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ ASSERT_ON_COMPILE(sizeof(Util_ThreadID) == sizeof(pthread_t));
+ return pthread_self();
+ #elif defined(_WIN32)
diff --git a/sysutils/open-vm-tools/patches/patch-be b/sysutils/open-vm-tools/patches/patch-be
new file mode 100644
index 00000000000..031ba551528
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-be
@@ -0,0 +1,40 @@
+$NetBSD: patch-be,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/netUtil/netUtilLinux.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/netUtil/netUtilLinux.c
+@@ -31,7 +31,7 @@
+ #endif
+
+
+-#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ # error This file should not be compiled
+ #endif
+
+@@ -58,7 +58,7 @@
+ #include <net/if.h>
+ #include <sys/ioctl.h>
+
+-#if defined(__FreeBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+ #include "ifaddrs.h"
+ #endif
+
+@@ -94,7 +94,7 @@
+ *----------------------------------------------------------------------
+ */
+
+-#if !defined(__FreeBSD__) && !defined(__APPLE__) /* { */
++#if !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__NetBSD__) /* { */
+ char *
+ NetUtil_GetPrimaryIP(void)
+ {
+@@ -168,7 +168,7 @@ error:
+ return NULL;
+ }
+
+-#else /* } FreeBSD || APPLE { */
++#else /* } FreeBSD || APPLE || NetBSD { */
+
+ char *
+ NetUtil_GetPrimaryIP(void)
diff --git a/sysutils/open-vm-tools/patches/patch-bf b/sysutils/open-vm-tools/patches/patch-bf
new file mode 100644
index 00000000000..f8608d3c23f
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bf
@@ -0,0 +1,31 @@
+$NetBSD: patch-bf,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/procMgr/procMgrPosix.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/procMgr/procMgrPosix.c
+@@ -31,7 +31,7 @@
+ // pull in setresuid()/setresgid() if possible
+ #define _GNU_SOURCE
+ #include <unistd.h>
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ #include <asm/param.h>
+ #include <locale.h>
+ #include <sys/stat.h>
+@@ -158,7 +158,7 @@ ProcMgr_ProcList *
+ ProcMgr_ListProcesses(void)
+ {
+ ProcMgr_ProcList *procList = NULL;
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ Bool failed = FALSE;
+ DynBuf dbProcId;
+ DynBuf dbProcCmd;
+@@ -453,7 +453,7 @@ abort:
+ ProcMgr_FreeProcList(procList);
+ procList = NULL;
+ }
+-#endif // !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#endif // !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+
+ return procList;
+ }
diff --git a/sysutils/open-vm-tools/patches/patch-bg b/sysutils/open-vm-tools/patches/patch-bg
new file mode 100644
index 00000000000..755e93a5c1d
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bg
@@ -0,0 +1,24 @@
+$NetBSD: patch-bg,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/string/str.c.orig 2008-08-08 02:01:55.000000000 -0500
++++ lib/string/str.c
+@@ -37,6 +37,10 @@
+ #endif
+ #include "codeset.h"
+
++#ifdef __NetBSD__
++#include <wchar.h>
++#endif
++
+ #if defined _WIN32 && !defined HAS_BSD_PRINTF
+ #define vsnprintf _vsnprintf
+ #endif
+@@ -604,7 +608,7 @@ Str_SafeVasprintf(size_t *length,
+ return StrVasprintf_Internal(length, format, arguments, TRUE);
+ }
+
+-#if defined(_WIN32) || defined(GLIBC_VERSION_22)
++#if defined(_WIN32) || (defined(GLIBC_VERSION_22) && !defined(__NetBSD__))
+
+ /*
+ *----------------------------------------------------------------------
diff --git a/sysutils/open-vm-tools/patches/patch-bh b/sysutils/open-vm-tools/patches/patch-bh
new file mode 100644
index 00000000000..99814cf17d4
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bh
@@ -0,0 +1,31 @@
+$NetBSD: patch-bh,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/system/systemLinux.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/system/systemLinux.c
+@@ -26,7 +26,7 @@
+ *
+ */
+
+-#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ # error This file should not be compiled
+ #endif
+
+@@ -55,7 +55,7 @@
+ #include <net/if.h>
+ #include <sys/ioctl.h>
+
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ #include "ifaddrs.h"
+ #endif
+
+@@ -352,7 +352,7 @@ System_Shutdown(Bool reboot) // IN: "re
+ if (reboot) {
+ cmd = "shutdown -r now";
+ } else {
+-#if __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ cmd = "shutdown -p now";
+ #else
+ cmd = "shutdown -h now";
diff --git a/sysutils/open-vm-tools/patches/patch-bi b/sysutils/open-vm-tools/patches/patch-bi
new file mode 100644
index 00000000000..3edc79b3edd
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bi
@@ -0,0 +1,13 @@
+$NetBSD: patch-bi,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/unicode/unicodeSimpleTypes.c.orig 2008-08-08 02:01:55.000000000 -0500
++++ lib/unicode/unicodeSimpleTypes.c
+@@ -2198,7 +2198,7 @@ UnicodeNormalizeEncodingName(const char
+
+ for (currentResult = result; *encodingName != '\0'; encodingName++) {
+ if (isalnum((int) *encodingName)) {
+- *currentResult = tolower(*encodingName);
++ *currentResult = tolower((int)(*encodingName));
+ currentResult++;
+ }
+ }
diff --git a/sysutils/open-vm-tools/patches/patch-bj b/sysutils/open-vm-tools/patches/patch-bj
new file mode 100644
index 00000000000..92b862629ce
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bj
@@ -0,0 +1,38 @@
+$NetBSD: patch-bj,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/user/hostinfoPosix.c.orig 2008-08-08 02:01:55.000000000 -0500
++++ lib/user/hostinfoPosix.c
+@@ -894,8 +894,8 @@ HostinfoGetCpuInfo(int nCpu, //
+ e = s + strlen(s);
+
+ /* Skip leading and trailing while spaces */
+- for (; s < e && isspace(*s); s++);
+- for (; s < e && isspace(e[-1]); e--);
++ for (; s < e && isspace((unsigned)*s); s++);
++ for (; s < e && isspace((unsigned)e[-1]); e--);
+ *e = 0;
+
+ /* Free previous value */
+@@ -1224,7 +1224,9 @@ Hostinfo_ResetProcessState(const int *ke
+ {
+ int s, fd;
+ struct sigaction sa;
++#ifdef RLIMIT_AS
+ struct rlimit rlim;
++#endif
+ #ifdef __linux__
+ int err;
+ uid_t euid;
+@@ -1260,10 +1262,12 @@ Hostinfo_ResetProcessState(const int *ke
+ }
+ }
+
++#ifdef RLIMIT_AS
+ if (getrlimit(RLIMIT_AS, &rlim) == 0) {
+ rlim.rlim_cur = rlim.rlim_max;
+ setrlimit(RLIMIT_AS, &rlim);
+ }
++#endif
+
+ #ifdef __linux__
+ /*
diff --git a/sysutils/open-vm-tools/patches/patch-bk b/sysutils/open-vm-tools/patches/patch-bk
new file mode 100644
index 00000000000..6e46e0ede76
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bk
@@ -0,0 +1,31 @@
+$NetBSD: patch-bk,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/user/utilPosix.c.orig 2008-08-08 02:01:55.000000000 -0500
++++ lib/user/utilPosix.c
+@@ -35,7 +35,7 @@
+ #include <errno.h>
+ #include <dirent.h>
+
+-#if !__FreeBSD__ && !sun
++#if !__FreeBSD__ && !sun && !__NetBSD__
+ # include <pwd.h>
+ #endif
+
+@@ -85,7 +85,7 @@
+
+
+
+-#if !__FreeBSD__ && !sun
++#if !__FreeBSD__ && !sun && !__NetBSD__
+
+ /*
+ *-----------------------------------------------------------------------------
+@@ -624,7 +624,7 @@ Util_GetSafeTmpDir(Bool useConf) // IN
+ #endif // __linux__
+
+
+-#if defined(__linux__) || defined(__FreeBSD__) || defined(sun)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ /*
+ *----------------------------------------------------------------------------
+ *
diff --git a/sysutils/open-vm-tools/patches/patch-bl b/sysutils/open-vm-tools/patches/patch-bl
new file mode 100644
index 00000000000..7d9661d4fdb
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bl
@@ -0,0 +1,67 @@
+$NetBSD: patch-bl,v 1.1 2008/08/31 06:36:48 scottr Exp $
+
+--- lib/vixTools/vixTools.c.orig 2008-08-08 02:01:53.000000000 -0500
++++ lib/vixTools/vixTools.c
+@@ -74,7 +74,7 @@
+ #endif
+
+ /* Only Windows and Linux use impersonation functions. */
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ #include "impersonate.h"
+ #endif
+
+@@ -702,7 +702,7 @@ VixTools_GetToolsPropertiesImpl(GuestApp
+ VixPropertyListImpl propList;
+ char *serializedBuffer = NULL;
+ size_t serializedBufferLength = 0;
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ char guestName[512];
+ int osFamily;
+ char *packageList = NULL;
+@@ -937,7 +937,7 @@ VixToolsSetProperties(VixCommandRequestH
+ GuestApp_Dict **confDictRef) // IN
+ {
+ VixError err = VIX_OK;
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ size_t serialBufferLength;
+ char *serialBuffer = NULL;
+ VixPropertyListImpl propList;
+@@ -1734,7 +1734,7 @@ VixToolsMoveFile(VixCommandRequestHeader
+ * Be careful. Renaming a file to itself can cause it to be deleted.
+ * This should be a no-op anyway.
+ */
+-#if !defined(sun) && !defined(__FreeBSD__)
++#if !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ if (File_IsSameFile(srcFilePathName, destFilePathName)) {
+ err = VIX_OK;
+ goto abort;
+@@ -2716,7 +2716,7 @@ VixToolsImpersonateUserImplEx(char const
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+-#if defined(__FreeBSD__) || defined(sun)
++#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ err = VIX_E_NOT_SUPPORTED;
+ ///////////////////////////////////////////////////////////////////////
+ #elif defined(_WIN32) || defined(linux)
+@@ -2913,7 +2913,7 @@ VixToolsLogoutUser(void *userToken) /
+ return;
+ }
+
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ if (NULL != userToken) {
+ AuthToken authToken = (AuthToken) userToken;
+ Auth_CloseToken(authToken);
+@@ -3105,7 +3105,7 @@ VixToolsProcessHgfsPacket(VixCommandHgfs
+ hgfsPacket = ((char *) requestMsg) + sizeof(*requestMsg);
+ hgfsPacketSize = requestMsg->hgfsPacketSize;
+
+-#if !defined(N_PLAT_NLM) && !defined(__FreeBSD__)
++#if !defined(N_PLAT_NLM) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ /*
+ * Impersonation was okay, so let's give our packet to
+ * the HGFS server and forward the reply packet back.
diff --git a/sysutils/open-vm-tools/patches/patch-bm b/sysutils/open-vm-tools/patches/patch-bm
new file mode 100644
index 00000000000..7e7ba29b09e
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bm
@@ -0,0 +1,72 @@
+$NetBSD: patch-bm,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- lib/wiper/wiperPosix.c.orig 2008-08-08 02:01:55.000000000 -0500
++++ lib/wiper/wiperPosix.c
+@@ -23,7 +23,7 @@
+ *
+ */
+
+-#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__)
++#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__NetBSD__)
+ #error This file should not be compiled on this platform.
+ #endif
+
+@@ -31,12 +31,12 @@
+ #include <sys/stat.h>
+ #if defined(__linux__) || defined(sun)
+ # include <sys/vfs.h>
+-#elif defined(__FreeBSD__) || defined(__APPLE__)
++#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+ # include <sys/param.h>
+ # include <sys/ucred.h>
+ # include <sys/mount.h>
+ # include <fstab.h>
+-# if __FreeBSD_version >= 500000
++# if defined(__FreeBSD__) && __FreeBSD_version >= 500000
+ # include <libgen.h>
+ # endif /* __FreeBSD_version < 500000 */
+ #endif
+@@ -66,7 +66,7 @@
+
+ #if defined(sun) || defined(__linux__)
+ # define PROCFS "proc"
+-#elif defined(__FreeBSD__) || defined(__APPLE__)
++#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+ # define PROCFS "procfs"
+ #endif
+
+@@ -196,7 +196,7 @@ WiperIsDiskDevice(MNTINFO *mnt,
+ return TRUE;
+ }
+
+-#elif defined(__FreeBSD__) || defined(__APPLE__) /* } FreeBSD { */
++#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) /* } FreeBSD { */
+
+ static INLINE Bool
+ WiperIsDiskDevice(MNTINFO *mnt, // IN: file system being considered
+@@ -210,7 +210,7 @@ WiperIsDiskDevice(MNTINFO *mnt,
+ * function, as a whole, does not even apply to OS X, so this caveat is
+ * only minor.
+ */
+-#if __FreeBSD_version < 500000
++#if defined(__NetBSD__) || __FreeBSD_version < 500000
+ /*
+ * Before FreeBSD 5, device nodes had static major/minor numbers.
+ * (FreeBSD 5 included devfs which got rid of this concept.) So
+@@ -511,14 +511,14 @@ WiperSinglePartition_GetSpace(const Wipe
+ uint64 *free, // OUT
+ uint64 *total) // OUT
+ {
+-#ifdef sun
++#if defined(sun) || defined(__NetBSD__)
+ struct statvfs statfsbuf;
+ #else
+ struct statfs statfsbuf;
+ #endif
+ ASSERT(p);
+
+-#ifdef sun
++#if defined(sun) || defined(__NetBSD__)
+ if (statvfs(p->mountPoint, &statfsbuf) < 0) {
+ #else
+ if (Posix_Statfs(p->mountPoint, &statfsbuf) < 0) {
diff --git a/sysutils/open-vm-tools/patches/patch-bn b/sysutils/open-vm-tools/patches/patch-bn
new file mode 100644
index 00000000000..1a221d154f2
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bn
@@ -0,0 +1,37 @@
+$NetBSD: patch-bn,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- scripts/netbsd/poweroff-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
++++ scripts/netbsd/poweroff-vm-default
+@@ -0,0 +1,32 @@
++#!/bin/sh
++##########################################################
++# Copyright (C) 2004-2008 VMware, Inc. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published
++# by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public
++# License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public License
++# along with this program; if not, write to the Free Software Foundation, Inc.,
++# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++#
++##########################################################
++
++##########################################################################
++# DO NOT modify this file directly as it will be overwritten the next
++# time the VMware Tools are installed.
++##########################################################################
++
++echo `date` ": Executing '$0'"
++
++scriptsdir="`dirname $0`/scripts/`basename $0`.d"
++if [ -d "$scriptsdir" ]; then
++ for scriptfile in "$scriptsdir"/*; do
++ [ -x "$scriptfile" ] && "$scriptfile" poweroff-vm
++ done
++fi
diff --git a/sysutils/open-vm-tools/patches/patch-bo b/sysutils/open-vm-tools/patches/patch-bo
new file mode 100644
index 00000000000..455b36bcf1f
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bo
@@ -0,0 +1,37 @@
+$NetBSD: patch-bo,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- scripts/netbsd/poweron-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
++++ scripts/netbsd/poweron-vm-default
+@@ -0,0 +1,32 @@
++#!/bin/sh
++##########################################################
++# Copyright (C) 2004-2008 VMware, Inc. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published
++# by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public
++# License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public License
++# along with this program; if not, write to the Free Software Foundation, Inc.,
++# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++#
++##########################################################
++
++##########################################################################
++# DO NOT modify this file directly as it will be overwritten the next
++# time the VMware Tools are installed.
++##########################################################################
++
++echo `date` ": Executing '$0'"
++
++scriptsdir="`dirname $0`/scripts/`basename $0`.d"
++if [ -d "$scriptsdir" ]; then
++ for scriptfile in "$scriptsdir"/*; do
++ [ -x "$scriptfile" ] && "$scriptfile" poweron-vm
++ done
++fi
diff --git a/sysutils/open-vm-tools/patches/patch-bp b/sysutils/open-vm-tools/patches/patch-bp
new file mode 100644
index 00000000000..139b2617941
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bp
@@ -0,0 +1,40 @@
+$NetBSD: patch-bp,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- scripts/netbsd/resume-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
++++ scripts/netbsd/resume-vm-default
+@@ -0,0 +1,35 @@
++#!/bin/sh
++##########################################################
++# Copyright (C) 2004-2008 VMware, Inc. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published
++# by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public
++# License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public License
++# along with this program; if not, write to the Free Software Foundation, Inc.,
++# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++#
++##########################################################
++
++##########################################################################
++# DO NOT modify this file directly as it will be overwritten the next
++# time the VMware Tools are installed.
++##########################################################################
++
++echo `date` ": Executing '$0'"
++
++scriptsdir="`dirname $0`/scripts/`basename $0`.d"
++if [ -d "$scriptsdir" ]; then
++ for scriptfile in "$scriptsdir"/*; do
++ [ -x "$scriptfile" ] && "$scriptfile" resume-vm
++ done
++fi
++
++# Start the network.
++/etc/rc.d/dhclient start
diff --git a/sysutils/open-vm-tools/patches/patch-bq b/sysutils/open-vm-tools/patches/patch-bq
new file mode 100644
index 00000000000..f05df9d2d37
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bq
@@ -0,0 +1,42 @@
+$NetBSD: patch-bq,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- scripts/netbsd/suspend-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
++++ scripts/netbsd/suspend-vm-default
+@@ -0,0 +1,37 @@
++#!/bin/sh
++##########################################################
++# Copyright (C) 2004-2008 VMware, Inc. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published
++# by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public
++# License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public License
++# along with this program; if not, write to the Free Software Foundation, Inc.,
++# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++#
++##########################################################
++
++##########################################################################
++# DO NOT modify this file directly as it will be overwritten the next
++# time the VMware Tools are installed.
++##########################################################################
++
++echo `date` ": Executing '$0'"
++
++scriptsdir="`dirname $0`/scripts/`basename $0`.d"
++if [ -d "$scriptsdir" ]; then
++ for scriptfile in "$scriptsdir"/*; do
++ [ -x "$scriptfile" ] && "$scriptfile" suspend-vm
++ done
++fi
++
++ps auxw | grep -q dhclient
++if [ "$?" -eq 0 ]; then
++ dhclient -r
++fi
diff --git a/sysutils/open-vm-tools/patches/patch-br b/sysutils/open-vm-tools/patches/patch-br
new file mode 100644
index 00000000000..e1b6c55fb3c
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-br
@@ -0,0 +1,16 @@
+$NetBSD: patch-br,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- toolbox/toolbox-cmd.c.orig 2008-08-08 02:01:57.000000000 -0500
++++ toolbox/toolbox-cmd.c
+@@ -43,7 +43,10 @@ typedef void (*ToolboxHelpFunc)(char *pr
+ * Local Data
+ */
+
+-const typedef struct CmdTable {
++#if !defined(__NetBSD__) || __NetBSD_Version__ >= 400000000 // Work around gcc? const-const issue
++const
++#endif
++typedef struct CmdTable {
+ const char *command; /* The name of the command. */
+ ToolboxCmdFunc func; /* The function to execute. */
+ Bool requireRoot; /* Indicates whether root is required. */
diff --git a/sysutils/open-vm-tools/patches/patch-bs b/sysutils/open-vm-tools/patches/patch-bs
new file mode 100644
index 00000000000..0a266994fab
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bs
@@ -0,0 +1,13 @@
+$NetBSD: patch-bs,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- vmware-user-suid-wrapper/locationsdb.c.orig 2008-08-08 02:01:56.000000000 -0500
++++ vmware-user-suid-wrapper/locationsdb.c
+@@ -26,7 +26,7 @@
+ * link against lib/unixinstall.
+ */
+
+-#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux)
++#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) && !defined(__NetBSD__)
+ # error This program is not supported on your platform.
+ #endif
+
diff --git a/sysutils/open-vm-tools/patches/patch-bt b/sysutils/open-vm-tools/patches/patch-bt
new file mode 100644
index 00000000000..4ec7306391d
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bt
@@ -0,0 +1,13 @@
+$NetBSD: patch-bt,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- vmware-user-suid-wrapper/main.c.orig 2008-08-08 02:01:56.000000000 -0500
++++ vmware-user-suid-wrapper/main.c
+@@ -28,7 +28,7 @@
+ * remove blocks in the blocking file system.
+ */
+
+-#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux)
++#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) && !defined(__NetBSD__)
+ # error This program is not supported on your platform.
+ #endif
+
diff --git a/sysutils/open-vm-tools/patches/patch-bu b/sysutils/open-vm-tools/patches/patch-bu
new file mode 100644
index 00000000000..63400c0be36
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bu
@@ -0,0 +1,145 @@
+$NetBSD: patch-bu,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- vmware-user-suid-wrapper/wrapper-netbsd.c.orig 2008-08-19 17:54:40.000000000 -0500
++++ vmware-user-suid-wrapper/wrapper-netbsd.c
+@@ -0,0 +1,140 @@
++/*********************************************************
++ * Copyright (C) 2007 VMware, Inc. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as published
++ * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public
++ * License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * along with this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ *********************************************************/
++
++/*
++ * wrapper.c --
++ *
++ * Platform specific code for the VMware User Agent setuid wrapper.
++ */
++
++
++#include <sys/param.h>
++#include <sys/mount.h>
++// #include <sys/uio.h> // for nmount(2)
++
++#include <errno.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
++#include "vmware.h"
++#include "wrapper.h"
++
++
++/*
++ * Global functions
++ */
++
++
++#ifdef USES_LOCATIONS_DB
++/*
++ *-----------------------------------------------------------------------------
++ *
++ * BuildExecPath --
++ *
++ * Determine & return path of vmware-user for use by execve(2).
++ *
++ * Results:
++ * TRUE on success, FALSE otherwise
++ *
++ * Side effects:
++ * None.
++ *
++ *-----------------------------------------------------------------------------
++ */
++
++Bool
++BuildExecPath(char *execPath, // OUT: Buffer to store executable's path
++ size_t execPathSize) // IN : size of execPath buffer
++{
++ char tmpPath[MAXPATHLEN];
++ int execLen;
++
++ /*
++ * The locations database is the only path that's fixed, and it contains the
++ * paths to all the other paths selected during Tools configuration. The
++ * locations database file is only writable by root, so we can trust it.
++ */
++ if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_BINDIR, tmpPath, sizeof tmpPath)) {
++ Error("could not obtain BINDIR\n");
++ return FALSE;
++ }
++
++ if (strlcat(tmpPath,
++ "/vmware-user-wrapper", sizeof tmpPath) >= sizeof tmpPath) {
++ Error("could not construct program filename\n");
++ return FALSE;
++ }
++
++ /*
++ * From readlink(2), "The readlink() system call does not append a NUL
++ * character to buf." (NB: This breaks if user ever replaces the symlink
++ * with the target.)
++ */
++ if ((execLen = readlink(tmpPath, execPath, execPathSize - 1)) == -1) {
++ Error("could not resolve symlink: %s\n", strerror(errno));
++ return FALSE;
++ }
++
++ execPath[execLen] = '\0';
++
++ /*
++ * Now make sure that the target is actually part of our "trusted"
++ * directory. (Check that execPath has LIBDIR as a prefix and does
++ * not contain "..".)
++ */
++ if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_LIBDIR, tmpPath,
++ sizeof tmpPath)) {
++ Error("could not obtain LIBDIR\n");
++ return FALSE;
++ }
++
++ if ((strncmp(execPath, tmpPath, strlen(tmpPath)) != 0) ||
++ (strstr(execPath, "..") != NULL)) {
++ Error("vmware-user path untrusted\n");
++ return FALSE;
++ }
++
++ return TRUE;
++}
++#endif // ifdef USES_LOCATIONS_DB
++
++
++/*
++ *----------------------------------------------------------------------------
++ *
++ * CompatExec --
++ *
++ * Simple platform-dependent execve() wrapper.
++ *
++ * Results:
++ * False.
++ *
++ * Side effects:
++ * This function may not return.
++ *
++ *----------------------------------------------------------------------------
++ */
++
++Bool
++CompatExec(const char *path, char * const argv[], char * const envp[])
++{
++ execve(path, argv, envp);
++ return FALSE;
++}
diff --git a/sysutils/open-vm-tools/patches/patch-bv b/sysutils/open-vm-tools/patches/patch-bv
new file mode 100644
index 00000000000..37867d89011
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bv
@@ -0,0 +1,13 @@
+$NetBSD: patch-bv,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- vmware-user/foreignVMToolsDaemon.c.orig 2008-08-08 02:01:56.000000000 -0500
++++ vmware-user/foreignVMToolsDaemon.c
+@@ -55,7 +55,7 @@
+ #include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ #include <fcntl.h>
+-#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) || defined(__NetBSD__)
+ #include <unistd.h>
+ #else
+ #include <linux/unistd.h>
diff --git a/sysutils/open-vm-tools/patches/patch-bw b/sysutils/open-vm-tools/patches/patch-bw
new file mode 100644
index 00000000000..56cf3ca94bd
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-bw
@@ -0,0 +1,13 @@
+$NetBSD: patch-bw,v 1.1 2008/08/31 06:36:49 scottr Exp $
+
+--- vmware-user/foreignVMToolsDaemon.h.orig 2008-08-08 02:01:56.000000000 -0500
++++ vmware-user/foreignVMToolsDaemon.h
+@@ -59,7 +59,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock
+
+ #ifdef __APPLE__
+ #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+-#elif defined(__FreeBSD__) || defined(sun)
++#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ #include <unistd.h>
+ #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+ #else