Index: common/Linux/LnxMisc.cpp
--- common/Linux/LnxMisc.cpp.orig
+++ common/Linux/LnxMisc.cpp
@@ -15,7 +15,6 @@
 
 #include <dbus/dbus.h>
 #include <spawn.h>
-#include <sys/sysinfo.h>
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <unistd.h>
@@ -43,45 +42,7 @@ u64 GetPhysicalMemory()
 
 u64 GetAvailablePhysicalMemory()
 {
-	// Try to read MemAvailable from /proc/meminfo.
-	FILE* file = fopen("/proc/meminfo", "r");
-	if (file)
-	{
-		u64 mem_available = 0;
-		u64 mem_free = 0, buffers = 0, cached = 0, sreclaimable = 0, shmem = 0;
-		char line[256];
-
-		while (fgets(line, sizeof(line), file))
-		{
-			// Modern kernels provide MemAvailable directly - preferred and most accurate.
-			if (sscanf(line, "MemAvailable: %lu kB", &mem_available) == 1)
-			{
-				fclose(file);
-				return mem_available * _1kb;
-			}
-
-			// Fallback values for manual approximation.
-			sscanf(line, "MemFree: %lu kB", &mem_free);
-			sscanf(line, "Buffers: %lu kB", &buffers);
-			sscanf(line, "Cached: %lu kB", &cached);
-			sscanf(line, "SReclaimable: %lu kB", &sreclaimable);
-			sscanf(line, "Shmem: %lu kB", &shmem);
-		}
-		fclose(file);
-
-		// Fallback approximation: Linux-like heuristic.
-		// available = MemFree + Buffers + Cached + SReclaimable - Shmem.
-		const u64 available_kb = mem_free + buffers + cached + sreclaimable - shmem;
-		return available_kb * _1kb;
-	}
-
-	// Fallback to sysinfo if /proc/meminfo couldn't be read.
-	struct sysinfo info = {};
-	if (sysinfo(&info) != 0)
-		return 0;
-
-	// Note: This does NOT include cached memory - only free + buffer.
-	return (static_cast<u64>(info.freeram) + static_cast<u64>(info.bufferram)) * static_cast<u64>(info.mem_unit);
+	return sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGESIZE);
 }
 
 u64 GetTickFrequency()
@@ -135,6 +96,8 @@ std::string GetOSVersionString()
 	}
 
 	return "Linux";
+#elif __OpenBSD__
+	return "OpenBSD";
 #else // freebsd
 	return "Other Unix";
 #endif
@@ -373,8 +336,12 @@ void Threading::Sleep(int ms)
 
 void Threading::SleepUntil(u64 ticks)
 {
+	const s64 diff = static_cast<s64>(ticks - GetCPUTicks());
+	if (diff <= 0)
+		return;
+
 	struct timespec ts;
-	ts.tv_sec = static_cast<time_t>(ticks / 1000000000ULL);
-	ts.tv_nsec = static_cast<long>(ticks % 1000000000ULL);
-	clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, nullptr);
+	ts.tv_sec = diff / 1000000000ULL;
+	ts.tv_nsec = diff % 1000000000ULL;
+	nanosleep(&ts, nullptr);
 }
