Index: stage0/src/runtime/process.cpp
--- stage0/src/runtime/process.cpp.orig
+++ stage0/src/runtime/process.cpp
@@ -341,6 +341,8 @@ extern "C" LEAN_EXPORT uint64_t lean_io_get_tid() {
     uint64_t tid;
 #ifdef __APPLE__
     lean_always_assert(pthread_threadid_np(NULL, &tid) == 0);
+#elif defined(__OpenBSD__)
+    tid = getthrid();
 #elif defined(LEAN_EMSCRIPTEN)
     tid = 0;
 #else
@@ -431,7 +433,7 @@ static optional<pipe> setup_stdio(stdio cfg) {
     lean_unreachable();
 }
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__OpenBSD__)
 extern "C" char **environ;
 #endif
 
@@ -454,7 +456,7 @@ static obj_res spawn(string_ref const & proc_name, arr
 
     if (pid == 0) {
         if (!inherit_env) {
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__OpenBSD__)
             environ = NULL;
 #else
             clearenv();
