From 09c235c936c5945f5ff0ce365206ee291447620d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 8 Sep 2011 23:08:37 +0000 Subject: [PATCH] solaris file allocation support --- src/file.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/file.cpp b/src/file.cpp index b269af3db..3526da15d 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1669,6 +1669,19 @@ namespace libtorrent } #endif // F_PREALLOCATE +#ifdef F_ALLOCSP64 + flock64 fl64; + fl64.l_whence = SEEK_SET; + fl64.l_start = 0; + fl64.l_len = s; + if (fcntl(native_handle(), F_ALLOCSP64, &fl64) < 0) + { + ec.assign(errno, get_posix_category()); + return false; + } + +#endif // F_ALLOCSP64 + #if defined TORRENT_LINUX || TORRENT_HAS_FALLOCATE int ret; #endif