diff options
author | Emilio Cota <[email protected]> | 2022-04-20 11:57:40 -0400 |
---|---|---|
committer | Emilio Cota <[email protected]> | 2022-04-20 12:12:02 -0400 |
commit | 4f5893e1ec3eace31ee790bf66797d3bf622eebb (patch) | |
tree | 569e662030ecd0fd9f80382788e66da8a5cbb364 | |
parent | 684d69db03de24604b8cf83ad2e0e62c2dc80798 (diff) | |
download | xbyak-4f5893e1ec3eace31ee790bf66797d3bf622eebb.tar.gz xbyak-4f5893e1ec3eace31ee790bf66797d3bf622eebb.zip |
memfd_create: disable for ANDROID_API < 30
The syscall is wrapped in Bionic from API version 30:
https://android.googlesource.com/platform/bionic.git/+/3d24d2b0883e%5E!/
This fixes the build for earlier versions of Android. Note that
MDF_CLOEXEC as well as the raw syscall numbers for memfd_create
were added much earlier:
https://android.googlesource.com/platform/bionic.git/+/82d7504cd7d5%5E!/
-rw-r--r-- | xbyak/xbyak.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h index 3e8e258..9bc12e5 100644 --- a/xbyak/xbyak.h +++ b/xbyak/xbyak.h @@ -95,7 +95,9 @@ #include <stdint.h> #endif -#if !defined(MFD_CLOEXEC) // defined only linux 3.17 or later +// MFD_CLOEXEC defined only linux 3.17 or later. +// Android wraps the memfd_create syscall from API version 30. +#if !defined(MFD_CLOEXEC) || (defined(__ANDROID__) && __ANDROID_API__ < 30) #undef XBYAK_USE_MEMFD #endif |