diff --git a/build.jam b/build.jam index 969e2a1e..a33b5f0a 100644 --- a/build.jam +++ b/build.jam @@ -8,6 +8,7 @@ require-b2 5.2 ; import feature : feature ; feature boost.process.fs : boost std : optional propagated ; +feature boost.process.disable-close-range : on off : optional ; constant boost_dependencies : /boost/algorithm//boost_algorithm diff --git a/build/Jamfile b/build/Jamfile index 50db715c..db0ed8d3 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -52,6 +52,7 @@ lib boost_process : requirements BOOST_PROCESS_SOURCE=1 shared:BOOST_PROCESS_DYN_LINK=1 boost:/boost/filesystem//boost_filesystem + on:BOOST_PROCESS_V2_POSIX_FORCE_DISABLE_CLOSE_RANGE=1 windows:shell32 windows:user32 windows:ntdll diff --git a/src/posix/close_handles.cpp b/src/posix/close_handles.cpp index 11ed214b..dc3fbe40 100644 --- a/src/posix/close_handles.cpp +++ b/src/posix/close_handles.cpp @@ -44,7 +44,8 @@ int fdwalk(int (*func)(void *, int), void *cd); #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) // kernel has close_range +// kernel has close_range +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) && !defined(BOOST_PROCESS_V2_POSIX_FORCE_DISABLE_CLOSE_RANGE) // version is included by stdlib.h #include #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 34) // glibc is compiled with close_range support