$OpenBSD: patch-kjs_collector_cpp,v 1.3 2008/01/29 00:24:41 espie Exp $
--- kjs/collector.cpp.orig	Sat Jan  5 00:59:52 2008
+++ kjs/collector.cpp	Mon Jan 28 00:23:31 2008
@@ -475,6 +475,12 @@ void Collector::markCurrentThreadConservatively()
     static pthread_t stackThread;
     pthread_t thread = pthread_self();
     if (stackBase == 0 || thread != stackThread) {
+#if defined(__OpenBSD__)
+	stack_t sinfo;
+	pthread_stackseg_np(thread, &sinfo);
+	stackBase = (char *)sinfo.ss_sp - sinfo.ss_size;
+        stackThread = thread;
+#else
         pthread_attr_t sattr;
 #if HAVE(PTHREAD_NP_H) || defined(__NetBSD__)
         // e.g. on FreeBSD 5.4, neundorf@kde.org
@@ -495,10 +501,11 @@ void Collector::markCurrentThreadConservatively()
         pthread_attr_getstackaddr(&sattr, &stackBase);
         assert(stackBase);
         stackThread = thread;
-    }
+#endif
 #else
 #error Need a way to get the stack base on this platform
 #endif
+    }
 
     void *dummy;
     void *stackPointer = &dummy;
