Boost C++ Libraries: Ticket #824: BOOST_IOSTREAMS_HAS_LSEEK64 on Mac OS X https://svn.boost.org/trac10/ticket/824 <pre class="wiki">Mac OS X has 64-bit file offsets but uses the standard lseek call rather than lseek64. The following is one fix for file_descriptor::seek() but there's no doubt a better way... Change lines 203 and 218 from: 203 #ifndef BOOST_IOSTREAMS_HAS_LSEEK64 204 if ( off &gt; integer_traits&lt;long&gt;::const_max || 205 off &lt; integer_traits&lt;long&gt;::const_min ) 206 { 207 throw BOOST_IOSTREAMS_FAILURE("bad offset"); 208 } 209 #endif 210 211 stream_offset result = 212 #ifdef BOOST_IOSTREAMS_HAS_LSEEK64 213 lseek64 214 #else 215 lseek 216 #endif 217 ( pimpl_-&gt;fd_, 218 #ifdef BOOST_IOSTREAMS_HAS_LSEEK64 219 off, 220 #else 221 static_cast&lt;long&gt;(off), 222 #endif 223 way == BOOST_IOS::beg ? 224 SEEK_SET : 225 way == BOOST_IOS::cur ? 226 SEEK_CUR : 227 SEEK_END ); To: 203 #if !defined(BOOST_IOSTREAMS_HAS_LSEEK64) &amp;&amp; !defined(__MACH__) ... 218 #if defined(BOOST_IOSTREAMS_HAS_LSEEK64) || defined(__MACH__) ... </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/824 Trac 1.4.3 Marshall Clow Wed, 11 Jul 2007 16:33:02 GMT owner, status changed; severity set https://svn.boost.org/trac10/ticket/824#comment:1 https://svn.boost.org/trac10/ticket/824#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">beman_dawes</span> to <span class="trac-author">Beman Dawes</span> </li> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Showstopper</span> </li> </ul> <p> assigning to actual user "bemandawes" instead of unknown user "beman_dawes" </p> Ticket Marshall Clow Sun, 19 Aug 2007 15:35:59 GMT component, description changed https://svn.boost.org/trac10/ticket/824#comment:2 https://svn.boost.org/trac10/ticket/824#comment:2 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iostreams</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/824?action=diff&amp;version=2">diff</a>) </li> </ul> Ticket Beman Dawes Fri, 24 Aug 2007 20:04:35 GMT owner deleted https://svn.boost.org/trac10/ticket/824#comment:3 https://svn.boost.org/trac10/ticket/824#comment:3 <ul> <li><strong>owner</strong> <span class="trac-author">Beman Dawes</span> removed </li> </ul> Ticket Marshall Clow Thu, 27 Sep 2007 14:06:19 GMT owner set https://svn.boost.org/trac10/ticket/824#comment:4 https://svn.boost.org/trac10/ticket/824#comment:4 <ul> <li><strong>owner</strong> set to <span class="trac-author">Jonathan Turkanis</span> </li> </ul> Ticket Jonathan Turkanis Sat, 29 Dec 2007 19:57:31 GMT status changed https://svn.boost.org/trac10/ticket/824#comment:5 https://svn.boost.org/trac10/ticket/824#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> attempted fix in <a class="changeset" href="https://svn.boost.org/trac10/changeset/42343" title="ported changes from branches/iostreams_dev revisions 42306-42342: ...">[42343]</a>. </p> <p> The new header boost/iostreams/detail/config/rtl.hpp attempts to set the preprocessor symbols BOOST_IOSTREAMS_FD_XXX to correct values for XXX = open, close, read, write, seek, truncate, stat, and offset. The implementation of file_descriptor uses these constants where possible instead of using platform specific functions or types. </p> <p> A new test, large_file_test.cpp, was introduced to test seeking with offsets of 1GB to 8GB. In order to enable this test, regression test runners will have to set one of the variables LARGE_FILE_TEMP or LARGE_FILE_KEEP to a pathname where the iostreams library can create an 8GB file. </p> Ticket Jonathan Turkanis Sun, 30 Dec 2007 02:38:27 GMT status, resolution changed https://svn.boost.org/trac10/ticket/824#comment:6 https://svn.boost.org/trac10/ticket/824#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Tested on Cygwin, which is like Darwin in that there are no foo64 functions, but off_t is 64-bit, and on Fedora 8 with _LARGEFILE64_SOURCE defined and _FILE_OFFSET_BITS undefined. </p> <p> I am going to call this fixed. </p> Ticket