From ba4c77e7e5342e74a9bb3b9a0d814c3b2e0a2b41 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 15 Apr 2012 00:48:44 +0000 Subject: [PATCH] merged FreeBSD fix from RC_0_16 --- ChangeLog | 1 + src/disk_io_thread.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index beb1c5a4f..ef7e15b1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ + * fixed FreeBSD build * fixed web seed performance issue whith pieces > 1 MiB * fixed unchoke logic when using web seeds * fixed compatibility with older versions of boost (down to boost 1.40) diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index fa3367f87..045b5331d 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -1452,7 +1452,14 @@ namespace libtorrent // sizing the disk cache size when it's set to // automatic. #ifdef TORRENT_BSD +#ifdef HW_MEMSIZE int mib[2] = { CTL_HW, HW_MEMSIZE }; +#else + // not entirely sure this sysctl supports 64 + // bit return values, but it's probably better + // than not building + int mib[2] = { CTL_HW, HW_PHYSMEM }; +#endif size_t len = sizeof(m_physical_ram); if (sysctl(mib, 2, &m_physical_ram, &len, NULL, 0) != 0) m_physical_ram = 0;