--- a/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc +++ b/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc @@ -36,6 +36,11 @@ #include #endif +#if defined(__ANDROID__) && __ANDROID_API__ < 30 +#include +#define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags) +#endif + namespace partition_alloc::internal { #if PA_BUILDFLAG(HAS_64_BIT_POINTERS) --- a/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc +++ b/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc @@ -51,6 +51,11 @@ #endif // PA_CONFIG(ENABLE_SHADOW_METADATA) #endif // PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS) +#if defined(__ANDROID__) && __ANDROID_API__ < 30 +#include +#define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags) +#endif + namespace partition_alloc::internal { #if PA_BUILDFLAG(RECORD_ALLOC_INFO)