Boost C++ Libraries: Ticket #4218: Bug in linux version of function boost::interprocess::set_file_pointer https://svn.boost.org/trac10/ticket/4218 <pre class="wiki">inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos) { return off == ::lseek(hnd, off, (int)pos); } </pre><p> Comparision "off == ::lseek(...)" is correct only if user is setting pointer from the begining of the file 'file_begin'. But if user is setting file pointer to zero from 'file_end' (setting file pointer to the end of file) set_file_pointer function will return false, even if lseek didn't failed. </p> <p> I think its better to change code to something like this </p> <pre class="wiki">inline bool set_file_pointer(file_handle_t hnd, offset_t off, file_pos_t pos) { return -1 != ::lseek(hnd, off, (int)pos); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4218 Trac 1.4.3 Ion Gaztañaga Thu, 26 Aug 2010 10:22:08 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/4218#comment:1 https://svn.boost.org/trac10/ticket/4218#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.43.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> Fixed for Boost 1.45 in release branch </p> Ticket