Skip to content

Commit 123fe5f

Browse files
committed
Disable statx syscall usage on Android prior to 11.0.
Even though the syscall number is defined in kernel headers, the syscall is blacklisted by seccomp in runtime. Note that Android 11 also introduces the libc wrapper for statx, so effectively the library will always use the libc wrapper on Android. Reported in boostorg#229.
1 parent 7403ffc commit 123fe5f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

config/has_statx_syscall.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#include <unistd.h>
1818
#include <fcntl.h>
1919

20+
#if defined(__ANDROID__) && (__ANDROID_API__ < 30)
21+
// Even though statx syscall number is defined, it is blacklisted by seccomp in runtime until Android 11
22+
#error "statx syscall is not supported until Android 11"
23+
#endif
24+
2025
#if !defined(__NR_statx)
2126
#error "No statx syscall"
2227
#endif

doc/release_history.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ <h2>1.79.0</h2>
4949
<li>On Windows, <code>directory_iterator</code> internal implementation has been reworked to better utilize modern Windows APIs, which may improve performance while handling symlinks.</li>
5050
<li>On Windows, initialize internal WinAPI function pointers early, if possible, to allow Boost.Filesystem operations to be invoked in global constructors. This is only supported on MSVC, GCC, Clang and compatible compilers.</li>
5151
<li>On Windows, <code>resize_file</code> should no longer fail with an error if the file to be resized is opened.</li>
52+
<li>Disabled use of the <code>statx</code> syscall on Android prior to 11.0 (API version 30). The syscall is blacklisted by seccomp and causes process termination in runtime. (<a href="https://github.com/boostorg/filesystem/issues/229">#229</a>)</li>
5253
<li><b>Deprecated:</b> <code>boost/filesystem/string_file.hpp</code> header is deprecated and will be removed in a future release. The header is no longer included by <code>boost/filesystem.hpp</code> by default. Users are advised to implement the functionality themselves or migrate to other implementations.</li>
5354
<li><b>Deprecated:</b> Windows CE support is deprecated and will be removed in a future release. Windows CE has been untested for many years and is likely non-functional.</li>
5455
</ul>

0 commit comments

Comments
 (0)