Index: src/platform-freebsd.cc |
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc |
index 3ec02b780c047ca157163384cb056c37c39d5c70..c2cf6cbaec814fae4686e4d04e0e0aaec57afb17 100644 |
--- a/src/platform-freebsd.cc |
+++ b/src/platform-freebsd.cc |
@@ -43,12 +43,15 @@ |
#include <sys/fcntl.h> // open |
#include <unistd.h> // getpagesize |
// If you don't have execinfo.h then you need devel/libexecinfo from ports. |
-#include <execinfo.h> // backtrace, backtrace_symbols |
#include <strings.h> // index |
#include <errno.h> |
#include <stdarg.h> |
#include <limits.h> |
+#if !defined(__DragonFly__) |
Sven Panne
2013/01/02 08:06:46
One general comment about such #ifs: Instead of sc
|
+#include <execinfo.h> // backtrace, backtrace_symbols |
+#endif |
+ |
#undef MAP_TYPE |
#include "v8.h" |
@@ -296,6 +299,9 @@ void OS::SignalCodeMovingGC() { |
int OS::StackWalk(Vector<OS::StackFrame> frames) { |
+#if defined(__DragonFly__) |
+ return 0; |
+#else |
int frames_size = frames.length(); |
ScopedVector<void*> addresses(frames_size); |
@@ -320,6 +326,7 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) { |
free(symbols); |
return frames_count; |
+#endif |
} |
@@ -618,6 +625,13 @@ void FreeBSDSemaphore::Wait() { |
bool FreeBSDSemaphore::Wait(int timeout) { |
+#if defined(__DragonFly__) |
+ /* DragonFlyBSD lacks sem_timedwait() and there is no good way to emulate it. |
+ */ |
+ if (sem_wait(&sem_)) abort(); |
+ USE(timeout); |
+ return true; |
+#else |
const long kOneSecondMicros = 1000000; // NOLINT |
// Split timeout into second and nanosecond parts. |
@@ -643,6 +657,7 @@ bool FreeBSDSemaphore::Wait(int timeout) { |
if (result == -1 && errno == ETIMEDOUT) return false; // Timeout. |
CHECK(result == -1 && errno == EINTR); // Signal caused spurious wakeup. |
} |
+#endif |
} |