diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/base_paths.h | 2 | ||||
-rw-r--r-- | base/base_paths_linux.cc | 12 | ||||
-rw-r--r-- | base/native_library.h | 2 | ||||
-rw-r--r-- | base/platform_thread.h | 8 | ||||
-rw-r--r-- | base/port.h | 2 | ||||
-rw-r--r-- | base/process_util.h | 14 | ||||
-rw-r--r-- | base/process_util_posix.cc | 5 | ||||
-rw-r--r-- | base/sys_info_posix.cc | 7 | ||||
-rw-r--r-- | base/third_party/nspr/prcpucfg.h | 2 | ||||
-rw-r--r-- | base/third_party/nspr/prcpucfg_freebsd.h | 337 | ||||
-rw-r--r-- | base/third_party/nspr/prtime.cc | 2 | ||||
-rw-r--r-- | base/time_posix.cc | 7 |
12 files changed, 377 insertions, 23 deletions
diff --git a/base/base_paths.h b/base/base_paths.h index 5f08dc4..86c7a4b 100644 --- a/base/base_paths.h +++ b/base/base_paths.h @@ -13,7 +13,7 @@ #include "base/base_paths_win.h" #elif defined(OS_MACOSX) #include "base/base_paths_mac.h" -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_FREEBSD) #include "base/base_paths_linux.h" #endif #include "base/path_service.h" diff --git a/base/base_paths_linux.cc b/base/base_paths_linux.cc index b235f6b..151c411 100644 --- a/base/base_paths_linux.cc +++ b/base/base_paths_linux.cc @@ -15,15 +15,21 @@ namespace base { +#if defined(OS_LINUX) +const char kSelfExe[] = "/proc/self/exe"; +#elif defined(OS_FREEBSD) +const char kSelfExe[] = "/proc/curproc/file"; +#endif + bool PathProviderLinux(int key, FilePath* result) { FilePath path; switch (key) { case base::FILE_EXE: - case base::FILE_MODULE: { // TODO(evanm): is this correct? + case base::FILE_MODULE: { // TODO(evanm): is this correct? char bin_dir[PATH_MAX + 1]; - int bin_dir_size = readlink("/proc/self/exe", bin_dir, PATH_MAX); + int bin_dir_size = readlink(kSelfExe, bin_dir, PATH_MAX); if (bin_dir_size < 0 || bin_dir_size > PATH_MAX) { - NOTREACHED() << "Unable to resolve /proc/self/exe."; + NOTREACHED() << "Unable to resolve " << kSelfExe << "."; return false; } bin_dir[bin_dir_size] = 0; diff --git a/base/native_library.h b/base/native_library.h index 6c835f2..dc4000b 100644 --- a/base/native_library.h +++ b/base/native_library.h @@ -44,7 +44,7 @@ struct NativeLibraryStruct { }; }; typedef NativeLibraryStruct* NativeLibrary; -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_FREEBSD) typedef void* NativeLibrary; #endif // OS_* diff --git a/base/platform_thread.h b/base/platform_thread.h index 4a2d507..f641f42 100644 --- a/base/platform_thread.h +++ b/base/platform_thread.h @@ -22,12 +22,12 @@ typedef void* PlatformThreadHandle; // HANDLE #elif defined(OS_POSIX) #include <pthread.h> typedef pthread_t PlatformThreadHandle; -#if defined(OS_LINUX) -#include <unistd.h> -typedef pid_t PlatformThreadId; -#elif defined(OS_MACOSX) +#if defined(OS_MACOSX) #include <mach/mach.h> typedef mach_port_t PlatformThreadId; +#else // OS_POSIX && !OS_MACOSX +#include <unistd.h> +typedef pid_t PlatformThreadId; #endif #endif diff --git a/base/port.h b/base/port.h index 18a9361..af4e450 100644 --- a/base/port.h +++ b/base/port.h @@ -47,7 +47,7 @@ // Define an OS-neutral wrapper for shared library entry points #if defined(OS_WIN) #define API_CALL __stdcall -#elif defined(OS_LINUX) || defined(OS_MACOSX) +#else #define API_CALL #endif diff --git a/base/process_util.h b/base/process_util.h index 450dbc2..f002f85 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -13,7 +13,11 @@ #if defined(OS_WIN) #include <windows.h> #include <tlhelp32.h> -#elif defined(OS_LINUX) +#elif defined(OS_MACOSX) +// kinfo_proc is defined in <sys/sysctl.h>, but this forward declaration +// is sufficient for the vector<kinfo_proc> below. +struct kinfo_proc; +#elif defined(OS_POSIX) #include <dirent.h> #include <limits.h> #include <sys/types.h> @@ -50,10 +54,6 @@ struct IoCounters { #include "base/file_descriptor_shuffle.h" #endif -#if defined(OS_MACOSX) -struct kinfo_proc; -#endif - namespace base { // A minimalistic but hopefully cross-platform set of exit codes. @@ -273,11 +273,11 @@ class NamedProcessIterator { #if defined(OS_WIN) HANDLE snapshot_; bool started_iteration_; -#elif defined(OS_LINUX) - DIR *procfs_dir_; #elif defined(OS_MACOSX) std::vector<kinfo_proc> kinfo_procs_; size_t index_of_kinfo_proc_; +#elif defined(OS_POSIX) + DIR *procfs_dir_; #endif ProcessEntry entry_; const ProcessFilter* filter_; diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index ecb4937..9502ca0 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -117,6 +117,9 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { #elif defined(OS_MACOSX) static const rlim_t kSystemDefaultMaxFds = 256; static const char fd_dir[] = "/dev/fd"; +#elif defined(OS_FREEBSD) + static const rlim_t kSystemDefaultMaxFds = 8192; + static const char fd_dir[] = "/dev/fd"; #endif std::set<int> saved_fds; @@ -193,7 +196,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { void SetAllFDsToCloseOnExec() { #if defined(OS_LINUX) const char fd_dir[] = "/proc/self/fd"; -#elif defined(OS_MACOSX) +#elif defined(OS_MACOSX) || defined(OS_FREEBSD) const char fd_dir[] = "/dev/fd"; #endif ScopedDIR dir_closer(opendir(fd_dir)); diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc index 23156e2..b6cc56a 100644 --- a/base/sys_info_posix.cc +++ b/base/sys_info_posix.cc @@ -52,7 +52,8 @@ int SysInfo::NumberOfProcessors() { // static int64 SysInfo::AmountOfPhysicalMemory() { - // _SC_PHYS_PAGES is not part of POSIX and not available on OS X + // _SC_PHYS_PAGES is not part of POSIX and not available on OS X or + // FreeBSD #if defined(OS_MACOSX) struct host_basic_info hostinfo; mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT; @@ -67,6 +68,10 @@ int64 SysInfo::AmountOfPhysicalMemory() { } return static_cast<int64>(hostinfo.max_mem); +#elif defined(OS_FREEBSD) + // TODO(benl): I have no idea how to get this + NOTIMPLEMENTED(); + return 0; #else long pages = sysconf(_SC_PHYS_PAGES); long page_size = sysconf(_SC_PAGE_SIZE); diff --git a/base/third_party/nspr/prcpucfg.h b/base/third_party/nspr/prcpucfg.h index c9c46911..2cf2df3 100644 --- a/base/third_party/nspr/prcpucfg.h +++ b/base/third_party/nspr/prcpucfg.h @@ -36,6 +36,8 @@ #include "base/third_party/nspr/prcpucfg_mac.h" #elif defined(__linux__) #include "base/third_party/nspr/prcpucfg_linux.h" +#elif defined(__FreeBSD__) +#include "base/third_party/nspr/prcpucfg_freebsd.h" #else #error Provide a prcpucfg.h appropriate for your platform #endif diff --git a/base/third_party/nspr/prcpucfg_freebsd.h b/base/third_party/nspr/prcpucfg_freebsd.h new file mode 100644 index 0000000..76d3542 --- /dev/null +++ b/base/third_party/nspr/prcpucfg_freebsd.h @@ -0,0 +1,337 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Netscape Portable Runtime (NSPR). + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef nspr_cpucfg___ +#define nspr_cpucfg___ + +#ifndef XP_UNIX +#define XP_UNIX +#endif + +#ifndef FREEBSD +#define FREEBSD +#endif + +#define PR_AF_INET6 28 /* same as AF_INET6 */ + +#ifndef HAVE_LONG_LONG +#define HAVE_LONG_LONG +#endif + +#if defined(__i386__) + +#define IS_LITTLE_ENDIAN 1 +#undef IS_BIG_ENDIAN +#undef HAVE_ALIGNED_DOUBLES +#undef HAVE_ALIGNED_LONGLONGS + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 4 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 4 +#define PR_BYTES_PER_DWORD 8 +#define PR_BYTES_PER_WORD_LOG2 2 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 32 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 32 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 5 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 5 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 4 +#define PR_ALIGN_OF_INT64 4 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 4 +#define PR_ALIGN_OF_POINTER 4 + +#elif defined(__alpha__) + +#define IS_LITTLE_ENDIAN 1 +#undef IS_BIG_ENDIAN +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 + +#elif defined(__sparc__) + +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 + +#elif defined(__ia64__) + +#define IS_LITTLE_ENDIAN 1 +#undef IS_BIG_ENDIAN +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 +#define PR_ALIGN_OF_WORD 8 + +#elif defined(__amd64__) + +#define IS_LITTLE_ENDIAN 1 +#undef IS_BIG_ENDIAN +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 +#define PR_ALIGN_OF_WORD 8 + +#else + +#error "Unknown CPU architecture" + +#endif + +#ifndef NO_NSPR_10_SUPPORT + +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT +#define BYTES_PER_INT PR_BYTES_PER_INT +#define BYTES_PER_INT64 PR_BYTES_PER_INT64 +#define BYTES_PER_LONG PR_BYTES_PER_LONG +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE +#define BYTES_PER_WORD PR_BYTES_PER_WORD +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD + +#define BITS_PER_BYTE PR_BITS_PER_BYTE +#define BITS_PER_SHORT PR_BITS_PER_SHORT +#define BITS_PER_INT PR_BITS_PER_INT +#define BITS_PER_INT64 PR_BITS_PER_INT64 +#define BITS_PER_LONG PR_BITS_PER_LONG +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE +#define BITS_PER_WORD PR_BITS_PER_WORD + +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 + +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT +#define ALIGN_OF_INT PR_ALIGN_OF_INT +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD + +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 + +#endif /* NO_NSPR_10_SUPPORT */ + +#endif /* nspr_cpucfg___ */ diff --git a/base/third_party/nspr/prtime.cc b/base/third_party/nspr/prtime.cc index c3c271b..2407884 100644 --- a/base/third_party/nspr/prtime.cc +++ b/base/third_party/nspr/prtime.cc @@ -149,7 +149,7 @@ PR_ImplodeTime(const PRExplodedTime *exploded) result *= kSecondsToMicroseconds; result += exploded->tm_usec; return result; -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_FREEBSD) struct tm exp_tm = {0}; exp_tm.tm_sec = exploded->tm_sec; exp_tm.tm_min = exploded->tm_min; diff --git a/base/time_posix.cc b/base/time_posix.cc index 66f41d3..c64f8e7 100644 --- a/base/time_posix.cc +++ b/base/time_posix.cc @@ -143,9 +143,10 @@ void Time::Explode(bool is_local, Exploded* exploded) const { } // TimeTicks ------------------------------------------------------------------ - -#if defined(OS_POSIX) && \ - defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 +// FreeBSD 6 has CLOCK_MONOLITHIC but defines _POSIX_MONOTONIC_CLOCK to -1. +#if (defined(OS_POSIX) && \ + defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0) || \ + defined(OS_FREEBSD) // static TimeTicks TimeTicks::Now() { |