Skip to content

Commit 41a4a5a

Browse files
Added BOOST_PROCESS_V2_POSIX_FORCE_DISABLE_CLOSE_RANGE
Implements #378.
1 parent fae23e6 commit 41a4a5a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

build.jam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require-b2 5.2 ;
88
import feature : feature ;
99

1010
feature boost.process.fs : boost std : optional propagated ;
11+
feature boost.process.disable-close-range : on off : optional ;
1112

1213
constant boost_dependencies :
1314
/boost/algorithm//boost_algorithm

build/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ lib boost_process
5252
: requirements <define>BOOST_PROCESS_SOURCE=1
5353
<link>shared:<define>BOOST_PROCESS_DYN_LINK=1
5454
<boost.process.fs>boost:<library>/boost/filesystem//boost_filesystem
55+
<boost.process.disable-close-range>on:<define>BOOST_PROCESS_V2_POSIX_FORCE_DISABLE_CLOSE_RANGE=1
5556
<target-os>windows:<library>shell32
5657
<target-os>windows:<library>user32
5758
<target-os>windows:<library>ntdll

src/posix/close_handles.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ int fdwalk(int (*func)(void *, int), void *cd);
4444

4545
#include <linux/version.h>
4646

47-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) // kernel has close_range
47+
// kernel has close_range
48+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) && !defined(BOOST_PROCESS_V2_POSIX_FORCE_DISABLE_CLOSE_RANGE)
4849

4950
// version is included by stdlib.h #include <gnu/libc-version.h>
5051
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 34) // glibc is compiled with close_range support

0 commit comments

Comments
 (0)