When running "vmtoolsd -b pidfile" on Linux arm64, we hit this error:
[error] [vmsvc] NOT_IMPLEMENTED hostinfoPosix.c:2526
Linux arm64 does not implement iopl() and the Hostinfo_ResetProcessState()
is raising a NOT_IMPLEMENTED() because of that. However if there's no iopl(),
there is no reason to drop IO privileges, so we can just skip that code.
This change also restores usage of getloadavg() for non Android arm64
platforms: ESX vmx and tools for Linux arm64.
#if defined __ANDROID__ || defined __aarch64__
/*
- * Android doesn't support getloadavg() or iopl().
+ * Android and arm64 do not support iopl().
*/
-#define NO_GETLOADAVG
#define NO_IOPL
#endif
+#if defined __ANDROID__
+/*
+ * Android doesn't support getloadavg().
+ */
+#define NO_GETLOADAVG
+#endif
+
/*
*----------------------------------------------------------------------
}
#ifdef __linux__
+#ifndef NO_IOPL
/*
* Drop iopl to its default value.
* iopl() is not implemented in userworlds
privileges --hpreg */
ASSERT(euid != 0 || getuid() == 0);
Id_SetEUid(0);
-#if defined NO_IOPL
- NOT_IMPLEMENTED();
- errno = ENOSYS;
-#else
err = iopl(0);
-#endif
Id_SetEUid(euid);
VERIFY(err == 0);
}
#endif
+#endif
}