summaryrefslogtreecommitdiffstats
path: root/base/logging.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-29 00:32:52 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-29 00:32:52 +0000
commite43eddf1a5887c4b249af3daa024c1107ce254a1 (patch)
tree994df09c627978ef3fb93a9fadebd00bebbcb31d /base/logging.cc
parenta672cb9dce10306f3b149802653dbb554b326a44 (diff)
downloadchromium_src-e43eddf1a5887c4b249af3daa024c1107ce254a1.zip
chromium_src-e43eddf1a5887c4b249af3daa024c1107ce254a1.tar.gz
chromium_src-e43eddf1a5887c4b249af3daa024c1107ce254a1.tar.bz2
Changes to base/ from a combination of FreeBSD and OpenBSD patches.
Review URL: http://codereview.chromium.org/495002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/logging.cc')
-rw-r--r--base/logging.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/base/logging.cc b/base/logging.cc
index 706dbb1..72630fc 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.