Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Unified Diff: base/logging.cc

Issue 495002: Changes to base/ from a combination of FreeBSD and OpenBSD patches. (Closed)
Patch Set: minor tweaks Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/logging.cc
diff --git a/base/logging.cc b/base/logging.cc
index 706dbb1df44fefc6c5d3a4e7de6f71a698aec482..72630fcd04d8c85fd3c8c0e91b3044c747e0e62f 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -18,7 +18,7 @@ typedef HANDLE MutexHandle;
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <mach-o/dyld.h>
-#elif defined(OS_LINUX)
+#elif defined(OS_POSIX)
#include <sys/syscall.h>
#include <time.h>
#endif
@@ -137,6 +137,9 @@ int32 CurrentThreadId() {
return mach_thread_self();
#elif defined(OS_LINUX)
return syscall(__NR_gettid);
+#elif defined(OS_FREEBSD)
+ // TODO(BSD): find a better thread ID
+ return reinterpret_cast<int64>(pthread_self());
#endif
}
@@ -145,7 +148,7 @@ uint64 TickCount() {
return GetTickCount();
#elif defined(OS_MACOSX)
return mach_absolute_time();
-#elif defined(OS_LINUX)
+#elif defined(OS_POSIX)
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
@@ -226,7 +229,7 @@ bool InitializeLogFileHandle() {
return true;
}
-#if defined(OS_LINUX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
int GetLoggingFileDescriptor() {
// No locking needed, since this is only called by the zygote server,
// which is single-threaded.

Powered by Google App Engine
This is Rietveld 408576698