mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
vm_native: unbreak runtime on FreeBSD after 63104af8e9
shm_open() returns a file descriptor on success, not zero. As SHM_ANON only exists on FreeBSD which also has memfd_create use the same code as on Linux. $ rpcs3 [...] Verification failed (in file rpcs3/util/vm_native.cpp:478[:4], in function shm) (errno=2) Segmentation fault
This commit is contained in:
parent
3832d4fa1c
commit
1a90adfb5e
@ -474,8 +474,9 @@ namespace utils
|
||||
|
||||
if ((vm_overcommit & 3) == 0)
|
||||
{
|
||||
#ifdef SHM_ANON
|
||||
ensure(::shm_open(SHM_ANON, O_RDWR, S_IWUSR | S_IRUSR) == 0);
|
||||
#if defined(__FreeBSD__)
|
||||
m_file = ::memfd_create_("", 0);
|
||||
ensure(m_file >= 0);
|
||||
#else
|
||||
const std::string name = "/rpcs3-mem2-" + std::to_string(reinterpret_cast<u64>(this));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user