I am try to open SYSTEM V Shared Memory in my app which has App sandbox capability/entitlement enabled. But the system is failing at: ftok() function call.
How can I open create a shared memory in such cases, we know we do have a container folder at '~/Library/Containers' where the app has exclusive read write permission. Is there a way to associate a file this container folder to map the shared memory?
Note I want to open a shared memory to be sued between the apps/service which are in same app group. And I am not looking to any alternate sharing method like XPC..
I am creating this shared memory between by App and network extension service.
System V IPC is a compatibility API an macOS. We recommend against using it in new code. Given that, it shouldn’t come as a big surprise that it doesn’t have a good story regarding the App Sandbox.
If you want to share memory with that style of API, use Posix shared memory (shm_open and friends). Sandboxed processes can share that via an App Group. See IPC and POSIX Semaphores and Shared Memory in the App Sandbox Design Guide.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"