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
63 lines
2.2 KiB
Text
63 lines
2.2 KiB
Text
$NetBSD: patch-an,v 1.2 2008/08/31 06:36:48 scottr Exp $
|
|
|
|
--- lib/guestInfo/guestInfoPosix.c.orig 2008-08-08 02:01:52.000000000 -0500
|
|
+++ lib/guestInfo/guestInfoPosix.c
|
|
@@ -38,10 +38,11 @@
|
|
#endif
|
|
#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
|
|
#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;
|
|
|