$NetBSD$

--- src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp.orig	2010-06-25 14:25:11.000000000 +0000
+++ src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
@@ -317,8 +317,8 @@ static void supR3HardenedGetFullExePath(
      *
      * Darwin, OS/2 and Windows all have proper APIs for getting the program file name.
      */
-#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)
-# ifdef RT_OS_LINUX
+#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) || defined(RT_OS_NETBSD)
+# if defined(RT_OS_LINUX) || defined(RT_OS_NETBSD)
     int cchLink = readlink("/proc/self/exe", &g_szSupLibHardenedExePath[0], sizeof(g_szSupLibHardenedExePath) - 1);
 
 # elif defined(RT_OS_SOLARIS)
@@ -743,7 +743,7 @@ static void supR3HardenedMainDropPrivile
     egid = getegid();
     rgid = sgid = getgid();
 
-# elif defined(RT_OS_SOLARIS)
+# elif defined(RT_OS_SOLARIS) || defined(RT_OS_NETBSD)
     /* Solaris doesn't have setresuid, but the setreuid interface is BSD
        compatible and will set the saved uid to euid when we pass it a ruid
        that isn't -1 (which we do). */
