From aa1da121bc928759c9cfd9cad011193ddb0343a0 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 24 Jul 2010 02:54:42 +0000 Subject: [PATCH] attempt to support disk IO priority on linux --- src/disk_io_thread.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index cfe3631d9..c0a2277c8 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -59,6 +59,10 @@ POSSIBILITY OF SUCH DAMAGE. #include #endif +#ifdef TORRENT_LINUX +#include +#endif + namespace libtorrent { bool should_cancel_on_abort(disk_io_job const& j); @@ -1751,6 +1755,8 @@ namespace libtorrent #if defined __APPLE__ && defined __MACH__ && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 setiopolicy_np(IOPOL_TYPE_DISK, IOPOL_SCOPE_THREAD , m_settings.low_prio_disk ? IOPOL_THROTTLE : IOPOL_DEFAULT); +#elif defined IOPRIO_WHO_PROCESS + syscall(ioprio_set, IOPRIO_WHO_PROCESS, getpid()); #endif if (m_settings.cache_size == -1) {