mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12: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
1 changed files with 3 additions and 2 deletions
|
@ -474,8 +474,9 @@ namespace utils
|
||||||
|
|
||||||
if ((vm_overcommit & 3) == 0)
|
if ((vm_overcommit & 3) == 0)
|
||||||
{
|
{
|
||||||
#ifdef SHM_ANON
|
#if defined(__FreeBSD__)
|
||||||
ensure(::shm_open(SHM_ANON, O_RDWR, S_IWUSR | S_IRUSR) == 0);
|
m_file = ::memfd_create_("", 0);
|
||||||
|
ensure(m_file >= 0);
|
||||||
#else
|
#else
|
||||||
const std::string name = "/rpcs3-mem2-" + std::to_string(reinterpret_cast<u64>(this));
|
const std::string name = "/rpcs3-mem2-" + std::to_string(reinterpret_cast<u64>(this));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue