Boost C++ Libraries: Ticket #5355: boost filesystem on Qnx trouble https://svn.boost.org/trac10/ticket/5355 <p> I had two problems with boost.filesystem in boost 1.46.1 that are addressed with the following patch: </p> <ol><li>Compilation failure due to missing declaration of ::rename, which is resolved by including stdio.h. See also <a class="new ticket" href="https://svn.boost.org/trac10/ticket/5277" title="#5277: Bugs: QNX 6.5.0 compilation (new)">ticket:5277</a> </li></ol><ol start="2"><li>Runtime crash (segmentation fault) of boost::filesystem::file_size(...) because struct stat is 60 bytes in operations.cpp whereas everywhere else it is 72 bytes. </li></ol><p> This patch fixes both issues (but probably needs to be guarded by proper preprocessor conditionals?) </p> <pre class="wiki">diff -ru boost_1_46_1/libs/filesystem/v3/src/operations.cpp ../boost_1_46_1/libs/filesystem/v3/src/operations.cpp --- boost_1_46_1/libs/filesystem/v3/src/operations.cpp 2011-03-03 18:00:21.000000000 +0000 +++ ../boost_1_46_1/libs/filesystem/v3/src/operations.cpp 2011-03-22 15:40:32.000000000 +0000 @@ -32,7 +32,7 @@ #if !(defined(__HP_aCC) &amp;&amp; defined(_ILP32) &amp;&amp; \ !defined(_STATVFS_ACPP_PROBLEMS_FIXED)) -#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect, +//#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect, #endif #if !defined(__PGI) #define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX @@ -182,6 +182,7 @@ #include &lt;string&gt; #include &lt;cstring&gt; #include &lt;cstdio&gt; // for remove, rename +#include &lt;stdio.h&gt; #include &lt;cerrno&gt; #include &lt;cassert&gt; // #include &lt;iostream&gt; // for debugging only; comment out when not in use </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5355 Trac 1.4.3 Steven Watanabe Tue, 05 Apr 2011 22:25:44 GMT component changed; owner set https://svn.boost.org/trac10/ticket/5355#comment:1 https://svn.boost.org/trac10/ticket/5355#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Beman Dawes</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">filesystem</span> </li> </ul> Ticket Beman Dawes Fri, 08 Apr 2011 21:48:29 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5355#comment:2 https://svn.boost.org/trac10/ticket/5355#comment:2 <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> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/71131" title="Fix #5355 QNX workarounds ">[71131]</a>) Fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5355" title="#5355: Bugs: boost filesystem on Qnx trouble (closed: fixed)">#5355</a> QNX workarounds </p> Ticket Niklas Angare <li51ckf02@…> Sun, 29 May 2011 12:39:19 GMT attachment set https://svn.boost.org/trac10/ticket/5355 https://svn.boost.org/trac10/ticket/5355 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">operations.cpp_64.patch</span> </li> </ul> Ticket Niklas Angare <li51ckf02@…> Sun, 29 May 2011 12:40:24 GMT <link>https://svn.boost.org/trac10/ticket/5355#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5355#comment:3</guid> <description> <p> I've attached a proper fix to issue 2 that enables large file support. The problem was that the *FILE_OFFSET* defines were defined after some system header files were included indirectly by boost/config.hpp. I've simply moved the code block to the top and removed "!defined(__QNXNTO__) &amp;&amp;". </p> <p> All regression tests on the release branch pass with the patch applied and a small test program is able to correctly report the size of a file that is larger than 4 gigs. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Mon, 30 May 2011 12:33:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5355#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5355#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/72278" title="Fix #5355, QNX large file issues. Thanks to Niklas Angare for ...">[72278]</a>) Fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5355" title="#5355: Bugs: boost filesystem on Qnx trouble (closed: fixed)">#5355</a>, QNX large file issues. Thanks to Niklas Angare for investigating, patch, and testing. </p> </description> <category>Ticket</category> </item> <item> <author>Niklas Angare <li51ckf02@…></author> <pubDate>Wed, 08 Jun 2011 17:49:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5355#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5355#comment:5</guid> <description> <p> Thanks! Any chance of this making it into 1.47? As you may have noticed trunk tests passed on QNX (runner NA-QNX650-qcc-gnu0x) after you submitted the change. </p> </description> <category>Ticket</category> </item> </channel> </rss>