#13155 closed Bugs (fixed)

log doesn't build on a system with pthreads

Reported by: maxim.kartashev@… Owned by: viboes
Milestone: Boost 1.65.0 Component: thread
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:


On Oracle Linux 7.3: sun.compile.c++ bin.v2/libs/log/build/sun/release/stdlib-sun-stlport/threading-m ulti/severity_level.o "./boost/thread/pthread/thread_data.hpp", line 53: Error: The function "getpages ize" must have a prototype. 1 Error(s) detected.


Log requests _XOPEN_SOURCE=600 (meaning the POSIX.1-2001 specification), yet at the same time, this removes the getpagesize() declaration (see getpagesize(2): "In SUSv2 the getpagesize() call is labeled LEGACY, and in POSIX.1-2001 it has been dropped").

This patch should fix the problem:

diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread
index 836e692..7bf360d 100644
--- a/include/boost/thread/pthread/thread_data.hpp
+++ b/include/boost/thread/pthread/thread_data.hpp
@@ -50,7 +50,7 @@ namespace boost
         // stack
         void set_stack_size(std::size_t size) BOOST_NOEXCEPT {
           if (size==0) return;
-          std::size_t page_size = getpagesize();
+          std::size_t page_size = ::sysconf( _SC_PAGESIZE);
           if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;

Change History (4)

comment:1 Changed 17 months ago by maxim.kartashev@…

comment:3 Changed 17 months ago by viboes

Milestone: To Be DeterminedBoost 1.65.0
Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:4 Changed 17 months ago by viboes

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.