diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index d368fa29f3d36a0c9dcb487caf5a98d065ccebbd..6c12355de7ec06b79fab3430a20481472b0d3156 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -3871,7 +3871,8 @@ SystemInformation::LongLong SystemInformationImplementation::GetProcessId()
 {
 #if defined(_WIN32)
   return GetCurrentProcessId();
-#elif defined(__linux) || defined(__APPLE__)
+#elif defined(__linux) || defined(__APPLE__) || defined(__OpenBSD__) ||       \
+  defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
   return getpid();
 #else
   return -1;