mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
fix android build
Some checks failed
Formatting check / formatting-check (push) Has been cancelled
Build RPCSX / build-linux (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.1-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.2-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.4-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.5-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv9-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv9.1-a) (push) Has been cancelled
Build RPCSX / build-android (x86_64, x86-64) (push) Has been cancelled
Some checks failed
Formatting check / formatting-check (push) Has been cancelled
Build RPCSX / build-linux (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.1-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.2-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.4-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv8.5-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv9-a) (push) Has been cancelled
Build RPCSX / build-android (arm64-v8a, armv9.1-a) (push) Has been cancelled
Build RPCSX / build-android (x86_64, x86-64) (push) Has been cancelled
This commit is contained in:
parent
3ffece2d77
commit
390dadf78e
|
|
@ -4,7 +4,7 @@
|
||||||
#include "EnumBitSet.hpp"
|
#include "EnumBitSet.hpp"
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <system_error>
|
#include <system_error>
|
||||||
#include <utility>
|
#include <vector>
|
||||||
|
|
||||||
namespace rx::mem {
|
namespace rx::mem {
|
||||||
enum class Protection {
|
enum class Protection {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include "format-base.hpp"
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
|
static int memfd_create(const char *name, uint flags) {
|
||||||
|
// FIXME: requires modern android
|
||||||
|
return syscall(__NR_memfd_create, name, flags);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::pair<rx::Mappable, std::errc>
|
std::pair<rx::Mappable, std::errc>
|
||||||
|
|
@ -32,22 +37,13 @@ rx::Mappable::CreateMemory(std::size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
result.m_handle = handle;
|
result.m_handle = handle;
|
||||||
#else
|
|
||||||
#ifdef ANDROID
|
|
||||||
auto name = rx::format("/{}-{:x}", (void *)&result, size);
|
|
||||||
auto fd = ::shm_open(name.c_str(), O_CREAT | O_TRUNC, 0666);
|
|
||||||
#else
|
#else
|
||||||
auto fd = ::memfd_create("", 0);
|
auto fd = ::memfd_create("", 0);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
return {{}, std::errc{errno}};
|
return {{}, std::errc{errno}};
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
::shm_unlink(name.c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
result.m_handle = fd;
|
result.m_handle = fd;
|
||||||
|
|
||||||
if (::ftruncate(fd, size) < 0) {
|
if (::ftruncate(fd, size) < 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue